jinlin
2024-01-12 bb3bc1c8508dc28d1780c2b0e068595baedb5100
zt/core/src/main/resources/mapper/sys/SysUserDao.xml
@@ -32,7 +32,7 @@
        select a.id
             , a.dept_id
             , a.company_id
             , '1271368584383188993' as                                            TENANT_ID
             , '1271368584383188993' as                                  TENANT_ID
             , a.username
             , a.real_name
             , a.mobile
@@ -47,7 +47,7 @@
        select a.id
             , a.dept_id
             , a.company_id
             , '1271368584383188993' as TENANT_ID
             , '1271368584383188993' as                                  TENANT_ID
             , a.username
             , a.real_name
             , a.mobile
@@ -68,10 +68,10 @@
          and a.id = #{userId}
          and b.user_id = a.id
          and c.id = b.role_id
          and ((#{localServer} = 'jd' and c.code in ('cjbm','ztsxlbm'))
              or (#{localServer} = 'cj'
                      and c.code in ('zlbm','tybm','ywzbm','tzbm','czbm','bzbm','dbsbm')
                )
          and ((#{localServer} = 'jd' and c.code in ('cjbm', 'ztsxlbm'))
            or (#{localServer} = 'cj'
                and c.code in ('zlbm', 'tybm', 'ywzbm', 'tzbm', 'czbm', 'bzbm', 'dbsbm')
                   )
            )
    </select>
    <select id="isGetByUsernameList" resultType="com.zt.core.sys.model.SysUser">
@@ -103,7 +103,7 @@
        select a.id
             , a.dept_id
             , a.company_id
             , '1271368584383188993' as                                            TENANT_ID
             , '1271368584383188993' as                                  TENANT_ID
             , a.username
             , a.real_name
             , a.mobile
@@ -159,7 +159,7 @@
        WHERE b.is_delete = 0
          AND b.user_id = #{userId}
          and a.is_delete = 0
        and a.id =b.role_id
          and a.id = b.role_id
    </select>
    <update id="updateLogin">
@@ -208,32 +208,26 @@
        from sys_user
        where dept_id = #{newShipTeam}
          and id in (select user_id
                          from sys_role_user a,
                               sys_role b
                          where a.role_id = b.id
                            and b.code = 'tybm')
                     from sys_role_user a,
                          sys_role b
                     where a.role_id = b.id
                       and b.code = 'tybm')
    </select>
    <select id="checkTestHome" resultType="java.lang.Integer">
        SELECT
            count( 1 )
        FROM
            sys_user
        WHERE
            is_delete = 0
        SELECT count(1)
        FROM sys_user
        WHERE is_delete = 0
          AND id = #{userId}
          AND (
                user_name IN ( 'admin', 'yszl' )
                user_name IN ('admin', 'yszl')
                OR id IN (
                SELECT
                    user_id
                FROM
                    sys_role_user b,
                    sys_role c
                WHERE
                    b.is_delete = 0
                SELECT user_id
                FROM sys_role_user b,
                     sys_role c
                WHERE b.is_delete = 0
                  AND c.is_delete = 0
                  AND c.id = b.role_id
                  AND c.`code` IN ( 'xtglybm', 'ztsxlbm', 'dbsbm', 'zlbm', 'bzbm', 'czbm' )
                  AND c.`code` IN ('xtglybm', 'ztsxlbm', 'dbsbm', 'zlbm', 'bzbm', 'czbm')
            )
            )
    </select>
@@ -243,7 +237,8 @@
        <if test="type == null or type == ''">
            and id not in (
            select user_id from sys_role_user where role_id
            in (select id from sys_role where code in ('xtglybm','xtbmybm','xtsjybm','rx')))
            in (select id from sys_role where code in ('xtglybm','xtbmybm','xtsjybm','rx')and is_delete=0)and
            is_delete=0)and is_delete=0
        </if>
        <if test="deptId != null and deptId != ''">
            and dept_id = #{deptId}
@@ -251,31 +246,34 @@
        <if test="type == 'zrr'">
            and id in (
            select user_id from sys_role_user where role_id
            in (select id from sys_role where code in ('jcry')))
            in (select id from sys_role where code in ('jcry')and is_delete=0)and is_delete=0)and is_delete=0
        </if>
        <if test="type == 'csry'">
            and id in (
            select user_id from sys_role_user where role_id
            in (select id from sys_role where code in ('jcry')))
            in (select id from sys_role where code in ('jcry')and is_delete=0)and is_delete=0)and is_delete=0
        </if>
        <if test="type == 'shry'">
            and id in (
            select user_id from sys_role_user where role_id
            in (select id from sys_role where code in ('jcry','zljdy','shry')))
            in (select id from sys_role where code in ('jcry','zljdy','shry')and is_delete=0)and is_delete=0) and
            is_delete=0
        </if>
        <if test="type == 'pzry'">
            and id in (
            select user_id from sys_role_user where role_id
            in (select id from sys_role where code in ('jcry','shry')))
            in (select id from sys_role where code in ('jcry','shry')and is_delete=0)and is_delete=0)and is_delete=0
        </if>
    </select>
    <select id="getUsersName" resultType="java.lang.String">
        select real_name from sys_user WHERE id=${id}
        select real_name
        from sys_user
        WHERE id = ${id}
    </select>
    <update id="updatePassword">
        update
        sys_user
            sys_user
        set password = #{password}
        WHERE id=#{id}
        WHERE id = #{id}
    </update>
</mapper>