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
转载于:https://www.cnblogs.com/YuyuanNo1/p/7928661.html