liujie
2025-07-28 039abee6b27058ca46b1e1e82aa0b5407a5dad44
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?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.panzhihua.westcommittee.dao.ComplaintRejectMapper">
 
 
 
 
 
 
 
 
    <select id="getComplaintRejectList" resultType="com.panzhihua.westcommittee.model.vo.ComplaintRejectVo">
        select t3.reject_reason remark,t3.audit_time examineTime,t2.id complaintId,t2.serial_number serialNumber,t2.report_user_name reportUserName,t2.status,
               t2.report_user_phone reportUserPhone,t3.auditor_name examineUserName,t3.create_time applyTime,t3.apply_name applyUserName
        from west_complaint_audit_record t3
        left join west_complaint t2 on t3.complaint_id = t2.id
        <where>
            t3.audit_status=2
            <if test="query.serialNumber != null and query.serialNumber != ''">
                and t2.serial_number = #{query.serialNumber}
            </if>
            <if test="query.reportUserName != null and query.reportUserName != ''">
                and t2.report_user_name like concat("%",#{query.reportUserName},"%")
            </if>
            <if test="query.status != null">
                and t2.status = #{query.status}
            </if>
            <if test="query.reportUserPhone != null and query.reportUserPhone != ''">
                and t2.report_user_phone like concat("%",#{query.reportUserPhone},"%")
            </if>
            <if test="query.applyUserName != null and query.applyUserName != ''">
                and t3.apply_name like concat("%",#{query.applyUserName},"%")
            </if>
            <if test="query.examineUserName != null and query.examineUserName != ''">
                and t3.auditor_name like concat("%",#{query.examineUserName},"%")
            </if>
            <if test="applyStartTime !=null">
                and t3.create_time between #{applyStartTime} and #{applyEndTime}
            </if>
            <if test="examineStartTime !=null">
                and t3.audit_time between #{examineStartTime} and #{examineEndTime}
            </if>
            <if test="roleId !=2">
                and (t2.problem_type != '检举控告' or t2.problem_type is null)
            </if>
 
 
        </where>
        order by t3.create_time desc
    </select>
 
    <select id="getComplaintRejectListOther"
            resultType="com.panzhihua.westcommittee.model.vo.ComplaintRejectVo">
 
        select t3.reject_reason remark,t3.audit_time examineTime,t2.id complaintId,t2.serial_number serialNumber,t2.report_user_name reportUserName,t2.status,
        t2.report_user_phone reportUserPhone,t3.auditor_name examineUserName,t3.create_time applyTime,t3.apply_name applyUserName
        from west_complaint_audit_record t3
        left join west_complaint t2 on t3.complaint_id = t2.id
        <where>
            t3.audit_status=2
            <if test="roleId !=2">
                and (t2.problem_type != '检举控告' or t2.problem_type is null)
            </if>
            <if test="query.serialNumber != null and query.serialNumber != ''">
                and t2.serial_number = #{query.serialNumber}
            </if>
            <if test="query.reportUserName != null and query.reportUserName != ''">
                and t2.report_user_name like concat("%",#{query.reportUserName},"%")
            </if>
            <if test="query.status != null">
                and t2.status = #{query.status}
            </if>
            <if test="query.reportUserPhone != null and query.reportUserPhone != ''">
                and t2.report_user_phone like concat("%",#{query.reportUserPhone},"%")
            </if>
            <if test="query.applyUserName != null and query.applyUserName != ''">
                and t3.apply_name like concat("%",#{query.applyUserName},"%")
            </if>
            <if test="query.examineUserName != null and query.examineUserName != ''">
                and t3.auditor_name like concat("%",#{query.examineUserName},"%")
            </if>
            <if test="applyStartTime !=null">
                and t3.create_time between #{applyStartTime} and #{applyEndTime}
            </if>
            <if test="examineStartTime !=null">
                and t3.audit_time between #{examineStartTime} and #{examineEndTime}
            </if>
            and (t2.community_id in
            <foreach collection="finalCommunityIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
            or t2.street_id in
            <foreach collection="finalStreetIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
            )
 
 
        </where>
        order by t3.create_time desc
 
 
    </select>
    <select id="getComplaintRejectList1" resultType="com.panzhihua.westcommittee.model.vo.ComplaintRejectVo">
        select t3.reject_reason remark,t3.audit_time examineTime,t2.id complaintId,t2.serial_number serialNumber,t2.report_user_name reportUserName,t2.status,
        t2.report_user_phone reportUserPhone,t3.auditor_name examineUserName,t3.create_time applyTime,t3.apply_name applyUserName
        from west_complaint_audit_record t3
        left join west_complaint t2 on t3.complaint_id = t2.id
        <where>
            t3.audit_status=2 and t2.assign_person_id =#{oneDepartmentId}
            <if test="query.serialNumber != null and query.serialNumber != ''">
                and t2.serial_number = #{query.serialNumber}
            </if>
            <if test="query.reportUserName != null and query.reportUserName != ''">
                and t2.report_user_name like concat("%",#{query.reportUserName},"%")
            </if>
            <if test="query.status != null">
                and t2.status = #{query.status}
            </if>
            <if test="query.reportUserPhone != null and query.reportUserPhone != ''">
                and t2.report_user_phone like concat("%",#{query.reportUserPhone},"%")
            </if>
            <if test="query.applyUserName != null and query.applyUserName != ''">
                and t3.apply_name like concat("%",#{query.applyUserName},"%")
            </if>
            <if test="query.examineUserName != null and query.examineUserName != ''">
                and t3.auditor_name like concat("%",#{query.examineUserName},"%")
            </if>
            <if test="applyStartTime !=null">
                and t3.create_time between #{applyStartTime} and #{applyEndTime}
            </if>
            <if test="examineStartTime !=null">
                and t3.audit_time between #{examineStartTime} and #{examineEndTime}
            </if>
            <if test="role !=2">
                and (t2.problem_type != '检举控告' or t2.problem_type is null)
            </if>
 
 
        </where>
        order by t3.create_time desc
    </select>
</mapper>