| | |
| | | and bd.id != 1425365577303621633 |
| | | and bd.id != 1432625856013971457 |
| | | <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.cardid!=null and user.cardid != ''"> |
| | | and bu.cardid like concat(concat('%', #{user.cardid}),'%') |
| | |
| | | and bu.securitynumber like concat('%', #{user.securitynumber},'%') |
| | | </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.startTime!=null and user.startTime!=''"> |
| | | and bu.paper_time >= #{user.startTime} |