Optimize date range condition (#11911)

This commit is contained in:
juzimao 2022-09-14 16:55:10 +08:00 committed by GitHub
parent d3a77c68e6
commit b1068e27ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -122,8 +122,11 @@
<if test="searchVal != null and searchVal != ''">
and instance.name like concat('%', #{searchVal}, '%')
</if>
<if test="startTime != null and endTime != null ">
and instance.start_time <![CDATA[ >= ]]> #{startTime} and instance.start_time <![CDATA[ <= ]]> #{endTime}
<if test="startTime != null">
and instance.start_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null">
and instance.start_time <![CDATA[ <= ]]> #{endTime}
</if>
<if test="states != null and states.length > 0">
and instance.state in