参考 https://www.cnblogs.com/xuwc/p/13993030.html

image.png
image.png

ForEachHandler

image.png

TrimHandler

image.png

IfHandler

image.png

内部使用了OGNL处理表达式逻辑

image.png

image.png
image.png

  1. <select id="selectOddPostsIn" resultType="org.apache.ibatis.domain.blog.Post">
  2. SELECT *
  3. FROM POST P
  4. WHERE ID in
  5. <foreach item="item" index="index" collection="list"
  6. open="(" separator="," close=")">
  7. <if test="index % 2 != 0">
  8. #{item}
  9. </if>
  10. </foreach>
  11. ORDER BY P.ID
  12. </select>

image.png

内部使用了OGNL处理表达式逻辑查阅资料发现了是这个框架https://github.com/jkuhnert/ognl 并看到了作者,真的是老老老程序员了https://lenart.org.pl/
iShot_2022-06-30_17.23.56.png