zhangherong
2025-06-12 6abc1a2fb78003bb1ea6283d813b8ccc0bcd9b2b
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
<?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="org.jeecg.modules.system.mapper.MdcUserProductionMapper">
 
    <!--根据指定用户id查询产线id集合-->
    <select id="queryProductionIdsByUserId" resultType="java.lang.String">
        SELECT pro_id FROM mdc_user_production WHERE user_id = #{userId}
    </select>
    <select id="getUserPermsByGroupId" resultType="org.jeecg.modules.system.entity.SysUser">
        select u.id
             , u.username
             , u.realname
             , u.avatar
             , u.phone
             , u.email
        from sys_user u
                 inner join
             (select user_id from mdc_user_production where pro_id=#{proId}) p
             on u.id=p.user_id
    </select>
    <select id="getUserNonPermsByGroupId" resultType="org.jeecg.modules.system.entity.SysUser">
        select u.id
             , u.username
             , u.realname
             , u.avatar
             , u.phone
             , u.email
        from sys_user u
        where u.id not in (select user_id from mdc_user_production where pro_id=#{proId})
    </select>
    <select id="getUserNonPermsByDeviceId" resultType="org.jeecg.modules.system.entity.SysUser">
        select u.id
             , u.username
             , u.realname
             , u.avatar
             , u.phone
             , u.email
        from sys_user u
        where u.id not in (select user_id from nc_device_permission where device_id=#{deviceId})
    </select>
    <select id="getUserPermsByDeviceId" resultType="org.jeecg.modules.system.entity.SysUser">
        select u.id
             , u.username
             , u.realname
             , u.avatar
             , u.phone
             , u.email
        from sys_user u
                 inner join
                 (select user_id from nc_device_permission where device_id=#{deviceId}) p
                 on u.id=p.user_id
    </select>
    <select id="queryByPostAndProId" resultType="org.jeecg.modules.system.entity.SysUser">
        select u.*
        from sys_user u
                 inner join
                 (select user_id from mdc_user_production where pro_id=#{proId}) p
                 on u.id=p.user_id
        where u.post = #{post}
    </select>
</mapper>