refactor: 日期格式化为数据库日期格式,避免日期比较使用函数导致索引失效

This commit is contained in:
hxr
2023-10-19 00:00:02 +08:00
parent dfd233739b
commit ee438b5370
4 changed files with 45 additions and 24 deletions

View File

@@ -37,16 +37,12 @@
<if test='queryParams.deptId!=null'>
AND concat(',',concat(d.tree_path,',',d.id),',') like concat('%,',#{queryParams.deptId},',%')
</if>
<if test="queryParams.createTimeRange != null and queryParams.createTimeRange.size() == 2 ">
<if test="queryParams.createTimeRange[0] != null and queryParams.createTimeRange[0].trim() neq ''">
AND u.create_time &gt;= #{queryParams.createTimeRange[0]}
</if>
<if test="queryParams.createTimeRange[1] != null and queryParams.createTimeRange[1].trim() neq ''">
AND u.create_time &lt;= #{queryParams.createTimeRange[1]}
</if>
<if test="queryParams.startTime != null">
AND u.create_time &gt;= #{queryParams.startTime}
</if>
<if test="queryParams.endTime != null">
AND u.create_time &lt;= #{queryParams.endTime}
</if>
</where>
GROUP BY u.id