1.查询两个日期之间的日期内容
<if test="start != null and start != ''">AND checktime <![CDATA[>]]> #{start}</if>
<if test="end != null and end != ''">AND checktime <![CDATA[<]]>#{end}</if>
2.某个字段的模糊查询
方法一:
<if test="titles != null and titles !=''">and title LIKE CONCAT(CONCAT('%', #{titles}), '%') </if>
方法二:
SELECT * FROM tableName WHERE name LIKE CONCAT(CONCAT('%', #{text}), '%');
方法三:
SELECT * FROM tableName WHERE name LIKE '%${name}%';