mybatis的<choose>和<when>、<otherwise>标签
SELECT
<choose>
<when test='timeType=="yy"'>
TO_CHAR(REPORT_TIME,'yyyy')
</when>
<when test='timeType=="mm"'>
TO_CHAR(REPORT_TIME,'yyyy-MM-dd')
</when>
<when test='timeType=="dd"'>
TO_CHAR(REPORT_TIME,'yyyy-MM-dd')
</when>
</choose>
RQ,
<choose>
<when test='isAll != null and isAll == 1'>
SUM(TOTAL)
</when>
<otherwise>
SUM(GROW_TOTAL)
</otherwise>
</choose>
NUM
FROM REPORT_EMPLOYEE
不积跬步无以至千里,不积小流无以成江海