(select a.* from t_qcp_first_aid a, t_organization_project o where a.hospital_id = o.organization_id and o.project_id = #{param.projectId} and a.rec_status = 0 and o.rec_status = 0 )a
(SELECT a.* FROM t_qcp_first_aid a, t_organization o WHERE a.hospital_id = o.id AND o.id = #{param.projectId} AND a.rec_status = 0 AND o.rec_status = 0)a
left join t_qcp_first_aid_member m
left join t_qcp_first_aid_member m
on a.id = m.first_aid_id and m.rec_status = 0
on a.id = m.first_aid_id and m.rec_status = 0
left join t_qcp_first_aid_record r
left join t_qcp_first_aid_record r
@ -339,41 +339,34 @@
t_organization_member_position AS omp
t_organization_member_position AS omp
WHERE
WHERE
rec_status = 0
rec_status = 0
AND department_id IN (
AND ( department_id IN (
SELECT
SELECT
id
department_id
FROM
FROM
(
(
SELECT
SELECT
t1.*,
t1.*,
IF (
IF
find_in_set(parent_id, @pids) > 0
(
<iftest="departmentIdList.size() > 0">
find_in_set( parent_id, @pids ) > 0
<foreachcollection="departmentIdList"item="item">
<iftest="departmentIdList.size() > 0">
OR id = #{item}
<foreachcollection="departmentIdList"item="item">
</foreach>
OR id = #{item}
</if>
</foreach>
</if>
,@pids := concat(@pids, ',', id),
,@pids := concat( @pids, ',', department_id ),
0
0
) AS ischild
) AS ischild
FROM
FROM
(
( SELECT * FROM t_organization_department_parent t ORDER BY parent_id, department_id ) t1,