| | |
| | | CASE |
| | | /* 当诉求是当前用户处理的,显示正常状态 */ |
| | | WHEN (scar.superior_id = #{targetId} OR scar.create_by = #{query.userId}) THEN |
| | | CASE |
| | | WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 |
| | | WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5 |
| | | WHEN sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6 |
| | | WHEN sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 1 THEN 9 |
| | | ELSE sc.status |
| | | END |
| | | CASE |
| | | WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 |
| | | WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5 |
| | | WHEN sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6 |
| | | ELSE sc.status |
| | | END |
| | | /* 当诉求不是当前用户处理的,已办结(3)保持不变,其他状态都显示为正在办理(0) */ |
| | | ELSE |
| | | CASE |
| | | WHEN sc.status = 3 THEN 3 |
| | | ELSE 0 |
| | | END |
| | | CASE |
| | | WHEN sc.status = 3 THEN 3 |
| | | WHEN sc.status = 8 THEN 8 |
| | | ELSE 0 |
| | | END |
| | | END AS status, |
| | | sc.report_type, |
| | | sc.superior_id, |
| | |
| | | <if test="query.type!=null and query.type == 1"> |
| | | AND ( |
| | | /* 如果是当前用户处理的诉求,正常显示正在办理的诉求 */ |
| | | ((scar.superior_id = #{targetId} OR scar.create_by = #{query.userId}) AND sc.status IN(0,1,2)) |
| | | ((scar.superior_id = #{targetId} OR scar.create_by = #{query.userId}) AND (sc.status IN(0,1,2) AND scar.audit_status NOT IN (0,2))) |
| | | OR |
| | | /* 如果不是当前用户处理的诉求,只要不是已办结(3)或已评价(8)的都算作正在办理 */ |
| | | ((scar.superior_id != #{targetId} AND scar.create_by != #{query.userId} OR scar.superior_id IS NULL) AND sc.status NOT IN(3,8)) |
| | |
| | | scar.sort, |
| | | scar.auditor_phone, |
| | | scar.apply_phone AS reporterPhone, |
| | | scar.audit_time, |
| | | sc.serial_number, |
| | | sc.latitude, |
| | | sc.longitude, |
| | |
| | | sgsb_complaint_audit_record scar |
| | | LEFT JOIN sgsb_complaint sc ON scar.complaint_id = sc.id |
| | | <where> |
| | | scar.audit_type != 3 |
| | | sc.status = 0 AND scar.audit_type != 3 |
| | | AND scar.audit_status = 2 |
| | | <if test="1 == accountLevel"> |
| | | and sc.city_code = #{targetId} |
| | | </if> |
| | | <if test="2 == accountLevel"> |
| | | and (sc.districts_code = #{targetId} |
| | | and sc.districts_code = #{targetId} |
| | | </if> |
| | | <if test="3 == accountLevel"> |
| | | and (sc.street_id = #{targetId}) |
| | | and sc.street_id = #{targetId} |
| | | </if> |
| | | <if test="4 == accountLevel"> |
| | | and (sc.community_id = #{targetId}) |
| | | and sc.community_id = #{targetId} |
| | | </if> |
| | | <if test="keyword!=null and keyword != ''"> |
| | | AND (scar.reporter like concat('%',#{keyword},'%') or scar.auditor_name like concat('%',#{keyword},'%') |
| | | or sc.name like concat('%',#{keyword},'%')or sc.report_user_name like concat('%',#{keyword},'%')) |
| | | </if> |
| | | </where> |
| | | ORDER BY sc.create_time DESC |
| | | ORDER BY sc.create_time, scar.create_time DESC |
| | | </select> |
| | | <select id="queryCompliantList" resultType="com.panzhihua.sangeshenbian.model.entity.Complaint"> |
| | | SELECT sc.id, |