656 lines
33 KiB
XML
656 lines
33 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>
|
|
<!--更新是否重点关注班组-->
|
|
<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 jj_class_meetting jcm
|
|
left join jj_ball jbl on jcm.camera_id2=jbl.id
|
|
left join t_device td on td.t_code=jbl.camera_no and td.is_flag=0
|
|
left join t_device_updown dev on dev.puid=td.puid
|
|
<where>
|
|
<if test="classId!=null and classId!=''">
|
|
and jcm.id=#{classId}
|
|
</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,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
|
|
</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 ticket.team_id teamId,jp.id_card idNumber
|
|
from jj_class_meetting jcm
|
|
left join jj_ticket ticket on ticket.id=jcm.ticket_id
|
|
left join jj_team team on team.id=ticket.team_id
|
|
left join jj_team_people jp on jp.team_id=team.id and jp.position_code='0900101'
|
|
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,
|
|
tcmw.warn_type AS earlyWarningStatus,
|
|
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.current_constr_headcount,
|
|
jcm.construction_headcount,
|
|
jcm.change_time,-- 状态变更时间(如果暂停,则就是暂停时间)
|
|
jt.team_id teamId,
|
|
jcmp.id_card idNumber,
|
|
jcmp.real_name foreman,
|
|
IFNULL( jju.mobile,'') foremanPhone ,
|
|
jt.working_team_name teamName,
|
|
so.city_name buildCode,
|
|
jcmi.work_site workSite , -- 作业部位
|
|
jcmi.work_content content, -- 作业内容
|
|
jcmi.work_gx workGx, -- 工序
|
|
jcmi.work_type workType, -- 作业类型
|
|
ju.unit_name sgdw, -- 施工单位
|
|
td.puid,jcmi.main_risk mainRisk,
|
|
jcm.risk_precaution_id riskId, -- 风险一本账id
|
|
td.mac_id macId,
|
|
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 jj_ticket jt on jcm.ticket_id=jt.id -- 作业票
|
|
left join jj_class_meeting_people jcmp on jcmp.tool_box_talk_id=jcm.id and jcmp.position_code='0900101' AND jcmp.position_flag='1' and jcmp.delete_flag=0 -- 班组负责人
|
|
left join jj_user jju on jju.id=jcmp.personnel_id AND jju.delete_flag=0 -- 准入人员
|
|
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 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="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( jcmp.real_name,#{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>
|
|
|
|
<if test="isSortByTime==null">
|
|
ORDER BY 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.mc_work_site_id,
|
|
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.voltage_level ,
|
|
jcm.huv_flag ,
|
|
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.current_constr_headcount,
|
|
jcm.construction_headcount,
|
|
jcm.change_time,-- 状态变更时间(如果暂停,则就是暂停时间)
|
|
jtp.mobile workManagePhone,
|
|
jt.team_id teamId,
|
|
jcmp.id_card idNumber,
|
|
jcmp.real_name workManager,
|
|
jcmp2.id_card,jcmp2.real_name,jt.working_team_name teamName,
|
|
so.city_name buildCode,
|
|
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, -- 统一编码
|
|
ju.unit_name sgdw, -- 施工单位
|
|
jcm.supervision_unit_name jldw -- 监理单位
|
|
from jj_class_meetting jcm
|
|
LEFT JOIN jj_ticket jt on jcm.ticket_id=jt.id -- 作业票
|
|
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 -- 联系人电话
|
|
left join jj_class_meeting_people jcmp2 on jcmp2.tool_box_talk_id=jcm.id and jcmp2.position_code='0900102' -- 班组安全员
|
|
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.unit_type=6 -- 施工单位
|
|
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
|
|
WHERE jcm.delete_flag=0 and 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 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="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_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=#{classId} AND delete_flag=0
|
|
AND file_type IN('1','2','3','01','02','03')
|
|
</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>
|
|
</mapper> |