select
*
from U_WORK_ORDER_QUESTION
WHERE 1=1
AND CREATE_TIME >= to_date('2021-08-19 01:57:58', 'yyyy-mm-dd hh24:mi:ss')
AND CREATE_TIME <= to_date('2021-08-19 14:57:58', 'yyyy-mm-dd hh24:mi:ss')
oracle 日期查询直接传date有时候会有问题,代码中传字符串参数,sql中使用to_date()函数
UPDATE
U_WORK_ORDER_QUESTION
<set>
<if test="reminded != null">
IS_REMIND = #{reminded},
</if>
</set>
WHERE
1 = 1
<if test="isRemind != null">
AND IS_REMIND = #{isRemind}
</if>
<if test="startTime != null">
<![CDATA[ AND CREATE_TIME >= to_date(#{startTime}, 'yyyy-mm-dd hh24:mi:ss')]]>
</if>
<if test="endTime != null">
<![CDATA[ AND CREATE_TIME <= to_date(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')]]>
</if>