168 lines
8.5 KiB
XML
168 lines
8.5 KiB
XML
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||
|
|
<mapper namespace="com.sercurityControl.proteam.dutyTask.mapper.DayPaperMapper">
|
||
|
|
|
||
|
|
|
||
|
|
<select id="getJsbDayPlan" resultType="java.lang.Integer">
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_class_meetting
|
||
|
|
where build_unit_code='12Z0' AND current_constr_date=#{day}
|
||
|
|
union ALL
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_class_meetting
|
||
|
|
where build_unit_code='12Z0' and re_assessment_risk_level=2 AND current_constr_date=#{day}
|
||
|
|
union ALL
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_class_meetting
|
||
|
|
where build_unit_code='12Z0' and re_assessment_risk_level=3 AND current_constr_date=#{day}
|
||
|
|
union ALL
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_class_meetting
|
||
|
|
where build_unit_code='12Z0' and re_assessment_risk_level IN(4,5) AND current_constr_date=#{day}
|
||
|
|
</select>
|
||
|
|
<select id="getAqzlInfo" resultType="java.lang.Integer">
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_ticket
|
||
|
|
where 1=1 and ticket_status='05' and delete_flag=0
|
||
|
|
and re_assessment_risk_level in(2,3)
|
||
|
|
UNION all
|
||
|
|
select count(distinct jcm.ticket_id)
|
||
|
|
from jj_class_meetting jcm
|
||
|
|
where jcm.current_constr_date=#{day} and jcm.delete_flag=0
|
||
|
|
and jcm.re_assessment_risk_level in(2,3)
|
||
|
|
UNION all
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_ticket
|
||
|
|
where 1=1 and ticket_status='06' and delete_flag=0
|
||
|
|
and DATE_FORMAT(update_time, '%Y-%m-%d') = DATE_FORMAT(#{day}, '%Y-%m-%d')
|
||
|
|
UNION all
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_ticket
|
||
|
|
where 1=1 and ticket_status='04' and delete_flag=0
|
||
|
|
and DATE_FORMAT(update_time, '%Y-%m-%d') = DATE_FORMAT(#{day}, '%Y-%m-%d')
|
||
|
|
</select>
|
||
|
|
<!--班组及人员情况-->
|
||
|
|
<select id="getZbhInfo" resultType="java.lang.Integer">
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_ticket
|
||
|
|
where 1=1 and ticket_status='05' and delete_flag=0
|
||
|
|
UNION all
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_class_meetting jcm
|
||
|
|
where jcm.current_constr_date=#{day} and jcm.delete_flag=0
|
||
|
|
UNION all
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_class_meetting jcm
|
||
|
|
left join jj_class_meeting_people jcmp on jcm.id=jcmp.tool_box_talk_id and jcmp.delete_flag=0
|
||
|
|
where jcm.current_constr_date=#{day} and jcm.delete_flag=0
|
||
|
|
</select>
|
||
|
|
<!--作业计划执行情况-->
|
||
|
|
<select id="getProInfo" resultType="java.lang.Integer">
|
||
|
|
select IFNULL(count(DISTINCT single_project_code),0) num
|
||
|
|
from jj_class_meetting
|
||
|
|
where current_constr_date=#{day} and delete_flag=0
|
||
|
|
union ALL -- 作业现场 1
|
||
|
|
select IFNULL(count(id),0) num
|
||
|
|
from jj_class_meetting
|
||
|
|
where current_constr_date=#{day} and delete_flag=0
|
||
|
|
union ALL -- 二级风险2
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_class_meetting
|
||
|
|
where re_assessment_risk_level=2 AND current_constr_date=#{day} and delete_flag=0
|
||
|
|
union ALL -- 三级风险3
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_class_meetting
|
||
|
|
where re_assessment_risk_level=3 AND current_constr_date=#{day} and delete_flag=0
|
||
|
|
union ALL -- 四五级风险4
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_class_meetting
|
||
|
|
where re_assessment_risk_level in(4,5) AND current_constr_date=#{day} and delete_flag=0
|
||
|
|
union ALL -- 二三及风险5
|
||
|
|
select IFNULL(count(1),0) num
|
||
|
|
from jj_class_meetting
|
||
|
|
where re_assessment_risk_level in(2,3) AND current_constr_date=#{day} and delete_flag=0
|
||
|
|
union ALL -- 重要四级 6
|
||
|
|
select IFNULL(count(jcm.id),0) num
|
||
|
|
from jj_class_meetting jcm
|
||
|
|
LEFT JOIN jj_class_metting_info jcmi on jcmi.class_id=jcm.id
|
||
|
|
where re_assessment_risk_level in(4) AND current_constr_date=#{day} and delete_flag=0
|
||
|
|
and (jcmi.work_content LIKE('%跨越架%') OR jcmi.work_content LIKE('%流动式起重机%') )
|
||
|
|
</select>
|
||
|
|
<!--查询违章数据-->
|
||
|
|
<select id="getSupInfo" resultType="com.sercurityControl.proteam.dutyTask.domain.GwWzInfoVo">
|
||
|
|
select tnv.level_id wzlx,tnv.pro_name ,tnv.class_id classId ,so.abb_name orgName,
|
||
|
|
tnv.content wzContent,tnv.voi_yj wzyj,tnv.id,tnv.status,tnv.team_name teamName,
|
||
|
|
CONCAT(tnv.pro_name,"(",tnv.team_name,")") proName
|
||
|
|
from t_notice_voi tnv
|
||
|
|
LEFT JOIN sys_org so on so.org_id=tnv.org
|
||
|
|
where status in(1,2,3,4,5)
|
||
|
|
and tnv.create_time=#{day}
|
||
|
|
AND tnv.level_id='一般违章' and tnv.is_flag=0
|
||
|
|
order by tnv.level_id DESC
|
||
|
|
</select>
|
||
|
|
<select id="getUnitInfo" resultType="com.sercurityControl.proteam.dutyTask.domain.GwUnitVo">
|
||
|
|
select IFNULL(jcm.supervision_unit_name,'') jlDw ,IFNULL(ju.unit_name,'') sgDw, -- 施工单位
|
||
|
|
IFNULL(juni.unit_name,'') fbDw
|
||
|
|
from jj_class_meetting jcm
|
||
|
|
left join jj_class_meeting_people jcmp on jcmp.tool_box_talk_id=jcm.id and jcmp.position_flag='1' AND jcmp.position_code='0900101' -- 班组负责人
|
||
|
|
LEFT JOIN jj_ticket_people jtp on jtp.id_card=jcmp.id_card and jtp.ticket_id=jcm.ticket_id and jtp.delete_flag=0 -- 联系人电话
|
||
|
|
LEFT JOIN jj_user jue on jue.id=jcmp.personnel_id and jue.delete_flag=0
|
||
|
|
left JOIN jj_unit juni on juni.id=jue.unit_id and juni.delete_flag=0
|
||
|
|
left join jj_unit ju on ju.unified_social_credit_id=jcm.constr_unified_social_credit_id -- and ju.unit_type=6 -- 施工单位
|
||
|
|
where 1=1 and jcm.id=#{classId}
|
||
|
|
limit 1
|
||
|
|
</select>
|
||
|
|
<select id="getImageList" resultType="java.lang.String">
|
||
|
|
SELECT image_path
|
||
|
|
FROM t_notice_voi_photo
|
||
|
|
WHERE noti_id=#{id} and image_type=#{type}
|
||
|
|
and image_path is not null
|
||
|
|
</select>
|
||
|
|
<select id="getCityInfo" resultType="com.sercurityControl.proteam.dutyTask.domain.GwCityVo">
|
||
|
|
select so.city_name cityName,so.org_id orgId,count(jcm.id) zbhNum
|
||
|
|
from sys_org so
|
||
|
|
left join jj_class_meetting jcm on so.org_id=jcm.build_unit_code
|
||
|
|
and jcm.current_constr_date=#{day} and jcm.delete_flag=0
|
||
|
|
GROUP BY so.city_name,so.org_id
|
||
|
|
ORDER BY zbhNum DESC
|
||
|
|
</select>
|
||
|
|
<select id="getSupInfoByOrg" resultType="com.sercurityControl.proteam.dutyTask.domain.GwCityVo">
|
||
|
|
select SUM(num) ybwzNum,SUM(num2) yzwzNum
|
||
|
|
from(select IFNULL(count(1),0) num,0 num2
|
||
|
|
from t_notice_voi tnv
|
||
|
|
where sup_type=2 and level_id='一般违章'
|
||
|
|
AND tnv.org=#{orgId} and tnv.create_time=#{day} and tnv.is_flag=0
|
||
|
|
UNION ALL
|
||
|
|
select 0,IFNULL(count(1),0) num
|
||
|
|
from t_notice_voi tnv
|
||
|
|
where sup_type=2 and level_id='严重违章' and tnv.is_flag=0
|
||
|
|
AND tnv.org=#{orgId} and tnv.create_time=#{day}
|
||
|
|
)b
|
||
|
|
</select>
|
||
|
|
<select id="getClassInfo" resultType="com.sercurityControl.proteam.dutyTask.domain.GwClassInfoVo">
|
||
|
|
select so.city_name cityName,so.org_id orgId,count(jcm.id) zbuNum
|
||
|
|
from sys_org so
|
||
|
|
left join jj_class_meetting jcm on so.org_id=jcm.build_unit_code
|
||
|
|
and jcm.current_constr_date=#{day} and jcm.re_assessment_risk_level in(2,3) and jcm.delete_flag=0
|
||
|
|
GROUP BY so.city_name,so.org_id
|
||
|
|
ORDER BY zbuNum DESC
|
||
|
|
</select>
|
||
|
|
<select id="getRiskInfo" resultType="com.sercurityControl.proteam.dutyTask.domain.GwRiskInfoVo">
|
||
|
|
SELECT jcm.single_project_name proName,jcm.id ,so.city_name orgName,jcmi.work_content workContent,jcm.id
|
||
|
|
FROM jj_class_meetting jcm
|
||
|
|
left join sys_org so on so.org_id=jcm.build_unit_code
|
||
|
|
left join jj_class_metting_info jcmi on jcm.id =jcmi.class_id
|
||
|
|
where jcm.delete_flag=0 and jcm.current_constr_date=#{day}
|
||
|
|
and jcm.re_assessment_risk_level=2
|
||
|
|
</select>
|
||
|
|
<!--根据站班会id 获取到岗履职-->
|
||
|
|
<select id="getOnDuty" resultType="java.util.Map">
|
||
|
|
select
|
||
|
|
count(if(onduty_hierarchy='10',1,null)) sg,
|
||
|
|
count(if(onduty_hierarchy='20',1,null)) jl,
|
||
|
|
count(if(onduty_hierarchy='30',1,null)) yz
|
||
|
|
from jj_on_duty
|
||
|
|
WHERE delete_flag=0
|
||
|
|
AND tool_box_talk_id = #{id}
|
||
|
|
</select>
|
||
|
|
</mapper>
|