| | |
| | | <select id="selectProcessingSheet" resultType="com.yuanchu.mom.dto.PersonSupervisionProcessingSheetDto"> |
| | | select sps.*, |
| | | dl1.name proposing_department, |
| | | dl2.name cause_analysis, |
| | | dl2.name causeAnalysisDepartment, |
| | | dl3.name corrective_action, |
| | | dl4.name verification_department, |
| | | DATE_FORMAT(sps.proposing_department_date, '%Y-%m-%d') AS proposing_department_date_string, |
| | |
| | | left join user u2 on u2.id = sps.cause_analysis_person_id |
| | | left join user u3 on u3.id = sps.corrective_action_id |
| | | left join user u4 on u4.id = sps.verification_department_person_id |
| | | left join department_lims dl1 on find_in_set(dl1.id, u1.depart_lims_id) and dl1.id != 1 |
| | | left join department_lims dl2 on find_in_set(dl2.id, u2.depart_lims_id) and dl2.id != 1 |
| | | left join department_lims dl3 on find_in_set(dl3.id, u3.depart_lims_id) and dl3.id != 1 |
| | | left join department_lims dl4 on find_in_set(dl4.id, u4.depart_lims_id) and dl4.id != 1 |
| | | left join department_lims dl1 on dl1.id = SUBSTRING_INDEX(SUBSTRING_INDEX(u1.depart_lims_id, ',', -2), ',', 1) and dl1.id != 1 |
| | | left join department_lims dl2 on dl2.id = SUBSTRING_INDEX(SUBSTRING_INDEX(u2.depart_lims_id, ',', -2), ',', 1) and dl2.id != 1 |
| | | left join department_lims dl3 on dl3.id = SUBSTRING_INDEX(SUBSTRING_INDEX(u3.depart_lims_id, ',', -2), ',', 1) and dl3.id != 1 |
| | | left join department_lims dl4 on dl4.id = SUBSTRING_INDEX(SUBSTRING_INDEX(u4.depart_lims_id, ',', -2), ',', 1) and dl4.id != 1 |
| | | where sps.supervision_record_id = #{supervisionRecordId} |
| | | </select> |
| | | |