数据库中是时间戳类型
mybatis中的字符串转换:
SELECT * FROM
“public”.“sys_log”
<where>
<if test="type != null ">type = #{type}</if>
<if test="startTime != null and ''!= startTime">and create_date >= TO_TIMESTAMP(#{startTime}, 'yyyy-mm-dd hh24:mi:ss')</if>
<if test="endTime != null and ''!= endTime">and create_date <= TO_TIMESTAMP(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')</if>
</where>
order by create_date desc
limit #{limit} offset #{offset}
;