(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
on a.id = m.first_aid_id and m.rec_status = 0
left join t_qcp_first_aid_record r
@ -339,41 +339,34 @@
t_organization_member_position AS omp
WHERE
rec_status = 0
AND department_id IN (
AND ( department_id IN (
SELECT
id
department_id
FROM
(
SELECT
t1.*,
IF (
find_in_set(parent_id, @pids) > 0
<iftest="departmentIdList.size() > 0">
<foreachcollection="departmentIdList"item="item">
OR id = #{item}
</foreach>
</if>
,@pids := concat(@pids, ',', id),
0
) AS ischild
FROM
(
SELECT
*
FROM
t_organization_department t
WHERE
t.rec_status = 0
ORDER BY
parent_id,
id
) t1,
(SELECT @pids := #{departmentIdStr}) t2
) t3
(
SELECT
t1.*,
IF
(
find_in_set( parent_id, @pids ) > 0
<iftest="departmentIdList.size() > 0">
<foreachcollection="departmentIdList"item="item">
OR id = #{item}
</foreach>
</if>
,@pids := concat( @pids, ',', department_id ),
0
) AS ischild
FROM
( SELECT * FROM t_organization_department_parent t ORDER BY parent_id, department_id ) t1,