1.2
luo
2024-01-02 372713d9d50c73871d51fd98b655d8bd9e24df46
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?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.stylefeng.guns.modular.system.dao.AppUserMapper">
 
    <select id="searchIntermediaryList"
            resultType="com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryListRes">
        select t1.id,t1.profile_photo as profilePhoto,t1.nickname as nickname,t1.company_name as companyName,
        t1.company_address as companyAddress,t1.introduce as introduce,t1.phone as phone,
        COUNT(t2.id) AS houseCount
        from t_app_user t1
        left join t_house_resource t2 on t1.id = t2.insert_user_id
        <where>
            <if test="null != req.name and '' != req.name">
                and t1.nickname = CONCAT('%', #{req.name}, '%')
            </if>
            <if test="null != cityIds">
                and t1.city_id in
                <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")">
                    #{item}
                </foreach>
            </if>
            <if test="null != districtIds">
                and t1.district_id in
                <foreach collection="districtIds" item="item" index="index" separator="," open="(" close=")">
                    #{item}
                </foreach>
            </if>
            and t1.audit_status = 2
            and t1.status = 1
            and t1.user_type = 3
            and t2.auth_status = 2
            and t2.is_delete = 0
            and t2.status = 1
            and t2.type=2
        </where>
        group by t1.id
        order by houseCount desc
    </select>
    <select id="listHost" resultType="com.stylefeng.guns.modular.system.dto.Host">
        SELECT id,insert_time as insertTime,nickname,profile_photo as profilePhoto,user_type as userType,ifnull(wechat_qr_code1,wechat_qr_code) as wechatQrCode,ifnull(watch_app1,watch_app) as watchApp,phone as phone,status
        from t_app_user
        <where>
            status != 3
            <if test="null != nickname and '' != nickname">
                and nickname like CONCAT('%', #{nickname}, '%')
            </if>
            <if test="null != userType">
                and user_type = #{userType}
            </if>
            <if test="null != status">
                and status = #{status}
            </if>
            <if test="null != phone and '' != phone">
                and phone like CONCAT('%', #{phone}, '%')
            </if>
        </where>
        ORDER BY insert_time desc
 
    </select>
    <select id="listMedium" resultType="com.stylefeng.guns.modular.system.dto.Medium">
        SELECT id,insert_time as insertTime,nickname,company_name as companyName,agent_licence_code as agentLicenceCode,ifnull(wechat_qr_code1,wechat_qr_code) as wechatQrCode,ifnull(watch_app1,watch_app) as watchApp,phone as phone,status
        from t_app_user
        <where>
            status != 3 and auth = 2
            <if test="null != nickname and '' != nickname">
                and nickname like CONCAT('%', #{nickname}, '%')
            </if>
            <if test="null != userType">
                and user_type = #{userType}
            </if>
            <if test="null != status">
                and status = #{status}
            </if>
            <if test="null != phone and '' != phone">
                and phone like CONCAT('%', #{phone}, '%')
            </if>
        </where>
 
 
    </select>
 
    <select id="listAuMedium" resultType="com.stylefeng.guns.modular.system.dto.Medium">
        SELECT id,insert_time as insertTime,nickname,company_name as companyName,
               agent_licence_code as agentLicenceCode,ifnull(wechat_qr_code1,wechat_qr_code) as wechatQrCode,ifnull(watch_app1,watch_app) as watchApp,phone as phone,status,auth as auditStatus,audit_note as auditNote
        ,refuse_date as refuseDate
        from t_app_user
        <where>
            status != 3 and auth != 0
            <if test="null != nickname and '' != nickname">
                and nickname like CONCAT('%', #{nickname}, '%')
            </if>
            <if test="null != userType">
                and user_type = #{userType}
            </if>
            <if test="null != status">
                and auth = #{status}
            </if>
            <if test="null != phone and '' != phone">
                and phone like CONCAT('%', #{phone}, '%')
            </if>
        </where>
 
 
    </select>
 
 
</mapper>