1068 lines
52 KiB
XML
1068 lines
52 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.TodayTaskMapper">
|
|
|
|
<!--添加站班会异常报备记录-->
|
|
<insert id="addClassMeetingReq" useGeneratedKeys="true" keyProperty="id">
|
|
INSERT INTO t_class_metting_rep(id,class_id,content,state,upload_time,rep_type_code)
|
|
VALUES (
|
|
NULL,#{classId},#{content},'1',#{uploadTime},#{uploadUserId}
|
|
)
|
|
</insert>
|
|
<!--添加站班会异常报备图片-->
|
|
<insert id="addClassMeetingReqImg">
|
|
INSERT INTO t_class_metting_rep_img(id,image_path,req_id)
|
|
VALUES
|
|
<foreach collection="list" item="item" separator=",">
|
|
(
|
|
NULL,#{item.imagePath},#{item.reqId}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
<!--添加违章通知记录-->
|
|
<insert id="addNoticeVio" useGeneratedKeys="true" keyProperty="id">
|
|
INSERT INTO t_notice_voi(
|
|
id,ser_no,ticket_no,class_id,pro_name,create_time,voi_type,voi_yj,level_id,vio_users,`type`,content,org,iss_user,iss_time,status,create_day,rec_requirement,
|
|
risk_level,team_name,bid_code,sign_code,voi_type_hand,sup_type,child_type,team_leader_number,remark2,team_id
|
|
)VALUES (
|
|
NULL,#{serNo},#{ticketNo},#{classId},#{proName},#{createTime},#{voiType},#{voiYj},#{levelId},#{vioUsers},
|
|
#{type},#{content},#{org},#{issUser},#{issTime},#{status},#{createDay},#{recRequirement},#{riskLevel},#{teamName},#{bidCode},#{signCode},#{voiTypeHand},#{supType},#{childType},#{teamLeaderNumber},#{remark2}
|
|
,#{teamId} )
|
|
</insert>
|
|
<!--添加违章通知记录图片-->
|
|
<insert id="addNoticeVioImg">
|
|
INSERT INTO t_notice_voi_photo(id,image_path,image_type,noti_id)
|
|
VALUES
|
|
<foreach collection="list" item="item" separator=",">
|
|
(
|
|
NULL,#{item.imagePath},#{item.imageType},#{item.notiId}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
<!--添加违章人员信息-->
|
|
<insert id="addNoticePeo">
|
|
INSERT INTO t_notice_peo(id,noti_id,class_id,`name`,id_number,score)
|
|
VALUES
|
|
<foreach collection="list" item="item" separator=",">
|
|
(
|
|
NULL,#{item.notiId},#{item.classId},#{item.name},#{item.idNumber},#{item.score}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
<insert id="insertTeamBlack" parameterType="com.sercurityControl.proteam.domain.TeamEvaData">
|
|
INSERT INTO t_black_team (id_number, black_time, remarks, operator, operat_time, status)
|
|
VALUES
|
|
<foreach collection="list" item="item" separator=",">
|
|
(
|
|
#{item.idNumber},now(),#{item.classId},#{item.name},#{item.score},'0'
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
<!--添加预警信息-->
|
|
<insert id="addWarnInfo">
|
|
INSERT INTO t_class_metting_warn(class_id,warn_type,update_time,num,status) VALUES
|
|
(#{classId},'',#{updateTime},0,'0')
|
|
</insert>
|
|
<insert id="addClassTopOne">
|
|
replace into jj_class_metting_sort(class_id,sort_num,sort_time) VALUES(
|
|
#{classId},#{sortNum},now()
|
|
)
|
|
</insert>
|
|
<!--更新是否重点关注班组-->
|
|
<update id="updateImportTeam">
|
|
UPDATE jj_team_info SET import_team = #{importTeam} WHERE team_id = #{idNumber}
|
|
</update>
|
|
<!--更新告警信息-->
|
|
<update id="updateWarnInfoByClassId">
|
|
UPDATE t_class_metting_warn SET status = '1',num = #{num},warn_type = #{warnType},remark = #{remark} WHERE class_id = #{classId}
|
|
</update>
|
|
<!--告警确认-->
|
|
<update id="updateWarnInfoByClassIdConfirm">
|
|
UPDATE t_class_metting_warn SET status = '1',warn_type = #{warnType} WHERE class_id = #{classId}
|
|
</update>
|
|
|
|
|
|
|
|
<!--根据puid获取球机的开机时长-->
|
|
<select id="getTime" resultType="java.util.Map">
|
|
SELECT up_time AS upTime,down_time AS downTime
|
|
FROM t_device_updown
|
|
WHERE puid=#{id} AND up_time like concat('%',#{currentTime},'%')
|
|
</select>
|
|
|
|
<!--根据id获取站班会时长-->
|
|
<select id="getWorkHours" resultType="java.util.Map">
|
|
SELECT work_start_time AS `time`,1 'type'
|
|
FROM jj_class_meetting
|
|
WHERE id = #{id} AND current_constr_date = #{workDay}
|
|
ORDER BY work_start_time ASC
|
|
</select>
|
|
|
|
<select id="getBallTimeList" parameterType="com.sercurityControl.proteam.dutyTask.domain.DeviceUpDownVo"
|
|
resultType="com.sercurityControl.proteam.dutyTask.domain.DeviceUpDownVo">
|
|
select dev.puid puId,up_time upTime,down_time downTime
|
|
from t_device_updown dev
|
|
<where>
|
|
|
|
<if test="puId!=null and puId!=''">
|
|
and dev.puid=#{puId}
|
|
</if>
|
|
<if test="createDay!=null and createDay!=''">
|
|
and (up_time like concat('%',concat(#{createDay},'%')) or
|
|
down_time like concat('%',concat(#{createDay},'%'))
|
|
)
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
|
|
<!--查询站班会施工人员 及未施工人员-->
|
|
<select id="getZbhPeople" parameterType="com.sercurityControl.proteam.dutyTask.domain.ClassMettingPeopleVo"
|
|
resultType="com.sercurityControl.proteam.dutyTask.domain.ClassMettingPeopleVo">
|
|
select id_card idNumber,real_name userName,IFNULL(jdc.`value` ,'一般作业人员')typeName,jdc.code_value peopleType ,work_division lsry
|
|
from jj_class_meeting_people jcmp
|
|
left join jj_data_code jdc on jdc.code_value=jcmp.position_code and jdc.`code`='POSITION_CODE'
|
|
where jcmp.tool_box_talk_id=#{classId} and jcmp.position_flag='1'
|
|
UNION ALL
|
|
SELECT jtp.id_card idNumber,jtp.real_name typeName,IFNULL(jdc.`value` ,'一般作业人员')typeName,'未施工' peopleType,'01' lsry
|
|
from jj_class_meetting jcm
|
|
left join jj_ticket_people jtp on jtp.ticket_id=jcm.ticket_id
|
|
left join jj_data_code jdc on jdc.code_value=jtp.position_code and jdc.`code`='POSITION_CODE'
|
|
left join jj_class_meeting_people jcmp on jcmp.tool_box_talk_id=jcm.id AND jtp.id_card=jcmp.id_card
|
|
where jcm.id=#{classId}
|
|
and jcmp.id_card is NULL and jtp.id_card is not null
|
|
</select>
|
|
|
|
|
|
<!--获取站班会 获取数据信息-->
|
|
<select id="getClassMettingSign" parameterType="com.sercurityControl.proteam.dutyTask.domain.ClassMettingPeopleVo"
|
|
resultType="com.sercurityControl.proteam.dutyTask.domain.ClassMettingPeopleVo">
|
|
select real_name userName,mobile phone,position_code ,
|
|
create_time inTime ,jdc.`value` peopleType,jod.id_card idNumber
|
|
,jod.onduty_hierarchy unit
|
|
from jj_on_duty jod
|
|
left join jj_data_code jdc on jdc.code_value=jod.position_code and jdc.code='JOB_CODE'
|
|
where jod.tool_box_talk_id=#{classId}
|
|
</select>
|
|
<!--根据站班会id获取异常上报数据-->
|
|
<select id="getExceptionReportList"
|
|
resultType="com.sercurityControl.proteam.dutyTask.domain.ExceptionReportEntity">
|
|
SELECT ANY_VALUE(tcmr.content) AS content,
|
|
ANY_VALUE(tcmr.upload_time) AS uploadTime,
|
|
ANY_VALUE(GROUP_CONCAT(tcmri.image_path)) AS imgPath
|
|
FROM t_class_metting_rep tcmr
|
|
LEFT JOIN t_class_metting_rep_img tcmri ON tcmr.id = tcmri.req_id
|
|
WHERE tcmr.state = '1' AND tcmr.class_id = #{classId}
|
|
GROUP BY tcmr.id
|
|
</select>
|
|
<!--根据站班会id和关键字查询班组人员-->
|
|
<select id="getPersonList" resultType="com.sercurityControl.proteam.dutyTask.domain.ClassMettingPeopleVo">
|
|
SELECT cmp.real_name AS userName,
|
|
cmp.id_card AS idNumber
|
|
FROM jj_class_meeting_people cmp
|
|
WHERE cmp.tool_box_talk_id=#{classId}
|
|
<if test="userName!=null and userName!=''">
|
|
AND INSTR(cmp.real_name,#{userName})
|
|
</if>
|
|
<!--UNION ALL
|
|
SELECT tip.user_name AS userName,tip.id_number AS idNumber
|
|
FROM t_class_metting cm
|
|
LEFT JOIN t_ticket_info info ON cm.ticket_no=info.job_num
|
|
LEFT JOIN t_ticket_info_people tip ON tip.ticket_id=info.id
|
|
LEFT JOIN t_class_metting_people cmp ON cmp.id_number=tip.id_number AND cmp.class_id=#{classId}
|
|
WHERE cmp.id_number IS NULL AND cm.class_id=#{classId} AND cm.del_flag = '0' AND info.flag = '1'
|
|
<if test="userName!=null and userName!=''">
|
|
AND INSTR(tip.user_name,#{userName})
|
|
</if>-->
|
|
</select>
|
|
<!--根据违章类别,获取违章依据-->
|
|
<select id="getVioInfoList" resultType="com.sercurityControl.proteam.dutyTask.domain.NoticeVoiInfoVo">
|
|
SELECT id,noti_info AS notiInfo
|
|
FROM t_notice_voi_info
|
|
WHERE is_flag = 0 AND voi_type_id = #{vioTypeId}
|
|
<if test="notiInfo!=null and notiInfo!=''">
|
|
AND INSTR(noti_info,#{notiInfo})
|
|
</if>
|
|
</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>
|
|
<!--获取违章通知记录上一个编号-->
|
|
<select id="getLastSerNo" resultType="java.lang.String">
|
|
SELECT ser_no
|
|
FROM t_notice_voi
|
|
WHERE create_time = CURRENT_DATE
|
|
ORDER BY iss_time DESC
|
|
LIMIT 1
|
|
</select>
|
|
<!--地市站班会数量和占比-->
|
|
<select id="getOrgNumAndRate" resultType="java.util.Map">
|
|
SELECT so.org_id AS `code`, so.city_name AS `name` ,IFNULL(a.num,0) AS num
|
|
FROM sys_org so
|
|
LEFT JOIN (
|
|
SELECT zbh.build_unit_code org,COUNT(zbh.build_unit_code) AS num
|
|
FROM jj_class_meetting zbh
|
|
left join jj_class_metting_info jcmi on jcmi.class_id=zbh.id
|
|
LEFT JOIN t_class_metting_check tcmc ON tcmc.class_id = zbh.id AND tcmc.create_time BETWEEN #{startTime} AND #{endTime}
|
|
LEFT JOIN t_class_metting_warn tcmw ON zbh.id = tcmw.class_id AND tcmw.update_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
|
LEFT JOIN sys_user su ON tcmc.check_user = su.id
|
|
LEFT JOIN tb_user_banding tub ON tcmc.check_user = tub.login_user_id AND tub.banding_date = tcmc.create_time AND tub.banding_date BETWEEN #{startTime} AND #{endTime} AND tub.is_flag = '0'
|
|
LEFT JOIN sys_org so ON zbh.build_unit_code = so.org_id
|
|
left join jj_ball jbl on jbl.id=zbh.camera_id AND jbl.delete_flag = '0'
|
|
LEFT JOIN t_device td ON td.t_code = jbl.camera_no AND td.is_flag = '0'
|
|
WHERE zbh.current_constr_date BETWEEN #{startTime} AND #{endTime} AND zbh.delete_flag = '0'
|
|
<if test="isSup == 1">
|
|
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
|
|
</if>
|
|
<if test="yxsType!=null and yxsType!=''">
|
|
AND tcmc.is_check=#{yxsType}
|
|
</if>
|
|
<if test="xsUser!=null and xsUser!=''">
|
|
AND (su.user_name=#{xsUser} or tub.scheduling_name=#{xsUser} )
|
|
</if>
|
|
<if test="isSup == 2">
|
|
AND tcmc.check_user = #{currentUserId}
|
|
</if>
|
|
<if test="isSup == 3">
|
|
AND zbh.build_unit_code = #{currentUserOrgId}
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 1">
|
|
AND INSTR(IFNULL(tub.scheduling_name,su.user_name),#{inspector}) > 0
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 2">
|
|
AND INSTR('值班员',#{inspector}) > 0
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 3">
|
|
AND INSTR('建设部安全管控',#{inspector}) > 0
|
|
</if>
|
|
<if test="evaluationStatus!=null and evaluationStatus!=''">
|
|
AND tcmc.is_pj = #{evaluationStatus}
|
|
</if>
|
|
<if test="riskLevel!=null and riskLevel!=''">
|
|
AND zbh.re_assessment_risk_level IN (
|
|
<foreach collection="riskLevelList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="proStatus!=null and proStatus!=''">
|
|
AND zbh.current_construction_status IN (
|
|
<foreach collection="proStatusList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="keyWord!=null and keyWord!=''">
|
|
AND (
|
|
INSTR(zbh.bidding_section_name,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_manage,#{keyWord}) > 0 OR
|
|
INSTR(IFNULL(tub.scheduling_name,su.user_name),#{keyWord}) > 0 OR
|
|
INSTR(tcmw.warn_type,#{keyWord}) > 0
|
|
)
|
|
</if>
|
|
<if test="bidName!=null and bidName!=''">
|
|
AND zbh.bidding_section_code IN (
|
|
<foreach collection="bidNameList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="foreman!=null and foreman!=''">
|
|
AND INSTR(jcmi.work_manage,#{foreman}) > 0
|
|
</if>
|
|
<if test="ballStatus!=null and ballStatus!=''">
|
|
AND td.state = #{ballStatus}
|
|
</if>
|
|
GROUP BY zbh.build_unit_code
|
|
)a ON a.org = so.org_id
|
|
ORDER BY num DESC
|
|
</select>
|
|
<!--获取站班会预警信息标签-->
|
|
<select id="getZbhWarnInfo" resultType="java.lang.String">
|
|
SELECT warn_type FROM t_class_metting_warn
|
|
WHERE class_id = #{classId}
|
|
</select>
|
|
<select id="getVoiNum" resultType="java.lang.Integer">
|
|
SELECT COUNT(*) FROM t_notice_voi
|
|
WHERE class_id = #{id} AND create_time = CURRENT_DATE
|
|
AND `status` NOT IN ('7','8') AND (sup_type IS NULL OR sup_type = '1')
|
|
</select>
|
|
<!--获取告警信息-->
|
|
<select id="getWarnInfo" resultType="com.sercurityControl.proteam.dutyTask.domain.ClassMettingWarnVo">
|
|
SELECT
|
|
warn_type AS warnType,
|
|
remark
|
|
FROM t_class_metting_warn WHERE class_id = #{classId}
|
|
</select>
|
|
<!--工程累计违章数-->
|
|
<select id="getProVoiNum" resultType="java.lang.Integer">
|
|
SELECT COUNT(*) FROM t_notice_voi
|
|
WHERE bid_code = #{id} AND `status` NOT IN ('7','8') AND (sup_type IS NULL OR sup_type = '1')
|
|
</select>
|
|
<select id="getWanTypeByClassId" resultType="String" parameterType="String">
|
|
Select warn_type
|
|
from t_class_metting_warn
|
|
where class_id=#{classId}
|
|
</select>
|
|
<!--获取班组评价标签-->
|
|
<select id="getTeamLabels" resultType="java.lang.String">
|
|
SELECT lable FROM t_team_label WHERE id = #{teamId}
|
|
</select>
|
|
|
|
<select id="getTeamInfo" resultType="com.sercurityControl.proteam.callInterface.domain.TeamInfo">
|
|
select jcmi.team_id teamId,jcmi.work_manage_num idNumber
|
|
from jj_class_meetting jcm
|
|
LEFT JOIN jj_class_metting_info jcmi on jcm.id=jcmi.class_id
|
|
WHERE jcm.id = #{classId}
|
|
</select>
|
|
<!--查询站班会信息-->
|
|
<select id="getJJTaskList" resultType="com.sercurityControl.proteam.dutyTask.domain.TodayTaskVo">
|
|
select jcm.id id,jcm.work_start_time startTime,jcm.current_constr_date workDay,
|
|
tcmc.is_pj AS evaluationStatus,
|
|
tcmc.check_time AS supervisionTime,
|
|
<if test="isSup == 1">
|
|
IFNULL(tub.scheduling_name,su.user_name) AS inspector,
|
|
</if>
|
|
<if test="isSup == 2">
|
|
'值班员' AS inspector,
|
|
</if>
|
|
<if test="isSup == 3">
|
|
'建设部安全管控' AS inspector,
|
|
</if>
|
|
CASE jcm.current_construction_status
|
|
WHEN '01' THEN '开工'
|
|
WHEN '02' THEN '暂停'
|
|
WHEN '03' THEN '完工'
|
|
WHEN '04' THEN '完工' END AS proStatus,
|
|
jcm.current_construction_status AS sgStatus,
|
|
jcm.tool_box_talk_address workLocation, -- 站班会地址
|
|
jcm.tool_box_talk_longitude lon,
|
|
jcm.tool_box_talk_Latitude lat,
|
|
jcm.mc_work_site_id,
|
|
jcm.bidding_section_code bidNo,
|
|
jcm.bidding_section_name bidName,
|
|
jcm.single_project_code signCode,
|
|
jcm.single_project_name signName ,
|
|
jcm.single_project_type proType,
|
|
jcm.prj_name proName,
|
|
jcm.change_time changeTime,
|
|
tcmw.warn_type AS earlyWarningStatus,
|
|
jcm.build_unit_code org,
|
|
jcm.camera_id cameraId,
|
|
jcm.camera_id2 cameraId2,
|
|
jcm.ticket_id ticketId,-- 作业票id
|
|
jcm.ticket_no ticketNo,jcm.re_assessment_risk_level riskLevel,
|
|
jcm.current_constr_headcount userNum,
|
|
jcm.construction_headcount userNums,
|
|
jcm.change_time,-- 状态变更时间(如果暂停,则就是暂停时间)
|
|
jcmi.team_id teamId,
|
|
jcmi.work_manage_num idNumber,
|
|
jcmi.work_manage foreman,
|
|
IFNULL( jcmi.work_manage_phone, '' ) foremanPhone,
|
|
jcmi.team_name teamName,
|
|
so.city_name buildCode,
|
|
jcmi.work_site workSite , -- 作业部位
|
|
jcmi.work_content content, -- 作业内容
|
|
jcmi.work_gx workGx, -- 工序
|
|
jcmi.work_type workType, -- 作业类型
|
|
jcm.construction_unit_name sgdw, -- 施工单位
|
|
td.puid,jcmi.main_risk mainRisk,
|
|
jcm.risk_precaution_id riskId, -- 风险一本账id
|
|
td.mac_id macId,IFNULL(jcms.sort_num,0) sortNum,
|
|
jcm.prj_code proCode,
|
|
td.state ballStatus,
|
|
jb.camera_no tCode, -- 统一编码
|
|
jcm.supervision_unit_name jldw -- 监理单位
|
|
from jj_class_meetting jcm
|
|
left join jj_class_metting_info jcmi on jcm.id=jcmi.class_id
|
|
left join sys_org so on jcm.build_unit_code=so.org_id -- 组织机构
|
|
/*left join jj_unit ju on ju.unified_social_credit_id=jcm.constr_unified_social_credit_id and ju.delete_flag=0*/ -- and ju.unit_type=6 -- 施工单位
|
|
left join jj_ball jb on jb.id=jcm.camera_id2
|
|
left join t_device td on td.t_code=jb.camera_no and td.is_flag=0 -- 球机设备编码
|
|
left JOIN t_class_metting_check tcmc ON tcmc.class_id = jcm.id
|
|
left JOIN t_class_metting_warn tcmw ON jcm.id = tcmw.class_id
|
|
LEFT JOIN sys_user su ON tcmc.check_user = su.id
|
|
LEFT JOIN jj_class_metting_sort jcms on jcms.class_id=jcm.id
|
|
LEFT JOIN tb_user_banding tub ON tcmc.check_user = tub.login_user_id and tub.banding_date = tcmc.create_time
|
|
and tub.banding_date between #{startTime} and #{endTime} and tub.is_flag = '0'
|
|
WHERE jcm.current_constr_date BETWEEN #{startTime} AND #{endTime} AND jcm.delete_flag = '0'
|
|
<if test="isSup == 1">
|
|
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
|
|
</if>
|
|
<if test="yxsType!=null and yxsType!=''">
|
|
AND tcmc.is_check=#{yxsType}
|
|
</if>
|
|
<if test="xsUser!=null and xsUser!=''">
|
|
AND (su.user_name=#{xsUser} or tub.scheduling_name=#{xsUser} )
|
|
</if>
|
|
<if test="isSup == 2">
|
|
AND tcmc.check_user = #{currentUserId}
|
|
</if>
|
|
-- 一本账工程编码
|
|
<if test="proId!=null and proId!=''" >
|
|
AND jcm.single_project_name=#{proId}
|
|
</if>
|
|
-- 标段工程编码
|
|
<if test="bidNo!=null and bidNo!=''" >
|
|
AND jcm.bidding_section_code=#{bidNo}
|
|
</if>
|
|
<if test="isSup == 3">
|
|
AND jcm.build_unit_code = #{currentUserOrgId}
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 1">
|
|
AND INSTR(IFNULL(tub.scheduling_name,su.user_name),#{inspector}) > 0
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 2">
|
|
AND INSTR('值班员',#{inspector}) > 0
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 3">
|
|
AND INSTR('建设部安全管控',#{inspector}) > 0
|
|
</if>
|
|
<if test="evaluationStatus!=null and evaluationStatus!=''">
|
|
AND tcmc.is_pj = #{evaluationStatus}
|
|
</if>
|
|
<if test="buildCode!=null and buildCode!=''">
|
|
AND so.org_id IN (
|
|
<foreach collection="buildCodeList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="riskLevel!=null and riskLevel!=''">
|
|
AND jcm.re_assessment_risk_level IN (
|
|
<foreach collection="riskLevelList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="proStatus!=null and proStatus!=''">
|
|
AND jcm.current_construction_status IN (
|
|
<foreach collection="proStatusList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="sgdwList!=null and sgdwList.size() > 0">
|
|
AND jcm.construction_unit_name IN (
|
|
<foreach collection="sgdwList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="keyWord!=null and keyWord!=''">
|
|
AND (
|
|
INSTR(tub.scheduling_name,#{keyWord}) > 0 OR
|
|
INSTR(su.user_name,#{keyWord}) > 0 OR
|
|
INSTR(jcm.bidding_section_code,#{keyWord}) > 0 OR
|
|
INSTR(tcmw.warn_type,#{keyWord}) > 0 OR
|
|
INSTR(jcm.current_constr_date,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.team_name,#{keyWord}) > 0 OR
|
|
INSTR(jcm.bidding_section_name,#{keyWord}) > 0 OR
|
|
INSTR(td.td_code,#{keyWord}) > 0 OR
|
|
INSTR(jcm.ticket_no,#{keyWord}) > 0 OR
|
|
INSTR(jcm.re_assessment_risk_level,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_content,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_manage_phone,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_gx,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_type,#{keyWord}) > 0 OR
|
|
INSTR(so.city_name,#{keyWord}) > 0 OR
|
|
INSTR(td.puid,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_manage,#{keyWord}) > 0 OR
|
|
INSTR(jcm.construction_unit_name,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_manage,#{keyWord}) > 0 OR
|
|
INSTR(jcm.supervision_unit_name,#{keyWord}) > 0 OR
|
|
INSTR(IFNULL(tub.scheduling_name,su.user_name),#{keyWord}) > 0 OR
|
|
INSTR(tcmw.warn_type,#{keyWord}) > 0
|
|
)
|
|
</if>
|
|
<if test="bidName!=null and bidName!=''">
|
|
AND jcm.bidding_section_code IN (
|
|
<foreach collection="bidNameList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="foreman!=null and foreman!=''">
|
|
AND INSTR(jcmi.work_manage,#{foreman}) > 0
|
|
</if>
|
|
<if test="ballStatus!=null and ballStatus!=''">
|
|
AND td.state = #{ballStatus}
|
|
</if>
|
|
ORDER BY IFNULL(jcms.sort_num,0) DESC , jcms.sort_time desc , jcm.create_time DESC
|
|
<if test="isSortByTime==null">
|
|
, tcmw.num DESC
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
<!--站班会详情查询-->
|
|
<select id="getJjClassMettingDetails" resultType="com.sercurityControl.proteam.dutyTask.domain.ClassMettingVo"
|
|
parameterType="com.sercurityControl.proteam.dutyTask.domain.ClassMettingVo">
|
|
select jcm.id classId,jcm.work_start_time startTime,jcm.current_constr_date workDay,
|
|
CASE jcm.current_construction_status
|
|
WHEN '01' THEN '开工'
|
|
WHEN '02' THEN '暂停'
|
|
WHEN '03' THEN '完工'
|
|
WHEN '04' THEN '完工' END AS proStatus,
|
|
jcm.current_construction_status AS sgStatus,
|
|
jcm.tool_box_talk_address workLocation, -- 站班会地址
|
|
jcm.tool_box_talk_longitude lon,
|
|
jcm.tool_box_talk_Latitude lat,
|
|
jcm.bidding_section_code bidCode,
|
|
jcm.bidding_section_name bidName,
|
|
jcm.single_project_code signCode,
|
|
jcm.single_project_name signName ,
|
|
jcm.single_project_type proType,
|
|
jcm.prj_name proName,
|
|
jcm.build_unit_code org,
|
|
jcm.camera_id cameraId,
|
|
jcm.ticket_id ticketId,-- 作业票id
|
|
jcm.ticket_no ticketNo,jcm.re_assessment_risk_level riskLevel,
|
|
jcm.change_time ztsj,-- 状态变更时间(如果暂停,则就是暂停时间)
|
|
jcmi.work_manage_phone workManagePhone,
|
|
jcmi.team_id teamId,
|
|
jcmi.work_manage_num idNumber,
|
|
jcmi.work_manage workManager,
|
|
jcmi.team_name teamName,
|
|
jcmi.work_gx workGx,
|
|
jcmi.work_type workType,jcmi.work_content workContent,
|
|
so.city_name cityName,
|
|
jcm.risk_precaution_id riskProductId,
|
|
td.puid puId, td2.puid puId2,
|
|
jcm.risk_precaution_id riskId, -- 风险一本账id
|
|
td.mac_id macId,
|
|
jcm.file_id fileIds,
|
|
jcm.prj_code proCode,
|
|
td.state ballStatus,
|
|
jb.camera_no tCode, -- 统一编码
|
|
jcm.construction_unit_name sgdw, -- 施工单位
|
|
IFNULL(jcms.sort_num,0) sortNum,
|
|
jcm.supervision_unit_name jldw -- 监理单位,
|
|
,jti.import_team importTeam
|
|
from jj_class_meetting jcm
|
|
LEFT JOIN jj_class_metting_info jcmi on jcmi.class_id=jcm.id
|
|
left join jj_team_info jti on jcmi.team_id=jti.team_id
|
|
left join sys_org so on jcm.build_unit_code=so.org_id -- 组织机构
|
|
left join jj_ball jb on jb.id=jcm.camera_id2 and jb.delete_flag=0 -- 统一设备
|
|
left join t_device td on td.t_code=jb.camera_no and td.is_flag=0 -- 球机设备编码
|
|
left join jj_ball jb2 on jb2.id=jcm.camera_id3 and jb2.delete_flag=0 -- 统一设备
|
|
left join t_device td2 on td2.t_code=jb2.camera_no and td2.is_flag=0 -- 球机设备编码
|
|
left JOIN t_class_metting_check tcmc ON tcmc.class_id = jcm.id
|
|
left JOIN t_class_metting_warn tcmw ON jcm.id = tcmw.class_id
|
|
LEFT JOIN sys_user su ON tcmc.check_user = su.id
|
|
LEFT JOIN jj_class_metting_sort jcms on jcms.class_id=jcm.id
|
|
WHERE jcm.id=#{classId}
|
|
</select>
|
|
|
|
<!--统一查询 查询 扩展信息-->
|
|
<select id="getDataInfo" resultType="com.sercurityControl.proteam.dutyTask.domain.DataInfo">
|
|
select id,
|
|
concat(replenish_content_1,IFNULL(replenish_content_2,''),IFNULL(replenish_content_3,'')
|
|
,IFNULL(replenish_content_4,''),IFNULL(replenish_content_5,'')
|
|
,IFNULL(replenish_content_6,''),IFNULL(replenish_content_7,'')
|
|
) replenishContent,
|
|
replenish_content_1 replenishContent1,
|
|
replenish_content_2 replenishContent2,
|
|
replenish_content_3 replenishContent3,
|
|
replenish_content_4 replenishContent4,
|
|
replenish_content_5 replenishContent5,
|
|
replenish_content_6 replenishContent6,
|
|
replenish_content_7 replenishContent7,
|
|
ref_id refId,
|
|
ref_id2 refId2,
|
|
sort_no,
|
|
ext_type extType,
|
|
content_type contentType
|
|
from jj_info
|
|
where delete_flag=0
|
|
<if test="refId!=null and refId!=''">
|
|
and ref_id=#{refId}
|
|
</if>
|
|
<if test="refId2!=null and refId2!=''">
|
|
and ref_id2=#{refId2}
|
|
</if>
|
|
<if test="extType!=null and extType!=''">
|
|
and ext_type=#{extType}
|
|
</if>
|
|
<if test="contentType!=null and contentType!=''">
|
|
and content_type=#{contentType}
|
|
</if>
|
|
ORDER BY sort_no asc
|
|
</select>
|
|
<select id="getWorkDetails" resultType="com.sercurityControl.proteam.domain.vo.WorkDetailsVo">
|
|
select
|
|
jrp.work_site_name workSite , -- 作业部位
|
|
jrp.work_content content, -- 作业内容
|
|
jrp.work_procedure workGx, -- 工序
|
|
jdc.`value` workType -- 作业类型
|
|
FROM jj_risk_precaution jrp
|
|
LEFT JOIN jj_data_code jdc on jdc.code_value=jrp.work_type and jdc.`code`='WORK_TYPE'
|
|
where jrp.id in(
|
|
<foreach collection="list" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</select>
|
|
<select id="getUserNoPlan" resultType="java.lang.String">
|
|
select jcmp.id_card
|
|
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'
|
|
left join jj_ticket_people jtp on jtp.ticket_id=jcm.ticket_id and jcmp.personnel_id=jtp.personnel_id
|
|
where jtp.id is null and jcmp.id_card is not null and jcm.id=#{classId}
|
|
</select>
|
|
<select id="getPuIds" resultType="java.lang.String">
|
|
select td.puid
|
|
from jj_ball jb
|
|
left join t_device td on td.t_code=jb.camera_no and td.is_flag=0 -- 球机设备编码
|
|
where 1=1
|
|
AND jb.id IN (
|
|
<foreach collection="list" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</select>
|
|
|
|
<select id="getCameraIds" resultType="java.lang.String">
|
|
select jb.camera_no
|
|
from jj_ball jb
|
|
where 1=1
|
|
AND jb.id IN (
|
|
<foreach collection="list" item="item" separator=",">#{item}
|
|
</foreach>
|
|
)
|
|
</select>
|
|
<select id="getCameraList" resultType="com.sercurityControl.proteam.dutyTask.domain.CameraVo">
|
|
select td.puid,jb.id cameraId,jb.camera_no cameraNo
|
|
from jj_ball jb
|
|
left join t_device td on td.t_code=jb.camera_no and td.is_flag=0 -- 球机设备编码
|
|
where 1=1
|
|
AND jb.id IN (
|
|
<foreach collection="list" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</select>
|
|
|
|
<select id="getFileIds" resultType="java.lang.String">
|
|
select file_id
|
|
from jj_class_meetting
|
|
where id=#{classId}
|
|
</select>
|
|
|
|
<select id="getFileList" resultType="com.sercurityControl.proteam.dutyTask.domain.JjFileVo">
|
|
select id, tool_box_talk_id toolBoxTalkId ,onduty_record_id ondutyRecordId,
|
|
file_type fileType, prj_code prjCode,shooting_longitude shootingLongitude,
|
|
shooting_time shootingTime,
|
|
watermark_file_id watermarkFileId, file_id fileId, file_name fileName,
|
|
suffix_type suffixType
|
|
from jj_file
|
|
where delete_flag=0
|
|
AND file_type IN('1','2','3','01','02','03')
|
|
AND (
|
|
tool_box_talk_id=#{param.classId}
|
|
<if test="list!=null and list!=''">
|
|
or onduty_record_id in(
|
|
<foreach collection="list" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
)
|
|
</select>
|
|
<select id="getTicketImageData" resultType="com.sercurityControl.proteam.dutyTask.domain.JjFileVo">
|
|
select id, tool_box_talk_id toolBoxTalkId ,onduty_record_id ondutyRecordId,
|
|
file_type fileType, prj_code prjCode,shooting_longitude shootingLongitude,
|
|
shooting_latitude shootingLatitude, shooting_address shootingAddress, shooting_time shootingTime,
|
|
watermark_file_id watermarkFileId, file_id fileId, file_name fileName, province_code,
|
|
creater_id, create_time, updater_id,
|
|
update_time, suffix_type suffixType
|
|
from jj_file
|
|
where tool_box_talk_id=#{ticketId} AND delete_flag=0
|
|
AND file_type IN('5','05')
|
|
</select>
|
|
<select id="getOndutyList" resultType="java.lang.String">
|
|
select id
|
|
from jj_on_duty
|
|
where tool_box_talk_id=#{classId}
|
|
</select>
|
|
<select id="getSgFa" resultType="com.sercurityControl.proteam.dutyTask.domain.SgFaVo">
|
|
select file.attach_id fileId,file.file_name fileName
|
|
from jj_class_meetting jcm
|
|
left join egz_sg_fa_attach_rel file on file.single_project_code=jcm.single_project_code
|
|
WHERE file.attach_id is not null and jcm.id=#{classId}
|
|
|
|
</select>
|
|
<select id="getClassRisk" resultType="java.lang.String">
|
|
select re_assessment_risk_level
|
|
from jj_class_meetting
|
|
where id=#{classId}
|
|
</select>
|
|
<select id="getBallList" resultType="com.sercurityControl.proteam.callInterface.domain.BallVo">
|
|
select jb.camera_no tcode,td.puid,td.state online
|
|
from jj_class_meetting jcm
|
|
left join jj_ball jb on jb.id=jcm.camera_id2
|
|
left join t_device td on td.t_code=jb.camera_no and td.is_flag=0 -- 球机设备编码
|
|
where jcm.id=#{id} and td.puid is not null
|
|
union ALL
|
|
select jb2.camera_no tcode,td2.puid,td2.state online
|
|
from jj_class_meetting jcm
|
|
left join jj_ball jb2 on jb2.id=jcm.camera_id3
|
|
left join t_device td2 on td2.t_code=jb2.camera_no and td2.is_flag=0 -- 球机设备编码
|
|
where jcm.id=#{id} and td2.puid is not null
|
|
union ALL
|
|
select jb3.camera_no tcode,td3.puid,td3.state online
|
|
from jj_class_meetting jcm
|
|
left join jj_ball jb3 on jb3.id=jcm.camera_id4
|
|
left join t_device td3 on td3.t_code=jb3.camera_no and td3.is_flag=0 -- 球机设备编码
|
|
where jcm.id=#{id} and td3.puid is not null
|
|
|
|
</select>
|
|
<select id="statisticalChart" resultType="java.util.Map">
|
|
SELECT
|
|
SUM(CASE WHEN jcm.re_assessment_risk_level = '2' THEN 1 ELSE 0 END) AS twoCount,
|
|
SUM(CASE WHEN jcm.re_assessment_risk_level = '3' THEN 1 ELSE 0 END) AS threeCount,
|
|
SUM(CASE WHEN jcm.re_assessment_risk_level = '4' or jcm.re_assessment_risk_level = '5' THEN 1 ELSE 0 END) AS fourCount,
|
|
COUNT(jcm.id) AS totalCount
|
|
FROM
|
|
jj_class_meetting jcm
|
|
left join jj_class_metting_info jcmi on jcm.id=jcmi.class_id
|
|
left join jj_unit ju on ju.unified_social_credit_id=jcm.constr_unified_social_credit_id and ju.delete_flag=0 -- and ju.unit_type=6 -- 施工单位
|
|
left join jj_ball jb on jb.id=jcm.camera_id2
|
|
left join t_device td on td.t_code=jb.camera_no and td.is_flag=0 -- 球机设备编码
|
|
left JOIN t_class_metting_check tcmc ON tcmc.class_id = jcm.id
|
|
left JOIN t_class_metting_warn tcmw ON jcm.id = tcmw.class_id
|
|
LEFT JOIN sys_user su ON tcmc.check_user = su.id
|
|
LEFT JOIN jj_class_metting_sort jcms on jcms.class_id=jcm.id
|
|
LEFT JOIN tb_user_banding tub ON tcmc.check_user = tub.login_user_id and tub.banding_date = tcmc.create_time
|
|
and tub.banding_date between #{startTime} and #{endTime} and tub.is_flag = '0'
|
|
WHERE jcm.current_constr_date BETWEEN #{startTime} AND #{endTime} AND jcm.delete_flag = '0'
|
|
<if test="isSup == 1">
|
|
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
|
|
</if>
|
|
<if test="yxsType!=null and yxsType!=''">
|
|
AND tcmc.is_check=#{yxsType}
|
|
</if>
|
|
<if test="xsUser!=null and xsUser!=''">
|
|
AND (su.user_name=#{xsUser} or tub.scheduling_name=#{xsUser} )
|
|
</if>
|
|
<if test="isSup == 2">
|
|
AND tcmc.check_user = #{currentUserId}
|
|
</if>
|
|
-- 一本账工程编码
|
|
<if test="proId!=null and proId!=''" >
|
|
AND jcm.single_project_name=#{proId}
|
|
</if>
|
|
-- 标段工程编码
|
|
<if test="bidNo!=null and bidNo!=''" >
|
|
AND jcm.bidding_section_code=#{bidNo}
|
|
</if>
|
|
<if test="isSup == 3">
|
|
AND jcm.build_unit_code = #{currentUserOrgId}
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 1">
|
|
AND INSTR(IFNULL(tub.scheduling_name,su.user_name),#{inspector}) > 0
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 2">
|
|
AND INSTR('值班员',#{inspector}) > 0
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 3">
|
|
AND INSTR('建设部安全管控',#{inspector}) > 0
|
|
</if>
|
|
<if test="evaluationStatus!=null and evaluationStatus!=''">
|
|
AND tcmc.is_pj = #{evaluationStatus}
|
|
</if>
|
|
<if test="buildCode!=null and buildCode!=''">
|
|
AND so.org_id IN (
|
|
<foreach collection="buildCodeList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="riskLevel!=null and riskLevel!=''">
|
|
AND jcm.re_assessment_risk_level IN (
|
|
<foreach collection="riskLevelList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="proStatus!=null and proStatus!=''">
|
|
AND jcm.current_construction_status IN (
|
|
<foreach collection="proStatusList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="constrUnifiedSocialCreditId!=null and constrUnifiedSocialCreditId!=''">
|
|
AND jcm.constr_unified_social_credit_id IN (
|
|
<foreach collection="constrUnifiedSocialCreditList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="sgdw!=null and sgdw!=''">
|
|
AND ju.unit_name IN (
|
|
<foreach collection="sgdwList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
<if test="hfSgdw!=null and hfSgdw!=''">
|
|
OR ju.unit_name LIKE concat('%', #{hfSgdw}, '%')
|
|
</if>
|
|
</if>
|
|
<if test="keyWord!=null and keyWord!=''">
|
|
AND (
|
|
INSTR(tub.scheduling_name,#{keyWord}) > 0 OR
|
|
INSTR(su.user_name,#{keyWord}) > 0 OR
|
|
INSTR(jcm.bidding_section_code,#{keyWord}) > 0 OR
|
|
INSTR(tcmw.warn_type,#{keyWord}) > 0 OR
|
|
INSTR(jcm.current_constr_date,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.team_name,#{keyWord}) > 0 OR
|
|
INSTR(jcm.bidding_section_name,#{keyWord}) > 0 OR
|
|
INSTR(td.td_code,#{keyWord}) > 0 OR
|
|
INSTR(jcm.ticket_no,#{keyWord}) > 0 OR
|
|
INSTR(jcm.re_assessment_risk_level,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_content,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_manage_phone,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_gx,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_type,#{keyWord}) > 0 OR
|
|
INSTR(so.city_name,#{keyWord}) > 0 OR
|
|
INSTR(td.puid,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_manage,#{keyWord}) > 0 OR
|
|
INSTR( ju.unit_name,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_manage,#{keyWord}) > 0 OR
|
|
INSTR(jcm.supervision_unit_name,#{keyWord}) > 0 OR
|
|
INSTR(IFNULL(tub.scheduling_name,su.user_name),#{keyWord}) > 0 OR
|
|
INSTR(tcmw.warn_type,#{keyWord}) > 0
|
|
)
|
|
</if>
|
|
<if test="bidName!=null and bidName!=''">
|
|
AND jcm.bidding_section_code IN (
|
|
<foreach collection="bidNameList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="foreman!=null and foreman!=''">
|
|
AND INSTR(jcmp.real_name,#{foreman}) > 0
|
|
</if>
|
|
<if test="ballStatus!=null and ballStatus!=''">
|
|
AND td.state = #{ballStatus}
|
|
</if>
|
|
ORDER BY totalCount DESC
|
|
<if test="isSortByTime==null">
|
|
, tcmw.num DESC
|
|
</if>
|
|
|
|
</select>
|
|
<select id="getDictSelected" resultType="java.util.Map">
|
|
select sd2.code as code,sd2.id as id,sd2.name as name
|
|
from sys_dist sd
|
|
left join sys_dist sd2 on sd.id=sd2.p_id and sd2.is_flag='0'
|
|
where sd.p_id=0 and sd.code=#{code} and sd.is_flag=0
|
|
</select>
|
|
<select id="getCollectiveEnterpriseByUnitId" resultType="java.lang.String">
|
|
select ANY_VALUE(GROUP_CONCAT(ju.unified_social_credit_id)) AS unifiedSocialCreditIds
|
|
from jj_enterprise_unit jeu
|
|
LEFT JOIN jj_unit ju on ju.id = jeu.unit_id
|
|
where jeu.enterprise_id = #{id}
|
|
GROUP BY
|
|
jeu.enterprise_id;
|
|
</select>
|
|
<select id="getSgdwList" resultType="com.sercurityControl.proteam.export.vo.JjUnit">
|
|
select id ,unit_name
|
|
from jj_unit ju
|
|
where CONCAT(',', ju.unit_type, ',') LIKE '%,6,%'
|
|
and delete_flag=0
|
|
</select>
|
|
<select id="getSgdwNum" resultType="java.util.Map">
|
|
SELECT ANY_VALUE(zbh.constr_unified_social_credit_id) as org,ANY_VALUE(COUNT(zbh.constr_unified_social_credit_id)) AS num,ANY_VALUE(ju.id) as id
|
|
FROM jj_class_meetting zbh
|
|
left join jj_class_metting_info jcmi on jcmi.class_id=zbh.id
|
|
LEFT JOIN t_class_metting_check tcmc ON tcmc.class_id = zbh.id AND tcmc.create_time BETWEEN #{startTime} AND #{endTime}
|
|
LEFT JOIN t_class_metting_warn tcmw ON zbh.id = tcmw.class_id AND tcmw.update_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
|
LEFT JOIN sys_user su ON tcmc.check_user = su.id
|
|
LEFT JOIN tb_user_banding tub ON tcmc.check_user = tub.login_user_id AND tub.banding_date = tcmc.create_time AND tub.banding_date BETWEEN #{startTime} AND #{endTime} AND tub.is_flag = '0'
|
|
LEFT JOIN sys_org so ON zbh.build_unit_code = so.org_id
|
|
left join jj_ball jbl on jbl.id=zbh.camera_id AND jbl.delete_flag = '0'
|
|
LEFT JOIN t_device td ON td.t_code = jbl.camera_no AND td.is_flag = '0'
|
|
LEFT JOIN jj_unit ju ON ju.unified_social_credit_id = zbh.constr_unified_social_credit_id AND td.is_flag = '0'
|
|
WHERE zbh.current_constr_date BETWEEN #{startTime} AND #{endTime} AND zbh.delete_flag = '0'
|
|
and zbh.constr_unified_social_credit_id is not null
|
|
<if test="isSup == 1">
|
|
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
|
|
</if>
|
|
<if test="yxsType!=null and yxsType!=''">
|
|
AND tcmc.is_check=#{yxsType}
|
|
</if>
|
|
<if test="xsUser!=null and xsUser!=''">
|
|
AND (su.user_name=#{xsUser} or tub.scheduling_name=#{xsUser} )
|
|
</if>
|
|
<if test="isSup == 2">
|
|
AND tcmc.check_user = #{currentUserId}
|
|
</if>
|
|
<if test="isSup == 3">
|
|
AND zbh.build_unit_code = #{currentUserOrgId}
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 1">
|
|
AND INSTR(IFNULL(tub.scheduling_name,su.user_name),#{inspector}) > 0
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 2">
|
|
AND INSTR('值班员',#{inspector}) > 0
|
|
</if>
|
|
<if test="inspector!=null and inspector!='' and isSup == 3">
|
|
AND INSTR('建设部安全管控',#{inspector}) > 0
|
|
</if>
|
|
<if test="evaluationStatus!=null and evaluationStatus!=''">
|
|
AND tcmc.is_pj = #{evaluationStatus}
|
|
</if>
|
|
<if test="riskLevel!=null and riskLevel!=''">
|
|
AND zbh.re_assessment_risk_level IN (
|
|
<foreach collection="riskLevelList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="proStatus!=null and proStatus!=''">
|
|
AND zbh.current_construction_status IN (
|
|
<foreach collection="proStatusList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="keyWord!=null and keyWord!=''">
|
|
AND (
|
|
INSTR(zbh.bidding_section_name,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_manage,#{keyWord}) > 0 OR
|
|
INSTR(IFNULL(tub.scheduling_name,su.user_name),#{keyWord}) > 0 OR
|
|
INSTR(tcmw.warn_type,#{keyWord}) > 0
|
|
)
|
|
</if>
|
|
<if test="bidName!=null and bidName!=''">
|
|
AND zbh.bidding_section_code IN (
|
|
<foreach collection="bidNameList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="foreman!=null and foreman!=''">
|
|
AND INSTR(jcmi.work_manage,#{foreman}) > 0
|
|
</if>
|
|
<if test="ballStatus!=null and ballStatus!=''">
|
|
AND td.state = #{ballStatus}
|
|
</if>
|
|
GROUP BY zbh.constr_unified_social_credit_id
|
|
ORDER BY num DESC
|
|
</select>
|
|
<select id="dutyStatistics" resultType="com.sercurityControl.proteam.dutyTask.domain.DutyStatisticsVo">
|
|
select ANY_VALUE(tub.scheduling_name) AS userName,ANY_VALUE(COUNT(tub.id)) as attendanceDays,
|
|
ANY_VALUE(tub.login_user_id) AS loginUserId
|
|
from tb_user_banding tub
|
|
LEFT JOIN sys_user su on su.id= tub.login_user_id
|
|
LEFT JOIN sys_role sr on su.role_id = sr.id
|
|
WHERE tub.banding_date BETWEEN #{startTime} AND #{endTime} AND role_code = 'dcry-001'
|
|
<if test="userName!=null and userName!=''">
|
|
AND tub.scheduling_name = #{userName}
|
|
</if>
|
|
GROUP BY tub.scheduling_name
|
|
|
|
</select>
|
|
<select id="getUserBandingList" resultType="com.sercurityControl.proteam.dutyTask.domain.UserBandingVo">
|
|
SELECT
|
|
id,
|
|
login_user_id AS loginUserId,
|
|
login_name AS loginName,
|
|
scheduling_name AS schedulingName,
|
|
banding_date AS bandingDate
|
|
FROM tb_user_banding tub
|
|
WHERE tub.banding_date BETWEEN #{startTime} AND #{endTime}
|
|
<if test="userName!=null and userName!=''">
|
|
AND tub.scheduling_name = #{userName}
|
|
</if>
|
|
</select>
|
|
<select id="getNum" resultType="com.sercurityControl.proteam.dutyTask.domain.DutyStatisticsVo">
|
|
SELECT COUNT(tcmc.check_user) AS totalAllocation ,SUM(CASE WHEN tcmc.is_check = '1' THEN 1 ELSE 0 END) AS inspectionNumber,
|
|
COALESCE(tnv.voiNum, 0) AS voiNum,jwi.warningQuantity as warningQuantity,
|
|
jwi.warningProcessingQuantity as warningProcessingQuantity
|
|
FROM sys_user su
|
|
LEFT JOIN sys_role sr on su.role_id = sr.id
|
|
LEFT JOIN t_class_metting_check tcmc on tcmc.check_user = su.id
|
|
LEFT JOIN (SELECT ANY_VALUE(su.id) as id, ANY_VALUE(COUNT(tnv.iss_user)) as voiNum FROM sys_user su
|
|
LEFT JOIN t_notice_voi tnv on su.id = tnv.iss_user
|
|
WHERE DATE(tnv.iss_time) = #{startTime} and su.id=#{loginUserId}
|
|
GROUP BY su.id)tnv on tnv.id = su.id
|
|
LEFT JOIN (SELECT ANY_VALUE(su.id) as id, ANY_VALUE(COUNT(jwi.user_id)) as warningQuantity ,
|
|
SUM(CASE WHEN jwi.handle = '1' THEN 1 ELSE 0 END) AS warningProcessingQuantity
|
|
FROM sys_user su LEFT JOIN jj_warn_info jwi on su.id = jwi.user_id
|
|
LEFT JOIN jj_data_code jdc on jdc.code_value = jwi.vlotage_level
|
|
WHERE jwi.warn_day BETWEEN #{startTime} AND #{endTime} and jdc.remarks = 'jsb' and su.id=#{loginUserId}
|
|
GROUP BY su.id)jwi on jwi.id = su.id
|
|
WHERE tcmc.create_time BETWEEN #{startTime} AND #{endTime} AND role_code = 'dcry-001'
|
|
and su.id= #{loginUserId}
|
|
</select>
|
|
<select id="getUnitNameList" resultType="java.lang.String">
|
|
SELECT ju.unit_name
|
|
FROM jj_enterprise_unit jeu
|
|
LEFT JOIN jj_unit ju on ju.id = jeu.unit_id
|
|
where 1=1
|
|
AND jeu.enterprise_id IN (
|
|
<foreach collection="bidNameList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</select>
|
|
<select id="getWarnPageList" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
|
|
select jwi.key_id id, jwi.warn_day warnDay, jwi.type, jwi.warn_type warnType, jwi.work_content content,
|
|
jwi.work_team teamName , jwi.ticket_no ticketNo , jwi.team_leader fzrName,
|
|
jwi.work_num workNum, jwi.t_class_id classId,so.city_name cityName,
|
|
jwi.y_class_id , jwi.t_gx tgx, jwi.y_gx ygx,jwi. add_gx, jwi.del_gx,jwi.t_work_num, jwi.y_work_num , jwi.team_id_car , jwi.user_id
|
|
,jwi.puid , jwi.org_id , jwi.sing_pro_code , jwi.sing_pro_name proName, jwi.start_time , end_time , jwi.handle_user
|
|
, jwi.handle_time handleTime, jwi.handle , jwi.remark handelRemark , jwi.is_fh isHl , jwi.risk_level riskLevel,
|
|
su.login_name userName,su2.login_name handleUser,
|
|
jwi.audit_status auditStatus, jwi.audit_user auditUser, jwi.audit_time auditTime, jwi.is_org isOrg,
|
|
jwi.audit_remark auditRemark,
|
|
jwi.open_html openTime,
|
|
jwi.wzx_reason reason,
|
|
#{schedulingName} schedulingName
|
|
from jj_warn_info jwi
|
|
left join sys_user su on jwi.user_id=su.id
|
|
left join sys_org so on so.org_id=jwi.org_id
|
|
left join sys_user su2 on jwi.handle_user=su2.id
|
|
LEFT JOIN jj_data_code jdc on jdc.code_value = jwi.vlotage_level
|
|
where 1=1 and jdc.remarks = 'jsb'
|
|
and jwi.warn_day BETWEEN #{startTime} AND #{ednTime}
|
|
<if test="createBy!=null and createBy!=''">
|
|
and jwi.user_id=#{createBy}
|
|
</if>
|
|
<if test="orgList!=null and orgList!=''">
|
|
AND jwi.org_id IN (
|
|
<foreach collection="orgList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="handle!=null and handle!=''">
|
|
and jwi.handle=#{handle}
|
|
</if>
|
|
<if test="keyWord!=null and keyWord!=''">
|
|
and (
|
|
su.login_name like concat('%',#{keyWord},'%') or
|
|
jwi.warn_type like concat('%',#{keyWord},'%') or
|
|
so.city_name like concat('%',#{keyWord},'%') or
|
|
jwi.sing_pro_name like concat('%',#{keyWord},'%')
|
|
)
|
|
</if>
|
|
ORDER BY jwi.handle asc
|
|
</select>
|
|
|
|
</mapper>
|