# mybatis Mapper动态sql

# 参考链接

https://mybatis.net.cn/dynamic-sql.html

# if

<select id="findActiveBlogLike"
     resultType="Blog">
  SELECT * FROM BLOG WHERE state = ‘ACTIVE’
  <if test="title != null">
    AND title like #{title}
  </if>
  <if test="author != null and author.name != null">
    AND author_name like #{author.name}
  </if>
</select>
Last Updated: 6/16/2024, 10:18:34 PM