liujie
2025-07-28 039abee6b27058ca46b1e1e82aa0b5407a5dad44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.panzhihua.westcommittee.dao.SystemUserMapper">
 
    
    <select id="list" resultType="com.panzhihua.westcommittee.warpper.SystemUserListVo">
        select distinct
            a.id,
            a.name,
            a.phone,
            f.`name` as systemPostName,
            g.`name` as systemRoleName,
            a.`status`,
            h.name departmentName
        from west_system_user a
        left join west_system_post f on (a.system_post_id = f.id)
        left join west_system_role g on (a.system_role_id = g.id)
        left join west_department h on (a.one_department_id = h.id)
        where a.`status` != 3
        <if test="null != query.name and '' != query.name">
            and a.name like CONCAT('%', #{query.name}, '%')
        </if>
        <if test="null != query.phone and '' != query.phone">
            and a.phone like CONCAT('%', #{query.phone}, '%')
        </if>
        <if test="null != query.systemRoleId">
            and a.system_role_id = #{query.systemRoleId}
        </if>
        <if test="null != query.deptId">
             and a.one_department_id = #{query.deptId}
        </if>
 
        order by a.create_time desc
    </select>
    
    
    
    <select id="getRegion" resultType="com.panzhihua.westcommittee.model.vo.RegionVO">
        select region_code as id, region_name as name from bc_region where parent_id = #{pcode}
    </select>
    
    
    <select id="getStreet" resultType="com.panzhihua.westcommittee.model.vo.RegionVO">
        select CAST(street_id AS CHAR) as id, name as name from com_street where app_id ='wx0cef797390444b75'
    </select>
    
    
    <select id="getCommunity" resultType="com.panzhihua.westcommittee.model.vo.RegionVO">
        select CAST(community_id AS CHAR) as id, name as name from com_act where street_id = #{streetId}
    </select>
 
    <select id="getCreateByIdPhone" resultType="java.lang.String">
        select phone from sys_user where user_id = #{createBy}
    </select>
    <select id="list1" resultType="com.panzhihua.westcommittee.warpper.SystemUserListVo">
        select distinct
        a.id,
        a.name,
        a.phone,
        f.`name` as systemPostName,
        g.`name` as systemRoleName,
        a.`status`,
        h.name departmentName
        from west_system_user a
        left join west_system_post f on (a.system_post_id = f.id)
        left join west_system_role g on (a.system_role_id = g.id)
        left join west_department h on (a.one_department_id = h.id)
        where a.`status` != 3
        <if test="null != query.name and '' != query.name">
            and a.name like CONCAT('%', #{query.name}, '%')
        </if>
        <if test="null != query.phone and '' != query.phone">
            and a.phone like CONCAT('%', #{query.phone}, '%')
        </if>
        <if test="null != query.systemRoleId">
            and a.system_role_id = #{query.systemRoleId}
        </if>
            and a.one_department_id in <foreach collection="deptIds" open="(" separator="," item="id" close=")">#{id}</foreach>
        order by a.create_time desc
    </select>
 
</mapper>