| | |
| | | and bu.hold = #{user.hold} |
| | | </if> |
| | | <if test="user.deptId!=null and user.deptId != ''"> |
| | | and (bd.id = #{user.deptId} or bd.parent_id = #{user.deptId}) |
| | | and bd.id in |
| | | ( |
| | | select id from blade_dept where id = #{user.deptId} |
| | | union |
| | | 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 := #{user.deptId} ) t2 |
| | | ) t3 |
| | | WHERE |
| | | ischild != 0 |
| | | ) |
| | | </if> |
| | | <if test="user.roleId!=null and user.roleId != ''"> |
| | | and bu.role_id = #{user.roleId} |
| | |
| | | and real_name like concat(concat('%', #{user.realName}),'%') |
| | | </if> |
| | | <if test="user.deptId!=null and user.deptId != ''"> |
| | | and (bd.id = #{user.deptId} or bd.parent_id = #{user.deptId}) |
| | | and bd.id in |
| | | ( |
| | | select id from blade_dept where id = #{user.deptId} |
| | | union |
| | | 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 := #{user.deptId} ) t2 |
| | | ) t3 |
| | | WHERE |
| | | ischild != 0 |
| | | ) |
| | | </if> |
| | | <if test="user.userType!=null and user.userType != ''"> |
| | | and user_type = #{user.userType} |
| | |
| | | where 1 = 1 |
| | | <if test="user.examType==1"> |
| | | and a.isApply != 1 |
| | | and a.age>=18 |
| | | and a.age<=60 |
| | | </if> |
| | | <if test="user.examType==2"> |
| | | and a.isTrain != 1 |
| | | and a.age>=18 |
| | | and a.age<=60 |
| | | </if> |
| | | ) |
| | | </select> |
| | |
| | | and bu.hold = #{user.hold} |
| | | </if> |
| | | <if test="user.deptId!=null and user.deptId != ''"> |
| | | and (bd.id = #{user.deptId} or bd.parent_id = #{user.deptId}) |
| | | and bd.id in |
| | | ( |
| | | select id from blade_dept where id = #{user.deptId} |
| | | union |
| | | 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 := #{user.deptId} ) t2 |
| | | ) t3 |
| | | WHERE |
| | | ischild != 0 |
| | | ) |
| | | </if> |
| | | <if test="user.roleId!=null and user.roleId != ''"> |
| | | and bu.role_id = #{user.roleId} |