Helius
2021-06-16 4e51778362c2130598a4c73ec4cebe6629dbc53f
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
<?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.xzx.gc.order.mapper.OrderAppraiseInfoMapper">
 
    <select id="queryAppraiseInfoList" resultType="com.xzx.gc.model.admin.XzxOrderAppraiseInfoModel">
        select a.create_time as time,b.name as receiverName,b.mobile_phone as receiverPhone,
        a.star,a.tag_codes,c.nick_name as userName,c.mobile_phone as userPhone,
        a.anonymous_flag,a.order_id,a.content,a.resource_ids,d.create_time as createTime,d.reserve_time as reserveTime,
        e.receive_time as receiveTime,d.order_status as orderStatus,d.address_area as addressArea,d.address as
        address,e.remark
        from xzx_order_appraise_info a
        LEFT JOIN xzx_order_info d ON a.order_id=d.order_id
        LEFT JOIN xzx_order_detail_info e ON a.order_id=e.order_id
        LEFT JOIN xzx_user_other_info b on a.receiver_id=b.user_id and b.user_type=2
        LEFT JOIN xzx_user_info c on a.create_user_id = c.user_id
        where a.del_flag=0
        <if test="name != null">
            AND (b.name like concat("%",#{name},"%") or b.mobile_phone like concat("%",#{name},"%"))
        </if>
        <if test=" partnerIds != null and partnerIds.size() != 0">
            AND b.partner_id in
            <foreach collection="partnerIds" index="index" item="id" open="(" separator="," close=")">
                #{id}
            </foreach>
        </if>
    </select>
    <select id="queryConfigByAppraseInfo" resultType="java.lang.String">
        select config_type_name
        from xzx_sys_config_info
        where config_group = #{value}
        group by config_type_name
    </select>
    <select id="queryConfigByTagCode" parameterType="java.util.List" resultType="java.lang.String">
        select config_value
        from xzx_sys_config_info
        where config_type_code in
        <foreach collection="codes" index="index" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </select>
    <select id="queryConfigByTagCodeOne" resultType="java.lang.String">
        select config_value
        from xzx_sys_config_info
        where config_type_code = #{typeCode}
    </select>
    <select id="queryResourceUrls" resultType="java.lang.String">
        select resource_url from xzx_sys_resource_info where id in
        <foreach collection="resArr" index="index" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </select>
    <select id="queryReceiverTotalList" resultType="map">
        select count(id) as num,AVG(star) as star,b.name as name,b.del_flag as delFlag,b.partner_id as partnerId,
          (select c.partner_name from xzx_city_partner c where c.id=b.partner_id) as partnerName
        from xzx_order_appraise_info a
        left join xzx_user_other_info b on a.receiver_id=b.user_id
        where 1=1
        <if test="name != null">
            AND (b.name like concat("%",#{name},"%") or b.mobile_phone like concat("%",#{name},"%"))
        </if>
        <if test=" partnerIds != null and partnerIds.size() != 0">
            AND b.partner_id in
            <foreach collection="partnerIds" index="index" item="id" open="(" separator="," close=")">
                #{id}
            </foreach>
        </if>
        <if test="receiverId != null and receiverId != ''">
            and a.receiver_id=#{receiverId}
        </if>
        group by a.receiver_id
 
    </select>
    <select id="queryStarTotalNum" resultType="map">
        select count(a.id) as num,a.star as star
        from xzx_order_appraise_info a
        left join(
        select m.partner_id,n.order_id from xzx_user_other_info m
        LEFT JOIN xzx_order_info n on n.receiver=m.user_id
        )j on a.order_id = j.order_id
        where 1=1
        <if test=" partnerIds != null and partnerIds.size() != 0">
            AND j.partner_id in
            <foreach collection="partnerIds" index="index" item="id" open="(" separator="," close=")">
                #{id}
            </foreach>
        </if>
        <if test="receiverId != null and receiverId != ''">
            and a.receiver_id=#{receiverId}
        </if>
        group by a.star
    </select>
    <select id="getModelCodeList" resultType="java.lang.String">
        select tag_codes as codes
        from xzx_order_appraise_info
        where star = #{star}
    </select>
 
</mapper>