update 优化去除sql差异化 时间范围统一使用 between 处理
This commit is contained in:
parent
a54cb7d3e4
commit
b2d3abd9d6
@ -66,11 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="genTable.tableComment != null and genTable.tableComment != ''">
|
||||
AND lower(table_comment) like lower(concat('%', #{genTable.tableComment}, '%'))
|
||||
</if>
|
||||
<if test="genTable.params.beginTime != null and genTable.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') >= date_format(#{genTable.params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="genTable.params.endTime != null and genTable.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') <= date_format(#{genTable.params.endTime},'%y%m%d')
|
||||
<if test="genTable.params.beginTime != null and genTable.params.endTime != null">
|
||||
AND create_time between #{genTable.params.beginTime} and #{genTable.params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -86,11 +83,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="genTable.tableComment != null and genTable.tableComment != ''">
|
||||
AND lower(table_comment) like lower(concat('%', #{genTable.tableComment}, '%'))
|
||||
</if>
|
||||
<if test="genTable.params.beginTime != null and genTable.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') >= date_format(#{genTable.params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="genTable.params.endTime != null and genTable.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') <= date_format(#{genTable.params.endTime},'%y%m%d')
|
||||
<if test="genTable.params.beginTime != null and genTable.params.endTime != null">
|
||||
AND create_time between #{genTable.params.beginTime} and #{genTable.params.endTime}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
@ -105,11 +99,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="tableComment != null and tableComment != ''">
|
||||
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
<if test="params.beginTime != null and params.endTime != null">
|
||||
AND create_time between #{params.beginTime} and #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -125,11 +116,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="tableComment != null and tableComment != ''">
|
||||
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
<if test="params.beginTime != null and params.endTime != null">
|
||||
AND create_time between #{params.beginTime} and #{params.endTime}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
@ -17,18 +17,6 @@
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPostVo">
|
||||
select post_id,
|
||||
post_code,
|
||||
post_name,
|
||||
post_sort,
|
||||
status,
|
||||
create_by,
|
||||
create_time,
|
||||
remark
|
||||
from sys_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostListByUserId" parameterType="Long" resultType="Long">
|
||||
select p.post_id
|
||||
from sys_post p
|
||||
|
@ -54,11 +54,8 @@
|
||||
<if test="role.roleKey != null and role.roleKey != ''">
|
||||
AND r.role_key like concat('%', #{role.roleKey}, '%')
|
||||
</if>
|
||||
<if test="role.params.beginTime != null and role.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') >= date_format(#{role.params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="role.params.endTime != null and role.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') <= date_format(#{role.params.endTime},'%y%m%d')
|
||||
<if test="role.params.beginTime != null and role.params.endTime != null">
|
||||
AND r.create_time between #{role.params.beginTime} and #{role.params.endTime}
|
||||
</if>
|
||||
order by r.role_sort
|
||||
</select>
|
||||
@ -78,11 +75,8 @@
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
AND r.role_key like concat('%', #{roleKey}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
<if test="params.beginTime != null and params.endTime != null">
|
||||
AND r.create_time between #{params.beginTime} and #{params.endTime}
|
||||
</if>
|
||||
order by r.role_sort
|
||||
</select>
|
||||
|
@ -100,11 +100,8 @@
|
||||
<if test="user.phonenumber != null and user.phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{user.phonenumber}, '%')
|
||||
</if>
|
||||
<if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{user.params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="user.params.endTime != null and user.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{user.params.endTime},'%y%m%d')
|
||||
<if test="user.params.beginTime != null and user.params.endTime != null">
|
||||
AND u.create_time between #{user.params.beginTime} and #{user.params.endTime}
|
||||
</if>
|
||||
<if test="user.deptId != null and user.deptId != 0">
|
||||
AND (u.dept_id = #{user.deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{user.deptId},
|
||||
@ -130,11 +127,8 @@
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
<if test="params.beginTime != null and params.endTime != null">
|
||||
AND u.create_time between #{params.beginTime} and #{params.endTime}
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
||||
|
Loading…
x
Reference in New Issue
Block a user