| | |
| | | and (sj.id = #{information.jurisdiction} or sj.parent_id = #{information.jurisdiction}) |
| | | </if> |
| | | </select> |
| | | |
| | | <sql id="getSubstationWarn"> |
| | | left join |
| | | sys_information si |
| | | on |
| | | si.departmentid = bu.dept_id |
| | | left join |
| | | sys_jurisdiction sj |
| | | on |
| | | sj.id = si.jurisdiction |
| | | where |
| | | 1=1 |
| | | and (si.stats = 2 or si.stats =4) |
| | | and bu.is_deleted = 0 |
| | | and bu.`status` = 1 |
| | | </sql> |
| | | |
| | | <!--根据辖区查询统计当前辖区下的保安公司(本市保安公司,分公司)预警信息,包含(未持证,现实表现差,未缴纳社保,资格审查异常)--> |
| | | <select id="getSubstationWarnInfoPage" resultType="org.springblade.modules.information.vo.InformationVO"> |
| | | select jurisdictionName,enterprisename,detail from ( |
| | | ( |
| | | select |
| | | si.jurisdiction id, |
| | | sj.parent_id, |
| | | sj.dept_name jurisdictionName, |
| | | si.enterprisename, |
| | | "表现差" detail |
| | | from sys_performance sp |
| | | left join |
| | | blade_user bu |
| | | on |
| | | bu.id = sp.securityId |
| | | left join |
| | | sys_information si |
| | | on |
| | | bu.dept_id = si.departmentid |
| | | left join |
| | | sys_jurisdiction sj |
| | | on |
| | | sj.id = si.jurisdiction |
| | | where |
| | | 1=1 |
| | | and (si.stats = 2 or si.stats =4) |
| | | and bu.is_deleted = 0 |
| | | and bu.`status` = 1 |
| | | and sp.score = 3 |
| | | ) |
| | | |
| | | union |
| | | ( |
| | | select |
| | | sj.id, |
| | | sj.parent_id, |
| | | sj.dept_name jurisdictionName, |
| | | si.enterprisename, |
| | | if(bu.hold=2,"未持证","证件吊销") as detail |
| | | from |
| | | blade_user bu |
| | | <include refid="getSubstationWarn"/> |
| | | and (bu.hold = 2 or bu.hold = 3) |
| | | ) |
| | | |
| | | |
| | | union |
| | | ( |
| | | select |
| | | sj.id, |
| | | sj.parent_id, |
| | | sj.dept_name jurisdictionName, |
| | | si.enterprisename, |
| | | "未缴纳社保" as detail |
| | | from |
| | | blade_user bu |
| | | <include refid="getSubstationWarn"/> |
| | | and bu.soil = 1 |
| | | ) |
| | | |
| | | union |
| | | ( |
| | | select |
| | | sj.id, |
| | | sj.parent_id, |
| | | sj.dept_name jurisdictionName, |
| | | si.enterprisename, |
| | | "审查异常" as detail |
| | | from |
| | | blade_user bu |
| | | <include refid="getSubstationWarn"/> |
| | | and bu.examination_type = 1 |
| | | ) |
| | | ) a |
| | | where 1=1 |
| | | <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'"> |
| | | and (a.id = #{information.jurisdiction} or a.parent_id = #{information.jurisdiction}) |
| | | </if> |
| | | </select> |
| | | </mapper> |