Helius
2022-02-21 f54f8a92c09a2cd76b3bbb796df680215b63ab8a
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
85
86
87
88
89
90
91
92
93
<?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.xzx.gc.user.mapper.UserRoleMapper">
 
    <select id="queryByCondition" resultType="com.xzx.gc.entity.UserRole">
        select
            t.*
        from xzx_user_role_info t
        where 1=1  and del_flag=0
    </select>
 
    <delete id="batchDelXzxUserRoleInfoByIds">
        update xzx_user_role_info set del_flag = 1 where id  in
        <foreach collection="ids" index="index" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
    <update id="updatePunchChannel">
        UPDATE xzx_sys_config_info SET config_value = #{status} WHERE config_type_code= #{configTypeCode}
    </update>
 
    <select id="queryPunchChannel" resultType="java.lang.String">
        select config_value from  xzx_sys_config_info WHERE config_type_code= 'CODE_SCAN_RK'
    </select>
 
    <select id="queryMaxAppRole" resultType="com.xzx.gc.entity.UserRole">
        select a.* from xzx_user_role_info a where a.role_code = (select max(b.role_code) from xzx_user_role_info b)
    </select>
 
 
    <select id="queryEditroleApi" parameterType="com.xzx.gc.model.admin.UserEditroleModel"
            resultType="com.xzx.gc.model.admin.UserEditroleModel">
        SELECT
        a.regist_time,
        a.user_id,
        a.NAME,
        a.nick_name,
        a.mobile_phone,
        a.user_id,
        b.role_name AS user_type,
        c.login_time,
        a.del_flag AS delFlag,
        a.town_id AS area,
        a.user_type AS userTypeValue,
        a.partner_id,
        a.storage_id,
        a.origin_type AS originType,
        a.province_id,
        a.city_id,
        a.township_id,
        ( SELECT d.partner_name FROM xzx_city_partner d WHERE d.id = a.partner_id ) AS partnerName
        FROM xzx_user_other_info a
        LEFT JOIN xzx_user_role_info b on a.user_type=b.role_code
        LEFT JOIN (
        SELECT * FROM xzx_user_login_info GROUP BY user_id ORDER BY login_id
        ) as c ON c.user_id = a.user_id
        WHERE 1=1 and a.user_type <![CDATA[!= ]]>8 and a.del_flag=0
        <choose>
            <when test="originType==1">
                and a.origin_type=1
            </when>
            <when test="originType==0">
                and a.origin_type is null
            </when>
        </choose>
        <if test="mobilePhone != null and mobilePhone != ''">
            AND a.mobile_phone like concat("%",#{mobilePhone},"%")
        </if>
        <if test=" partnerIds != null and partnerIds.size() != 0">
            AND a.partner_id in
            <foreach collection="partnerIds" index="index" item="id" open="(" separator="," close=")">
                #{id}
            </foreach>
        </if>
    </select>
 
    <select id="queryAllAPPRoleExt" resultType="java.util.Map">
        SELECT
        role_name as roleName,
        del_flag as delFlag,
        auth_ids as authIds,
        update_time as updateTime,
        create_time as createTime,
        role_code as roleCode,
        id as id
        FROM xzx_user_role_info WHERE del_flag='0' and role_code not in (7,8)
        <if test="partnerId != null and partnerId != ''">
            and role_code <![CDATA[!= ]]> 9
        </if>
    </select>
 
</mapper>