mitao
2025-02-26 37f1e7e8e3f0e57cc21cf31442d6043024fb5918
三个身边代码提交
1个文件已修改
68 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/ComplaintMapper.xml
@@ -3,12 +3,12 @@
<mapper namespace="com.panzhihua.sangeshenbian.dao.ComplaintMapper">
    <select id="selectComplaintPage" resultType="com.panzhihua.sangeshenbian.model.vo.ComplaintVO">
        SELECT
        sc.id,
        SELECT * FROM (
        SELECT sc.id,
        sc.serial_number,
        sc.TIME,
        sc.time,
        sc.problem_type,
        sc.NAME,
        sc.name,
        sc.contact_number,
        sc.location,
        sc.detailed_address,
@@ -17,16 +17,11 @@
        sc.images,
        sc.videos,
        CASE
        WHEN scar.audit_type = 1
        AND scar.audit_status = 0 THEN
        7
        WHEN scar.audit_type = 2
        AND scar.audit_status = 0 THEN
        5
        WHEN scar.audit_status = 2 THEN
        6 ELSE sc.STATUS
        END AS STATUS,
        WHEN scar.audit_type = 1 AND scar.audit_status = 0 THEN 7
        WHEN scar.audit_type = 2 AND scar.audit_status = 0 THEN 5
        WHEN scar.audit_status = 2 THEN 6
        ELSE sc.status
        END AS status,
        sc.report_type,
        sc.superior_id,
        sc.create_by,
@@ -47,33 +42,36 @@
        sc.longitude,
        scar.audit_type,
        scar.audit_status,
        scar.COMMENT,
        scar.comment,
        scar.create_time AS reportTime,
        scar.system_user_id,
        scar.reporter,
        scar.department_name,
        scar.department_id
        FROM
        sgsb_complaint sc
        LEFT JOIN sgsb_complaint_audit_record scar ON sc.id = scar.complaint_id and scar.latest_flag = 1
         <where>
            <if test="isSuperior == 1">
                and sc.superior_id =  #{targetId}
        FROM sgsb_complaint sc
        LEFT JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id AND scar.latest_flag = 1
        WHERE
        ((scar.audit_type = 2 AND scar.audit_status != 1) OR (scar.audit_type = 1) OR
        (scar.id IS NULL) OR (scar.audit_type = 2 AND scar.audit_status = 1 AND scar.auditor_id = #{query.userId}))
        ) AS t
        <where>
            <if test="isSuperior == 1 and targetId != null">
                AND superior_id = #{targetId}
            </if>
             <if test="isSuperior == 0">
                 and sc.create_by = #{targetId}
             </if>
             <if test="query.type!=null and query.type == 0">
                 and audit_type = 1 AND audit_status = 0) OR (audit_type = 2 AND audit_status = 0
             </if>
             <if test="query.type!=null and query.type == 1">
                and sc.status IN(0,1,2)
             </if>
             <if test="query.type!=null and query.type == 2">
                 and sc.status = 3
             </if>
         </where>
        ORDER BY sc.create_time DESC
            <if test="isSuperior == 0 and targetId != null">
                AND create_by = #{targetId}
            </if>
            <if test="query.type!=null and query.type == 0">
                AND(audit_type = 1 AND audit_status = 0) OR (audit_type = 2 AND audit_status = 0)
            </if>
            <if test="query.type!=null and query.type == 1">
                AND (status IN(0,1,2))
            </if>
            <if test="query.type!=null and query.type == 2">
                AND status = 3
            </if>
        </where>
        ORDER BY create_time DESC
    </select>
    <select id="getDetail" resultType="com.panzhihua.sangeshenbian.model.vo.ComplaintVO">
        SELECT sc.id,