like
subject_name LIKE CONCAT('%', #{subjectName,jdbcType=VARCHAR}, '%')
或
subject_name LIKE CONCAT('%', TRIM(#{subjectName,jdbcType=VARCHAR}), '%')
in
<if test="status != null">
and status in
<foreach item="item" collection="status" separator="," open="(" close=")" index="index">
#{item, jdbcType=TINYINT}
</foreach>
</if>
if
<if test="subjectNo != null and subjectNo != '' ">
and subject_no = #{subjectNo,jdbcType=VARCHAR}
</if>
choose
<choose>
<!-- 周 -->
<when test="dateType == 'WEEK' ">
concat(DATE_FORMAT(statistic_time ,'%X-%V'),'(周)') as statisticTime,
</when>
<!-- 月 -->
<when test="dateType == 'MONTH' ">
DATE_FORMAT(statistic_time ,'%Y-%m') as statisticTime,
</when>
<!-- 年 -->
<when test="dateType == 'YEAR' ">
DATE_FORMAT(statistic_time ,'%Y') as statisticTime,
</when>
<!-- 默认 日 -->
<otherwise>
DATE_FORMAT(statistic_time ,'%Y-%m-%d') as statisticTime,
</otherwise>
</choose>
CDATA
<![CDATA[
a < 1
]]>