1
zj
2024-06-13 8eea5be3b36875bd4ffe70e6c3a5bb07b1d829bf
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
<?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.yami.trading.dao.agent.AgentMapper">
 
    <select id="listTotal" resultType="com.yami.trading.bean.agent.AgentDto">
        SELECT agent.uuid    id,
                u.user_id as userId,
               u.user_name,
               u.user_code,
               u.role_name,
               u.remarks,
                u.status,
                u.google_auth_bind,
               user_parent.user_name userNameParent
        FROM t_agent agent
                 LEFT JOIN tz_user u ON agent.user_id = u.user_id
                 LEFT JOIN tz_user user_parent ON agent.parent_user_id = user_parent.user_id
        WHERE 1 = 1
        <if test="userName!=null and userName!=''">
            and u.user_name=#{userName} or u.user_code=#{userName}
        </if>
        <if test=" userIds !=null and userIds.size > 0">
            and u.user_id  in
            <foreach collection="userIds" item="item" index="index" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        order by  u.create_time desc
    </select>
 
 
    <select id="pagedQueryNetwork"  resultType="com.yami.trading.bean.agent.AgentDto">
        select party.role_name as rolename,
                  party.user_id as userId,
        party.user_name as username,
               party.user_code as usercode,
               party.user_id   as id,
               remarks,
               enabled,
               login_authority
        from tz_user party
                 left join tz_user_recom on party.user_id = tz_user_recom.recom_user_id
        where 1 = 1
          and party.role_name in ("agent", "agentlow")
        order by party.create_time desc
    </select>
</mapper>