How does MybatisPlus compare dates, only compare year, month and day!
- Compare year, month and day
<if test="query != null and query.opTimeBegin != null">
and TO_CHAR(a.OP_TIME,'yyyymmdd') <![CDATA[ >= ]]> TO_CHAR(#{query.opTimeBegin},'yyyymmdd')
</if>
- Description: Convert the date format data and conditional date format in the library into string format for comparison!
- Compare year and month
<if test="query != null and query.opTimeBegin != null">
and TO_CHAR(a.OP_TIME,'yyyymm') <![CDATA[ >= ]]> TO_CHAR(#{query.opTimeBegin},'yyyymm')
</if>