For example: if the start time and end time are both varchar types, then you can use the following method to get the time range
<if test="startTime != null">
<![CDATA[ and o.STARTTIME >= #{startTime}]]>
</if>
<if test="endTime != null">
<![CDATA[ and o.ENDTIME <= #{endTime}]]>
</if>