| | |
| | | <where> |
| | | scar.latest_flag = 1 |
| | | <if test="null != accountLevel and accountLevel == 5"> |
| | | and sc.report_type = 5 and sc.create_by = #{targetId} |
| | | and scar.report_type = 5 and scar.superior_id = #{targetId} |
| | | <if test="query.type == 0"> |
| | | and scar.audit_type != 0 AND scar.audit_status = 0 |
| | | </if> |
| | |
| | | <if test="null != accountLevel and accountLevel == 4"> |
| | | <if test="query.type==null"> |
| | | and ( |
| | | (sc.report_type = 4 and sc.create_by = #{targetId}) or (sc.superior_type = 4 and sc.superior_id = #{targetId}) |
| | | (scar.report_type = 4 and scar.superior_id = #{targetId}) or (scar.report_type = 4 and scar.superior_id = #{targetId}) |
| | | or ( scar.audit_type != 0 AND scar.audit_status != 1 and scar.report_type = 4 and scar.superior_id = #{targetId}) |
| | | ) |
| | | </if> |
| | |
| | | <if test="null != accountLevel and accountLevel == 3"> |
| | | <if test="query.type==null"> |
| | | and ( |
| | | (sc.report_type = 3 and sc.create_by = #{targetId}) or (sc.superior_type = 3 and sc.superior_id = #{targetId}) |
| | | (scar.report_type = 3 and scar.superior_id = #{targetId}) or (scar.report_type = 3 and scar.superior_id = #{targetId}) |
| | | or (scar.audit_type != 0 AND scar.audit_status != 1 and scar.report_type = 3 and scar.superior_id = #{targetId}) |
| | | ) |
| | | </if> |
| | |
| | | </if> |
| | | <if test="null != accountLevel and accountLevel == 2"> |
| | | <if test="query.type==null"> |
| | | and ((sc.report_type = 2 and sc.create_by = #{targetId}) or (sc.superior_type = 2 and sc.superior_id = #{targetId}) |
| | | and ((scar.report_type = 2 and scar.superior_id = #{targetId}) or (scar.report_type = 2 and scar.superior_id = #{targetId}) |
| | | or (scar.audit_type != 0 AND scar.audit_status != 1 and scar.report_type = 2 and scar.superior_id = #{targetId}) |
| | | ) |
| | | </if> |
| | |
| | | </if> |
| | | <if test="null != accountLevel and accountLevel == 1"> |
| | | <if test="query.type == null"> |
| | | and ((sc.report_type = 1 and sc.create_by = #{targetId}) or (sc.superior_type = 1 and sc.superior_id = #{targetId}) |
| | | and ((scar.report_type = 1 and scar.superior_id = #{targetId}) or (scar.report_type = 1 and scar.superior_id = #{targetId}) |
| | | or (scar.audit_type != 0 AND scar.audit_status != 1 and scar.report_type = 1 and scar.superior_id = #{targetId})) |
| | | </if> |
| | | <if test="query.type == 0"> |