update 优化去除sql差异化 时间范围统一使用 between 处理
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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 |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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}, |
| | |
| | | <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}, |