| | |
| | | <if test="2 == accountLevel"> |
| | | and (sc.districts_code = #{targetId} || sc.id in (select complaint_id from sgsb_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId})) |
| | | </if> |
| | | <if test="null != streetId"> |
| | | <if test="3 == accountLevel"> |
| | | and (sc.street_id = #{streetId} || sc.id in (select complaint_id from sgsb_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId})) |
| | | </if> |
| | | <if test="null != communityId"> |
| | | and (sc.community_id = #{communityId} || sc.id in (select complaint_id from sgsb_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId})) |
| | | <if test="4 == accountLevel"> |
| | | and (sc.community_id = #{targetId} || sc.id in (select complaint_id from sgsb_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId})) |
| | | </if> |
| | | <if test="null != partyMemberId"> |
| | | and (sc.party_member_id = #{partyMemberId} || sc.id in (select complaint_id from sgsb_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId})) |
| | | <if test="5 == accountLevel"> |
| | | and (sc.party_member_id = #{targetId} || sc.id in (select complaint_id from sgsb_complaint_audit_record where audit_type = 3 and audit_status = 1 and report_type = #{accountLevel} and superior_id = #{targetId})) |
| | | </if> |
| | | <if test="query.type!=null and query.type == 0"> |
| | | AND sc.status IN(0,1,2) and scar.audit_status = 0 |