| | |
| | | where id = #{ids} |
| | | </delete> |
| | | |
| | | |
| | | <select id="selectLi" resultType="java.util.HashMap"> |
| | | <!--保安员统计查询--> |
| | | <select id="selectLi" resultType="org.springblade.modules.information.vo.InformationStatisticsVO"> |
| | | SELECT |
| | | IFNULL( V.num, 0 ) AS num, |
| | | IFNULL( B.cznum, 0 ) AS cznum, |
| | | IFNULL( C.num, 0 ) AS paiqnum, |
| | | IFNULL( D.num, 0 ) AS wpaiqnum, |
| | | IFNULL( E.sbnum, 0 ) AS sbnum, |
| | | IFNULL( F.wcaijnum, 0 ) AS wcaijnum, |
| | | IFNULL( H.ycaijzpnum, 0 ) AS ycaijzpnum, |
| | | IFNULL( I.ycaijzwnum, 0 ) AS ycaijzwnum, |
| | | IFNULL( G.yicnum, 0 ) AS yicnum, |
| | | IFNULL( D.num, 0 ) AS wpqnum, |
| | | IFNULL( C.num, 0 ) AS pqnum, |
| | | IFNULL( H.ycaijzpnum, 0 ) AS ycjzpnum, |
| | | IFNULL( F.wcaijnum, 0 ) AS wcjzpnum, |
| | | IFNULL( I.ycaijzwnum, 0 ) AS ycjzwnum, |
| | | IFNULL( G.yicnum, 0 ) AS scycnum, |
| | | IFNULL( E.sbnum, 0 ) AS jnsbnum, |
| | | A.departmentid, |
| | | A.enterpriseName AS deptname, |
| | | A.stats, |
| | |
| | | GROUP BY |
| | | bu.dept_id |
| | | ) D ON D.dept_id = A.departmentid |
| | | LEFT JOIN ( SELECT COUNT( * ) AS sbnum, deptid FROM sys_socil GROUP BY deptid ) E ON E.deptid = A.departmentid |
| | | LEFT JOIN ( |
| | | SELECT COUNT( * ) AS sbnum,dept_id FROM |
| | | blade_user |
| | | WHERE |
| | | role_id = '1412226235153731586' |
| | | AND STATUS = 1 |
| | | AND is_deleted = 0 |
| | | AND soil = 0 |
| | | GROUP BY |
| | | dept_id |
| | | ) E ON E.dept_id = A.departmentid |
| | | LEFT JOIN ( |
| | | SELECT |
| | | COUNT( * ) AS wcaijnum, |
| | |
| | | ) |
| | | </select> |
| | | |
| | | <!--查询单位的未派遣人数--> |
| | | <select id="selectInformationNotDispatcherNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT( * ) FROM blade_user |
| | | WHERE 1=1 |
| | | and role_id = '1412226235153731586' |
| | | and is_deleted = 0 |
| | | AND status=1 |
| | | AND dispatch=1 |
| | | 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> |
| | | |
| | | <!--查询单位持证的人数--> |
| | | <select id="selectInformationHoldNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT( * ) FROM blade_user |
| | |
| | | </if> |
| | | and p.score = 3 |
| | | </select> |
| | | |
| | | |
| | | <!--查询单位的已采集照片人数--> |
| | | <select id="selectInformationUnitAvatarNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM blade_user |
| | | WHERE |
| | | role_id = '1412226235153731586' |
| | | AND STATUS = 1 |
| | | AND is_deleted = 0 |
| | | AND avatar is not null and avatar!="" |
| | | 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> |
| | | |
| | | <!--查询单位的未采集照片人数--> |
| | | <select id="selectInformationUnitNotAvatarNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM blade_user |
| | | WHERE |
| | | role_id = '1412226235153731586' |
| | | AND STATUS = 1 |
| | | AND is_deleted = 0 |
| | | AND (avatar is null or avatar = "") |
| | | 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> |
| | | |
| | | <!--查询单位的已采集指纹人数--> |
| | | <select id="selectInformationUnitZwNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM blade_user |
| | | WHERE |
| | | role_id = '1412226235153731586' |
| | | AND STATUS = 1 |
| | | AND is_deleted = 0 |
| | | AND fingerprint is not null and fingerprint!="" |
| | | 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> |
| | | |
| | | |
| | | <!--查询单位的审查异常人数--> |
| | | <select id="selectInformationUnitYcNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM blade_user |
| | | WHERE |
| | | role_id = '1412226235153731586' |
| | | AND STATUS = 1 |
| | | AND is_deleted = 0 |
| | | AND examination_type = 1 |
| | | 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> |
| | | |
| | | <!--查询单位的审查异常人数--> |
| | | <select id="selectInformationUnitJnsbNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM blade_user |
| | | WHERE |
| | | role_id = '1412226235153731586' |
| | | AND STATUS = 1 |
| | | AND is_deleted = 0 |
| | | AND soil = 0 |
| | | 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> |