| | |
| | | and role_id = '1412226235153731586' |
| | | and is_deleted = 0 |
| | | AND status=1 |
| | | and dept_id = #{dept.id} |
| | | and dept_id in |
| | | ( |
| | | SELECT |
| | | id |
| | | FROM |
| | | ( |
| | | SELECT |
| | | t1.id,t1.parent_id,t1.dept_name, |
| | | IF |
| | | ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild |
| | | FROM |
| | | ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1, |
| | | ( SELECT @pids := #{dept.id} ) t2 |
| | | ) t3 |
| | | WHERE |
| | | ischild != 0 |
| | | ) |
| | | </select> |
| | | |
| | | <!--查询单位的已派遣人数--> |
| | |
| | | and is_deleted = 0 |
| | | AND status=1 |
| | | AND dispatch=0 |
| | | and dept_id = #{dept.id} |
| | | and dept_id in |
| | | ( |
| | | SELECT |
| | | id |
| | | FROM |
| | | ( |
| | | SELECT |
| | | t1.id,t1.parent_id,t1.dept_name, |
| | | IF |
| | | ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild |
| | | FROM |
| | | ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1, |
| | | ( SELECT @pids := #{dept.id} ) t2 |
| | | ) t3 |
| | | WHERE |
| | | ischild != 0 |
| | | ) |
| | | </select> |
| | | |
| | | <!--查询单位持证的人数--> |
| | |
| | | and is_deleted = 0 |
| | | AND status=1 |
| | | AND hold=1 |
| | | and dept_id = #{dept.id} |
| | | and dept_id in |
| | | ( |
| | | SELECT |
| | | id |
| | | FROM |
| | | ( |
| | | SELECT |
| | | t1.id,t1.parent_id,t1.dept_name, |
| | | IF |
| | | ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild |
| | | FROM |
| | | ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1, |
| | | ( SELECT @pids := #{dept.id} ) t2 |
| | | ) t3 |
| | | WHERE |
| | | ischild != 0 |
| | | ) |
| | | </select> |
| | | |
| | | </mapper> |