From f974bf528f0fd1f7316bdb3f06be8004e8db9f15 Mon Sep 17 00:00:00 2001 From: wangwh <2397901735@qq.com> Date: Wed, 21 Aug 2024 17:24:07 +0800 Subject: [PATCH] 用户中心部分迁移1 --- dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml | 82 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 82 insertions(+), 0 deletions(-) diff --git a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml index eb876ed..3a4d8be 100644 --- a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml +++ b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml @@ -325,4 +325,86 @@ limit #{page.offset}, #{page.size} </select> + <!-- 根据条件统计 --> + <select id="countQueryCtUser" resultType="java.lang.Long"> + SELECT COUNT(distinct t1.id) + FROM dyh_ct_user t1 + LEFT JOIN dyh_ct_userole t2 on t1.id = t2.user_id + <if test="terms != null"> + <where> + <if test="terms.trueName != null and terms.trueName !=''"> + and t1.true_name like concat('%', #{terms.trueName}, '%') + </if> + <if test="terms.acc != null and terms.acc !=''"> + and t1.acc like concat('%', #{terms.acc}, '%') + </if> + <if test="terms.unitId != null and terms.unitId !=''"> + and t1.unit_id = #{terms.unitId} + </if> + <if test="terms.deptId != null and terms.deptId !=''"> + and t1.dept_id = #{terms.deptId} + </if> + <if test="terms.status != null and terms.status !=''"> + and t1.status = #{terms.status} + </if> + <if test="terms.deleteStatus = null and terms.deleteStatus =''"> + and t1.delete_status = '1' + </if> + <if test="terms.deleteStatus != null and terms.deleteStatus !=''"> + and t1.delete_status = #{terms.deleteStatus} + </if> + <if test="terms.roleId != null and terms.roleId !=''"> + and t2.role_id = #{terms.roleId} + </if> + </where> + </if> + </select> + + <!-- 根据条件分页查询 --> + <select id="pageQueryCtUser" resultMap="dataResult"> + SELECT t1.* + FROM dyh_ct_user t1 + LEFT JOIN dyh_ct_userole t2 on t1.id = t2.user_id + <if test="terms != null"> + <where> + <if test="terms.trueName != null and terms.trueName !=''"> + and t1.true_name like concat('%', #{terms.trueName}, '%') + </if> + <if test="terms.acc != null and terms.acc !=''"> + and t1.acc like concat('%', #{terms.acc}, '%') + </if> + <if test="terms.unitId != null and terms.unitId !=''"> + and t1.unit_id = #{terms.unitId} + </if> + <if test="terms.deptId != null and terms.deptId !=''"> + and t1.dept_id = #{terms.deptId} + </if> + <if test="terms.status != null and terms.status !=''"> + and t1.status = #{terms.status} + </if> + <if test="terms.deleteStatus = null and terms.deleteStatus =''"> + and t1.delete_status = '1' + </if> + <if test="terms.deleteStatus != null and terms.deleteStatus !=''"> + and t1.delete_status = #{terms.deleteStatus} + </if> + <if test="terms.roleId != null and terms.roleId !=''"> + and t2.role_id = #{terms.roleId} + </if> + <if test="terms.roleCode != null and terms.roleCode !=''"> + and t2.role_code = #{terms.roleCode} + </if> + </where> + </if> + GROUP BY t1.id + <if test="page.sort != null"> + <foreach collection="page.sort" item="s" index="index" separator="," open="order by "> + isnull(${s.property}), ${s.property} ${s.direction} + </foreach> + </if> + <if test="page.sort == null"> + order by isnull(t1.create_time), t1.create_time desc + </if> + limit #{page.offset}, #{page.size} + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0