nickchange
2023-11-17 a9564eae9f0169ca39329b2f14a8f13d13358a0a
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
<?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.dsh.course.mapper.TOperatorUserMapper">
 
 
    <select id="listAll" resultType="com.dsh.guns.modular.system.model.OperatorUserVO">
        SELECT t1.id AS id,
       t1.operatorId,
       t1.operatorName,
       t1.userName,
       t1.phone,
       t1.platform,
       t1.proportion,
       t1.number,
       t1.audit,
       t1.type
FROM (
    SELECT t3.id,
           t1.id AS operatorId,
           t1.name AS operatorName,
           t2.name AS userName,
           t2.phone,
           t3.alipay AS platform,
           t3.alipayProportion AS proportion,
           t3.alipayNum AS number,
           t3.alipayAudit AS audit,
           t3.alipayType AS type
    FROM t_operator_user t3
        LEFT JOIN t_operator t1 ON t3.operatorId = t1.id
        LEFT JOIN sys_user t2 ON t1.userId = t2.id AND t2.objectType = 2
 
    UNION ALL
 
    SELECT t3.id,
           t1.id AS operatorId,
           t1.name AS operatorName,
           t2.name AS userName,
           t2.phone,
           t3.wechat AS platform,
           t3.wechatProportion AS proportion,
           t3.wechatNum AS number,
           t3.wechatAudit AS audit,
           t3.wechatType AS type
    FROM t_operator_user t3
        LEFT JOIN t_operator t1 ON t3.operatorId = t1.id
        LEFT JOIN sys_user t2 ON t1.userId = t2.id AND t2.objectType = 2
) AS t1
ORDER BY t1.id;
 
    </select>
</mapper>