<if test="STATE !=null and STATE !=''">
<if test="STATE == 5 or STATE == '5'">
AND TCRT.STATE = #{STATE}
</if>
<if test="STATE == 4 or STATE == '4'">
AND TCRT.STATE = '4'
AND trunc(TCRT.END_TIME) > trunc(to_date(TO_CHAR(sysdate,'YYYY-MM-DD'),'YYYY-MM-DD'))
</if>
<if test="STATE == 6 or STATE == '6'">
AND TCRT.STATE = '4'
AND trunc(TCRT.END_TIME) < trunc(to_date(TO_CHAR(sysdate,'YYYY-MM-DD'),'YYYY-MM-DD'))
</if>
</if>
<if test="BEGIN_DATE !=null and BEGIN_DATE !=''">
AND trunc(TCRT.END_TIME) >= trunc(to_date(#{BEGIN_DATE},'yyyy-MM-dd'))
</if>
<if test="END_DATE !=null and END_DATE !=''">
AND trunc(TCRT.END_TIME) <= trunc(to_date(#{END_DATE},'yyyy-MM-dd'))
</if>