jl-jjsp-service/securityControl-modules/securityControl-proteam/target/classes/mapper/EarlyMapper.xml

1174 lines
56 KiB
XML
Raw Permalink Normal View History

2025-09-24 11:10:04 +08:00
<?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.mapper.EarlyMapper">
<insert id="updateFzrData" parameterType="com.sercurityControl.proteam.domain.EarlyEntity">
insert into
t_team_people_bj (
<if test="fzrNum!=null and fzrNum!=''">
FZR_NUM
</if>
<if test='isHl!="" and isHl!=null'>
,IS_HL
</if>
<if test='time!="" and time!=null'>
,UPDATE_TIME
</if>
<if test='type!="" and type!=null'>
,type
</if>) values (
<if test="fzrNum!=null and fzrNum!=''">
#{fzrNum}
</if>
<if test='isHl!="" and isHl!=null'>
,#{isHl}
</if>
<if test='time!="" and time!=null'>
,#{time}
</if>
<if test='type!="" and type!=null'>
,#{type}
</if>
)
</insert>
<insert id="addUserHandel" parameterType="com.sercurityControl.proteam.domain.vo.UserHandleVo">
replace into t_user_handle (
id,fzr_num,is_hl,update_time,type,remark, user,state
<if test="createTime!=null and createTime!=''">
,create_time
</if>
)values (#{id},#{fzrNum},#{isHl},#{updateTime},#{type},#{remark},#{user},#{state}
<if test="createTime!=null and createTime!=''">
,#{createTime}
</if>
)
</insert>
<insert id="insertWarnIgnore">
replace into jj_warn_ignore(
key_id, `ignore`, type, warn_type, create_time
)values (#{keyId},'1',#{type},#{warnType},now())
</insert>
<update id="updateHandel">
update jj_warn_info set
is_fh=#{state},remark=#{remark},handle=1,
handle_time=now(),handle_user=#{user}
<if test="isOrg!=null and isOrg!=''">
, is_org=#{isOrg}
</if>
<if test="openTime!=null and openTime!=''">
, open_html=#{openTime}
</if>
<if test="reason!=null and reason!=''">
, wzx_reason=#{reason}
</if>
<if test="auditStatus!=null and auditStatus!=''">
, audit_status=#{auditStatus}
, audit_user=#{auditUser}
, audit_time=#{audiTime}
, audit_remark=#{auditRemark}
</if>
where key_id=#{id}
</update>
<update id="updateHandelAuditStatus">
update jj_warn_info set audit_status=null
where key_id=#{id}
</update>
<delete id="deleteWarnIgnore">
delete from jj_warn_ignore where key_id=#{keyId} and type=#{type}
</delete>
<delete id="delWarnInfo">
delete from jj_warn_info
where key_id IN(
<foreach collection="list" item="item" separator=",">
#{item}
</foreach>
)
</delete>
<select id="getHandelNum" resultType="com.sercurityControl.proteam.domain.vo.UserHandleVo" parameterType="com.sercurityControl.proteam.domain.vo.UserHandleVo">
select key_id id, warn_day,
type, warn_type warnType, work_content,
work_team, ticket_id,
ticket_no, team_leader , team_phone,
work_num, t_class_id classId, y_class_id,
t_gx, y_gx, add_gx, del_gx, t_work_num, y_work_num,
team_id_car idCard, user_id, puid, org_id orgId,sing_pro_code, sing_pro_name,
start_time, end_time, handle_user handleUser, handle_time,
handle , risk_level,is_org isOrg,audit_status auditStatus
from jj_warn_info
where key_id=#{id}
</select>
<!--当日未施工-->
<select id="getNoWorkByDayNum" resultType="java.lang.Integer">
select count(1)
from jj_ticket jtt
LEFT JOIN jj_class_metting_info jcmi on jcmi.team_id=jtt.team_id and jcmi.work_day=CURRENT_DATE()
left join jj_class_meetting jcm on jcm.id=jcmi.class_id and jcm.current_constr_date=CURRENT_DATE() AND jcm.delete_flag=0
left join sys_org so on so.org_id=jtt.build_unit_code
where jtt.ticket_status='05' AND jtt.delete_flag=0
and jcm.id is null and DATE_FORMAT(curdate(), '%Y-%m-%d') BETWEEN jtt.planned_start_date and jtt.planned_end_date
<if test="isSup == 3">
AND jtt.build_unit_code = #{currentUserOrgId}
</if>
</select>
<!--当日未施工列表-->
<select id="getNoWorkByDay" resultType="com.sercurityControl.proteam.domain.EarlyEntity"
parameterType="com.sercurityControl.proteam.domain.EarlyEntity">
select jtt.working_team_name teamName,jtt.single_project_name proName,jtt.build_unit_code orgId,
jtt.bidding_section_code bidCode ,
jtt.id ,so.abb_name org ,jtt.ticket_status,jtp.real_name fzrName,jtp.mobile phone,jcm.id classId ,'1' AS type,
jtt.ticket_no ticketNo,jtt.planned_start_date planStartTime,jtt.planned_end_date planEndTime,
jtp.id_card fzrNum
from jj_ticket jtt
LEFT JOIN jj_class_metting_info jcmi on jcmi.team_id=jtt.team_id and jcmi.work_day=CURRENT_DATE()
left join jj_class_meetting jcm on jcm.id=jcmi.class_id and jcm.current_constr_date=CURRENT_DATE() AND jcm.delete_flag=0
left join sys_org so on so.org_id=jtt.build_unit_code
left join jj_ticket_people jtp on jtp.ticket_id=jtt.id and jtp.position_code='0900101' and jtp.position_flag='1'
where jtt.ticket_status='05' AND jtt.delete_flag=0
and jcm.id is null and DATE_FORMAT(curdate(),'%Y-%m-%d') BETWEEN jtt.planned_start_date and jtt.planned_end_date
<if test="org!= null and org!= ''">
AND so.org_id IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="fzrName!= null and fzrName!= ''">
AND jtp.real_name LIKE CONCAT('%',#{fzrName},'%')
</if>
<if test="proName!= null and proName!= ''">
AND jtt.single_project_name LIKE CONCAT('%',#{proName},'%')
</if>
</select>
<!--新进班组-->
<select id="getNewTeamNum" resultType="java.lang.Integer">
select count(1)
from jj_team jtm
where DATE_FORMAT(jtm.create_time,'%Y-%m-%d')=CURRENT_DATE() AND jtm.team_status='01'
and jtm.delete_flag=0
<if test="isSup == 3">
AND jtm.build_unit_code = #{currentUserOrgId}
</if>
</select>
<!--新进班组列表集合-->
<select id="getNewTeam" resultType="com.sercurityControl.proteam.domain.EarlyEntity"
parameterType="com.sercurityControl.proteam.domain.EarlyEntity">
select jtm.id ,constr_unit_id,jtm.build_unit_code,working_team_name teamName,so.city_name org ,
working_team_attribute,IFNULL(jbp.BIDDING_SECTION_NAME,'') proName,IFNULL(jtp.real_name,'') fzrName,
ifnull(jur.mobile,'') phone,jtp.id_card fzrNum,
jtm.working_team_type,DATE_FORMAT(jtm.create_time,'%Y-%m-%d') createDay,
'2' AS type, IFNULL(tpb.is_hl,'') AS isHl,ju.unit_name sgdw
from jj_team jtm
left join jj_team_people jtp on jtp.team_id=jtm.id and jtp.position_code='0900101'
LEFT JOIN jj_user jur on jur.id=jtp.personnel_id
left join jj_unit ju on ju.unified_social_credit_id=jtm.constr_unit_id
left join sys_org so on so.org_id=jtm.build_unit_code
LEFT JOIN t_team_people_bj tpb ON tpb.fzr_num = jtm.id AND tpb.type='1' and DATE_FORMAT( tpb.update_time,
'%Y-%m-%d' ) = DATE_FORMAT( curdate(), '%Y-%m-%d' )
left join jj_bidding_project jbp on jbp.bidding_section_code=jtm.bidding_section_code
where DATE_FORMAT(jtm.create_time,'%Y-%m-%d')=CURRENT_DATE() AND jtm.team_status='01'
and jtm.delete_flag=0
<if test="org != null and org != ''">
AND so.org_id IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="fzrName!= null and fzrName!= ''">
AND jtp.real_name LIKE CONCAT('%',#{fzrName},'%')
</if>
<if test="proName!= null and proName != ''">
AND jbp.BIDDING_SECTION_NAME LIKE CONCAT('%',#{proName},'%')
</if>
</select>
<!--七日未施工班组-->
<select id="getNoWorkBySevenNum" resultType="java.lang.Integer">
select COUNT(1)
FROM jj_team jtm
left join jj_ticket jtt on jtt.team_id=jtm.id and jtt.delete_flag=0
left join jj_class_meetting jcm on jcm.ticket_id=jtt.id
and jcm.delete_flag=0 and jcm.current_constr_date>=(CURDATE() - INTERVAL 6 DAY)
WHERE jcm.id is null and jtm.delete_flag=0 and jtm.team_status='01'
and DATE_FORMAT(jtm.create_time, '%Y-%m-%d') BETWEEN (CURDATE() - INTERVAL 7 DAY) and CURDATE()
<if test="isSup == 3">
AND jtm.build_unit_code = #{currentUserOrgId}
</if>
</select>
<!--七日未施工列表-->
<select id="getNoWorkBySeven" resultType="com.sercurityControl.proteam.domain.EarlyEntity"
parameterType="com.sercurityControl.proteam.domain.EarlyEntity">
select DISTINCT jtm.id ,jtm.working_team_name teamName,jtm.build_unit_code,jtp.id_card fzrNum,
IFNULL(jtp.real_name,'') fzrName,IFNULL(ju.mobile,'') phone,
IFNULL(jbp.BIDDING_SECTION_NAME,'') proName,'3' AS type ,so.city_name org,jtm.create_time createDay,
jtt.assessment_risk_level riskLevel
FROM jj_team jtm
left join sys_org so on so.org_id=jtm.build_unit_code
left join jj_bidding_project jbp on jbp.bidding_section_code=jtm.bidding_section_code
left join jj_team_people jtp on jtp.team_id=jtm.id and jtp.position_code='0900101'
LEFT JOIN jj_user ju on ju.id=jtp.personnel_id
left join jj_ticket jtt on jtt.team_id=jtm.id and jtt.delete_flag=0
LEFT JOIN t_team_people_bj tpb ON tpb.fzr_num = jtm.id AND tpb.type='2' and DATE_FORMAT(tpb.update_time,
'%Y-%m-%d' ) = DATE_FORMAT(curdate(), '%Y-%m-%d' )
left join jj_class_meetting jcm on jcm.ticket_id=jtt.id
and jcm.delete_flag=0 and jcm.current_constr_date>=(CURDATE() - INTERVAL 6 DAY)
WHERE jcm.id is null and jtm.delete_flag=0 and jtm.team_status='01'
and DATE_FORMAT(jtm.create_time, '%Y-%m-%d') BETWEEN (CURDATE() - INTERVAL 7 DAY) and CURDATE()
<if test="isSup == 3">
AND jtm.build_unit_code = #{currentUserOrgId}
</if>
<if test="org != null and org != ''">
AND jtm.build_unit_code IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="fzrName != null and fzrName != ''">
AND jtp.real_name LIKE CONCAT('%',concat(#{fzrName}),'%')
</if>
<if test="proName != null and proName != ''">
AND jbp.BIDDING_SECTION_NAME LIKE CONCAT('%',concat(#{proName}),'%')
</if>
</select>
<!--重点关注班组-->
<select id="getFocusWorkNum" resultType="java.lang.Integer">
select COUNT(1)
from jj_team jtm
left join jj_team_info jtmi on jtm.id=jtmi.team_id
left join jj_class_metting_info jcmi on jcmi.team_id=jtm.id
left join jj_class_meetting jcm on jcm.id=jcmi.class_id
LEFT JOIN t_class_metting_check tcmc ON jcm.id = tcmc.class_id
where jtmi.import_team='1' and jcm.current_constr_date=CURRENT_DATE()
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 2">
AND tcmc.check_user = #{currentUserId}
</if>
<if test="isSup == 3">
AND jtm.build_unit_code = #{currentUserOrgId}
</if>
</select>
<!--重点关注班组集合-->
<select id="getFocusWork" resultType="com.sercurityControl.proteam.domain.EarlyEntity"
parameterType="com.sercurityControl.proteam.domain.EarlyEntity">
select jtm.working_team_name teamName,jcm.id classId, jtm.build_unit_code,so.city_name org,jcmi.work_content content ,jtm.bidding_section_code bidCode
,jcmi.work_manage fzrName,jcmi.work_manage_phone phone,jcmi.work_manage_num fzrNum,jcm.bidding_section_name proName,
jtm.id ,'6' AS type, IFNULL(tpb.is_hl,'') AS isHl,jtm.id teamId,
jcm.work_start_time startTime,jcm.current_constr_headcount userNum,
CASE jcm.current_construction_status WHEN '01' THEN '开工'
WHEN '02' THEN '暂停'
WHEN '03' THEN '完工'
END AS state,
IFNULL(jcm.re_assessment_risk_level,'') AS riskLevel
from jj_team jtm
left join jj_team_info jtmi on jtm.id=jtmi.team_id
left join jj_class_metting_info jcmi on jcmi.team_id=jtm.id
left join jj_class_meetting jcm on jcm.id=jcmi.class_id
left join sys_org so on so.org_id=jtm.build_unit_code
LEFT JOIN t_class_metting_check tcmc ON jcm.id = tcmc.class_id
LEFT JOIN t_team_people_bj tpb ON tpb.fzr_num = jtm.id AND tpb.type='5' and DATE_FORMAT(tpb.update_time,
'%Y-%m-%d') = DATE_FORMAT( curdate(), '%Y-%m-%d' )
where jtmi.import_team='1' and jcm.current_constr_date=CURRENT_DATE()
<if test="isSup == 2">
AND tcmc.check_user = #{currentUserId}
</if>
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 3">
AND jtm.build_unit_code = #{currentUserOrgId}
</if>
<if test="org != null and org != ''">
AND so.org_id IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="fzrName != null and fzrName != ''">
AND jcmi.work_manage LIKE CONCAT('%',#{fzrName},'%')
</if>
<if test="proName != null and proName != ''">
AND jcm.bidding_section_name LIKE CONCAT('%',concat(#{proName}),'%')
</if>
</select>
<!--工序变化-->
<select id="getTeamByWorkNum" resultType="java.lang.Integer">
SELECT count(1)
FROM jj_class_meetting jcm
LEFT JOIN t_class_metting_check tcmc ON tcmc.class_id = jcm.id
left join sys_user su on tcmc.check_user=su.id
left join t_class_metting_warn cmw on cmw.class_id=jcm.id
WHERE cmw.warn_type like '%工序变化%' AND jcm.delete_flag=0
and jcm.current_constr_date=CURRENT_DATE()
<!--督查人员-->
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 2">
AND tcmc.check_user=#{currentUserId}
</if>
<if test="isSup == 3">
AND jcm.build_unit_code = #{currentUserOrgId}
</if>
</select>
<!--工序变化列表-->
<select id="getTeamByWork" resultType="com.sercurityControl.proteam.domain.EarlyEntity"
parameterType="com.sercurityControl.proteam.domain.EarlyEntity">
SELECT jcm.id classId,so.city_name org , jcm.bidding_section_code bidCode,
jcm.bidding_section_name proName,jcm.re_assessment_risk_level riskLevel,IFNULL(jcmi.work_manage,'') fzrName,
IFNULL(jcmi.work_manage_num,'') fzrNum,
jcmi.work_manage_phone phone,jcm.current_constr_headcount dNum,jcmi.work_content content,
'5' AS type,jcmi.team_id teamId,jcmi.team_name teamName,
IFNULL(cmw.t_gx,'') AS tgx,
IFNULL(cmw.y_gx,'') AS ygx,IFNULL(cmw.t_zylx ,'') AS tzylx, IFNULL(cmw.y_zylx ,'') AS yzylx,
IFNULL(tpb.is_hl,'') AS isHl,
IFNULL(jcm.re_assessment_risk_level,'') AS riskLevel,
tuh.id handleId, tuh.user,tuh.create_time handleTime,tuh.state handleState,tuh.remark handelRemark,
tub. scheduling_name userName,su.user_name handleUser
FROM jj_class_meetting jcm
LEFT JOIN t_class_metting_check tcmc ON tcmc.class_id = jcm.id
left join t_user_handle tuh on tuh.fzr_num=jcm.id and tuh.type='4'
left join tb_user_banding tub on tuh.user=tub.login_user_id and tub.banding_date=CURRENT_DATE()
left join sys_user su on tcmc.check_user=su.id
left join jj_class_metting_info jcmi ON jcmi.class_id=jcm.id
left join t_class_metting_warn cmw on cmw.class_id=jcm.id
left join sys_org so on so.org_id=jcm.build_unit_code
LEFT JOIN t_team_people_bj tpb ON tpb.fzr_num = jcm.id AND tpb.type='4' and DATE_FORMAT(
tpb.update_time, '%Y-%m-%d' ) = DATE_FORMAT( curdate(), '%Y-%m-%d' )
WHERE cmw.warn_type like '%工序变化%' AND jcm.delete_flag=0
<if test="times!=null and times!=''">
and jcm.current_constr_date BETWEEN #{startTime} AND #{endTime}
</if>
<if test="times==null or times==''">
and jcm.current_constr_date=CURRENT_DATE()
</if>
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 2">
AND tcmc.check_user = #{currentUserId}
</if>
<if test="isSup == 3">
AND jcm.build_unit_code = #{currentUserOrgId}
</if>
<if test="org != null and org != ''">
AND jcm.build_unit_code IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="riskLevel != null and riskLevel != ''">
AND jcm.re_assessment_risk_level IN (
<foreach collection="riskList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="fzrName != null and fzrName != ''">
AND jcmi.work_manage LIKE CONCAT('%',#{fzrName},'%')
</if>
<if test="proName != null and proName != ''">
AND jcm.bidding_section_name LIKE CONCAT('%',#{proName},'%')
</if>
</select>
<!--作业类型变化-->
<select id="getTeamByJobNum" resultType="java.lang.Integer">
SELECT count(1)
FROM jj_class_meetting jcm
LEFT JOIN t_class_metting_check tcmc ON tcmc.class_id = jcm.id
left join sys_user su on tcmc.check_user=su.id
left join t_class_metting_warn cmw on cmw.class_id=jcm.id
WHERE cmw.warn_type like '%作业类型变化%' AND jcm.delete_flag=0
and jcm.current_constr_date=CURRENT_DATE()
<!--督查人员-->
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 2">
AND tcmc.check_user=#{currentUserId}
</if>
<if test="isSup == 3">
AND jcm.build_unit_code = #{currentUserOrgId}
</if>
</select>
<!--作业类型变化-->
<select id="getTeamByJob" resultType="com.sercurityControl.proteam.domain.EarlyEntity"
parameterType="com.sercurityControl.proteam.domain.EarlyEntity">
SELECT jcm.id classId,so.city_name org , jcm.bidding_section_code bidCode,
jcm.bidding_section_name proName,jcm.re_assessment_risk_level riskLevel,
jcmi.work_manage_phone phone,jcm.current_constr_headcount dNum,jcmi.work_content content,
IFNULL(jcmi.work_manage,'') fzrName, IFNULL(jcmi.work_manage_num,'') fzrNum,
'6' AS type,jcmi.team_id teamId,jcmi.team_name teamName,
IFNULL(cmw.t_gx,'') AS tgx,
IFNULL(cmw.y_gx,'') AS ygx,IFNULL(cmw.t_zylx ,'') AS tzylx, IFNULL(cmw.y_zylx ,'') AS yzylx,
IFNULL(tpb.is_hl,'') AS isHl,
IFNULL(jcm.re_assessment_risk_level,'') AS riskLevel,
tuh.id handleId, tuh.user,tuh.create_time handleTime,tuh.state handleState,tuh.remark handelRemark,
tub. scheduling_name userName,su.user_name handleUser
FROM jj_class_meetting jcm
LEFT JOIN t_class_metting_check tcmc ON tcmc.class_id = jcm.id
left join t_user_handle tuh on tuh.fzr_num=jcm.id and tuh.type='5'
left join tb_user_banding tub on tuh.user=tub.login_user_id and tub.banding_date=CURRENT_DATE()
left join sys_user su on tcmc.check_user=su.id
left join jj_class_metting_info jcmi ON jcmi.class_id=jcm.id
left join t_class_metting_warn cmw on cmw.class_id=jcm.id
left join sys_org so on so.org_id=jcm.build_unit_code
LEFT JOIN t_team_people_bj tpb ON tpb.fzr_num = jcm.id AND tpb.type='8' and DATE_FORMAT(
tpb.update_time, '%Y-%m-%d' ) = DATE_FORMAT( curdate(), '%Y-%m-%d' )
WHERE cmw.warn_type like '%作业类型变化%' AND jcm.delete_flag=0
<if test="times!=null and times!=''">
and jcm.current_constr_date BETWEEN #{startTime} AND #{endTime}
</if>
<if test="times==null or times==''">
and jcm.current_constr_date=CURRENT_DATE()
</if>
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 2">
AND tcmc.check_user = #{currentUserId}
</if>
<if test="isSup == 3">
AND jcm.build_unit_code = #{currentUserOrgId}
</if>
<if test="org != null and org != ''">
AND jcm.build_unit_code IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="riskLevel != null and riskLevel != ''">
AND jcm.re_assessment_risk_level IN (
<foreach collection="riskList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="fzrName != null and fzrName != ''">
AND jcmi.work_manage LIKE CONCAT('%',#{fzrName},'%')
</if>
<if test="proName != null and proName != ''">
AND jcm.bidding_section_name LIKE CONCAT('%',#{proName},'%')
</if>
</select>
<!--球机异常-->
<select id="getBallByUnusualNum" resultType="java.lang.Integer">
select COUNT(1)
from jj_class_meetting jcm
left join t_user_handle tuh on tuh.fzr_num=jcm.id and tuh.type='7'
left join t_class_metting_check tcmc on tcmc.class_id=jcm.id
left join jj_ball jbl on jcm.camera_id2=jbl.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_ball jbl2 on jcm.camera_id3=jbl2.id and jbl2.delete_flag=0
left join t_device td2 on td2.t_code=jbl2.camera_no and td2.is_flag=0
where jcm.delete_flag=0 and ((jcm.current_construction_status in('01','1')
AND (td.state = '0' or jcm.camera_id2 IS NULL)
AND (td2.state = '0' or jcm.camera_id3 IS NULL)) or jcm.camera_id is null
) and jcm.current_constr_date=CURRENT_DATE() and tuh.id is null
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 2">
AND tcmc.check_user = #{currentUserId}
</if>
<if test="isSup == 3">
AND jcm.build_unit_code = #{currentUserOrgId}
</if>
</select>
<!--球机异常-->
<select id="getBallByUnusual" resultType="com.sercurityControl.proteam.domain.EarlyEntity"
parameterType="com.sercurityControl.proteam.domain.EarlyEntity">
select jcm.id classId, jcm.build_unit_code ,so.city_name org,jcm.bidding_section_code bidCode,jcm.bidding_section_name proName ,
IFNULL(jcmi.work_content,'') AS content,
IFNULL(jcmi.work_manage,'') AS fzrName,
IFNULL(jcmi.work_manage_phone,'') AS phone,
jcmi.team_name teamName,
IF((jcm.camera_id IS NULL ) , '未绑定球机',
CASE td.state
WHEN '1' THEN '在线' WHEN '0' THEN '不在线' ELSE '不在线' END) AS isOnline, '7' AS type,
IFNULL(jcm.re_assessment_risk_level,'') AS riskLevel,
jcm.work_start_time startTime,jcm.current_constr_headcount userNum,
tuh.id handleId, tuh.user,tuh.create_time handleTime,tuh.state handleState,tuh.remark handelRemark,
tub. scheduling_name userName,su.user_name handleUser
from jj_class_meetting jcm
left join t_user_handle tuh on tuh.fzr_num=jcm.id and tuh.type='7'
left join tb_user_banding tub on tuh.user=tub.login_user_id and tub.banding_date=CURRENT_DATE()
left JOIN sys_org so on so.org_id=jcm.build_unit_code
left join t_class_metting_check tcmc on tcmc.class_id=jcm.id
left join sys_user su on tcmc.check_user=su.id
left join jj_class_metting_info jcmi ON jcm.id=jcmi.class_id
left join jj_ball jbl on jcm.camera_id2=jbl.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_ball jbl2 on jcm.camera_id3=jbl2.id and jbl2.delete_flag=0
left join t_device td2 on td2.t_code=jbl2.camera_no and td2.is_flag=0
where jcm.delete_flag=0 and ((jcm.current_construction_status in('01','1')
AND (td.state = '0' or jcm.camera_id2 IS NULL)
AND (td2.state = '0' or jcm.camera_id3 IS NULL)) or jcm.camera_id is null
)
and tuh.id is null
<if test="times!=null and times!=''">
and jcm.current_constr_date BETWEEN #{startTime} AND #{endTime}
</if>
<if test="times==null or times==''">
and jcm.current_constr_date=CURRENT_DATE()
</if>
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 2">
AND tcmc.check_user = #{currentUserId}
</if>
<if test="isSup == 3">
AND jcm.build_unit_code = #{currentUserOrgId}
</if>
<if test="org != null and org != ''">
AND jcm.build_unit_code IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="riskLevel != null and riskLevel != ''">
AND jcm.re_assessment_risk_level IN (
<foreach collection="riskList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="fzrName != null and fzrName != ''">
AND jcmi.work_manage LIKE CONCAT('%',#{fzrName},'%')
</if>
<if test="proName != null and proName != ''">
AND jcm.bidding_section_name LIKE CONCAT('%',#{proName},'%')
</if>
</select>
<!--人数变化大-->
<select id="getTeamByPerNum" resultType="java.lang.Integer">
SELECT count(1)
FROM jj_class_meetting jcm
LEFT JOIN t_class_metting_check tcmc ON tcmc.class_id = jcm.id
left join sys_user su on tcmc.check_user=su.id
left join t_class_metting_warn cmw on cmw.class_id=jcm.id
WHERE cmw.warn_type like '%人数变化大%' AND jcm.delete_flag=0 AND jcm.current_constr_date=CURRENT_DATE()
<!--督查人员-->
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 2">
AND tcmc.check_user=#{currentUserId}
</if>
<if test="isSup == 3">
AND jcm.build_unit_code = #{currentUserOrgId}
</if>
</select>
<!--人数变化大 列表-->
<select id="getTeamByPer" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
SELECT jcm.id classId,so.city_name org , jcm.bidding_section_code bidCode,
jcm.bidding_section_name proName,jcm.re_assessment_risk_level riskLevel,
IFNULL(jcmi.work_manage,'') fzrName,
IFNULL(jcmi.work_manage_num,'') fzrNum,
jcmi.work_manage_phone phone,jcm.current_constr_headcount dNum,jcmi.work_content content,
'4' AS type,jcmi.team_id teamId,jcmi.team_name teamName,
IFNULL(tpb.is_hl,'') AS isHl,
IFNULL(jcm.re_assessment_risk_level,'') AS riskLevel,
tuh.id handleId, tuh.user,tuh.create_time handleTime,tuh.state handleState,tuh.remark handelRemark,
tub. scheduling_name userName,su.user_name handleUser
FROM jj_class_meetting jcm
LEFT JOIN t_class_metting_check tcmc ON tcmc.class_id = jcm.id
left join t_user_handle tuh on tuh.fzr_num=jcm.id and tuh.type='3'
left join tb_user_banding tub on tuh.user=tub.login_user_id and tub.banding_date=CURRENT_DATE()
left join sys_user su on tcmc.check_user=su.id
left join jj_class_metting_info jcmi ON jcmi.class_id=jcm.id
left join t_class_metting_warn cmw on cmw.class_id=jcm.id
left join sys_org so on so.org_id=jcm.build_unit_code
LEFT JOIN t_team_people_bj tpb ON tpb.fzr_num = jcm.id AND tpb.type='3' and DATE_FORMAT(
tpb.update_time, '%Y-%m-%d' ) = DATE_FORMAT( curdate(), '%Y-%m-%d' )
WHERE cmw.warn_type like '%人数变化大%' AND jcm.delete_flag=0
AND jcm.current_constr_date=CURRENT_DATE()
<if test="times!=null and times!=''">
and jcm.current_constr_date BETWEEN #{startTime} AND #{endTime}
</if>
<if test="times==null or times==''">
and jcm.current_constr_date=CURRENT_DATE()
</if>
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 2">
AND tcmc.check_user = #{currentUserId}
</if>
<if test="isSup == 3">
AND jcm.build_unit_code = #{currentUserOrgId}
</if>
<if test="org != null and org != ''">
AND so.org_id IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="riskLevel != null and riskLevel != ''">
AND jcm.re_assessment_risk_level IN (
<foreach collection="riskList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="fzrName != null and fzrName != ''">
AND jcmi.work_manage LIKE CONCAT('%',#{fzrName},'%')
</if>
<if test="proName != null and proName != ''">
AND jcm.bidding_section_name LIKE CONCAT('%',#{proName},'%')
</if>
</select>
<!--查询 昨日施工人数-->
<select id="getWorkTeamPeopleNum" resultType="java.util.Map">
select IFNULL(jcm.current_constr_headcount,0) num
FROM jj_class_meetting jcm
left join jj_class_metting_info jcmi ON jcm.id=jcmi.class_id
WHERE jcm.current_constr_date = (curdate() - INTERVAL 1 DAY)
and jcm.delete_flag=0 and jcmi.work_manage_num=#{workManagerNum}
order by jcm.work_start_time desc
limit 1
</select>
<!--球机信号-->
<select id="getBallSignal" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
select jcm.id classId, jcm.build_unit_code ,so.city_name cityName,jcm.bidding_section_code bidCode,jcm.bidding_section_name proName ,
IFNULL(jcmi.work_content,'') AS content,
IFNULL(jcmi.work_manage,'') AS fzrName,
IFNULL(jcmi.work_manage_phone,'') AS phone,
IF(jcm.camera_id IS NULL OR jcm.camera_id = '', '未绑定球机', CASE td.state
WHEN '1' THEN '在线' WHEN '0' THEN '不在线' ELSE '不在线' END) AS isOnline, '8' AS type,
IFNULL(jcm.re_assessment_risk_level,'') AS riskLevel,
tuh.id handleId, tuh.user,tuh.create_time handleTime,tuh.state handleState,tuh.remark handelRemark,
tub. scheduling_name userName,su.user_name handleUser
from jj_class_meetting jcm
left join t_user_handle tuh on tuh.fzr_num=jcm.id and tuh.type='8'
left join tb_user_banding tub on tuh.user=tub.login_user_id and tub.banding_date=CURRENT_DATE()
left JOIN sys_org so on so.org_id=jcm.build_unit_code
left join t_class_metting_check tcmc on tcmc.class_id=jcm.id
left join sys_user su on tcmc.check_user=su.id
left join jj_class_metting_info jcmi ON jcm.id=jcmi.class_id
left join jj_ball jbl on jcm.camera_id2=jbl.id and jbl.delete_flag=0
left join t_device td on td.t_code=jbl.camera_no and td.is_flag=0
where jcm.delete_flag=0 and jcm.current_construction_status in('01')
AND td.state = '1' AND (td.qj_xh IS NOT NULL OR
td.qj_xh !='') AND td.qj_xh &lt;= 30
<if test="times!=null and times!=''">
and jcm.current_constr_date BETWEEN #{startTime} AND #{endTime}
</if>
<if test="times==null or times==''">
and jcm.current_constr_date=CURRENT_DATE()
</if>
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<!--督查人员-->
<if test="isSup == 2">
AND tcmc.check_user=#{currentUserId}
</if>
<if test="isSup == 3">
AND jcm.build_unit_code = #{currentUserOrgId}
</if>
<if test="org != null and org != ''">
AND so.org_id IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="proName != null and proName != ''">
AND INSTR(jcm.bidding_section_name,#{proName}) > 0
</if>
<if test="fzrName != null and fzrName != ''">
AND INSTR(jcmi.work_manage,#{fzrName}) > 0
</if>
</select>
<select id="getTickeList" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
select jtt.working_team_name teamName,jtt.single_project_name proName,jtt.build_unit_code orgId,
jtt.bidding_section_code bidCode ,jtt.re_assessment_risk_level riskLevel,
jtt.id ,so.abb_name org ,jtt.ticket_status,jtp.real_name fzrName,jtp.mobile phone,jcm.id classId ,'9' AS type,
jtt.ticket_no ticketNo,jtt.planned_start_date planStartTime,jtt.planned_end_date planEndTime,
jtp.id_card fzrNum,jtt.team_id teamId,
tuh.id handleId,tuh.user,tuh.create_time handleTime,tuh.state handleState,tuh.remark handelRemark,
tub. scheduling_name userName,su.user_name handleUser
from jj_ticket jtt
LEFT JOIN jj_class_metting_info jcmi on jcmi.team_id=jtt.team_id and jcmi.work_day=CURRENT_DATE()
left join jj_class_meetting jcm on jcm.id=jcmi.class_id and jcm.current_constr_date=CURRENT_DATE() AND jcm.delete_flag=0
left join sys_org so on so.org_id=jtt.build_unit_code
left join jj_ticket_people jtp on jtp.ticket_id=jtt.id and jtp.position_code='0900101' and jtp.position_flag='1'
LEFT JOIN t_user_handle tuh on tuh.fzr_num=jtt.ticket_no and tuh.type='9'
LEFT join tb_user_banding tub on tuh.user=tub.login_user_id and tub.banding_date=CURRENT_DATE()
left join sys_user su on su.id=tuh.`user`
where jtt.ticket_status='05' AND jtt.delete_flag=0 and DATE_FORMAT(curdate(), '%Y-%m-%d') BETWEEN jtt.planned_start_date and jtt.planned_end_date
and jcm.id is null
<if test='type=="1"'>
order by jtt.bidding_section_code ASC
</if>
<if test='type=="2"'>
order by jtt.ticket_no ASC
</if>
<if test='type=="3"'>
order by jtt.single_project_name ASC
</if>
<if test='type=="4"'>
order by jtp.real_name ASC
</if>
<if test='type=="5"'>
order by jtt.re_assessment_risk_level ASC
</if>
<if test='type=="6"'>
order by jtt.build_unit_code desc
</if>
</select>
<!--球机信号弱-数量-->
<select id="getBallSignalNum" resultType="java.lang.Integer">
select COUNT(1)
from jj_class_meetting jcm
left join t_class_metting_check tcmc on tcmc.class_id=jcm.id
left join jj_ball jbl on jcm.camera_id2=jbl.id and jbl.delete_flag=0
left join t_device td on td.t_code=jbl.camera_no and td.is_flag=0
where jcm.delete_flag=0 and jcm.current_construction_status in('01')
AND td.state = '1' AND (td.qj_xh IS NOT NULL OR
td.qj_xh !='') AND td.qj_xh &lt;= 30 and jcm.current_constr_date=CURRENT_DATE()
<if test="isSup == 1">
AND (tcmc.quality_user = 'AU' OR tcmc.quality_user IS NULL)
</if>
<if test="isSup == 2">
AND tcmc.check_user=#{currentUserId}
</if>
<if test="isSup == 3">
AND jcm.build_unit_code = #{currentUserOrgId}
</if>
</select>
<select id="getTicketContent" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
select DISTINCT jsp.work_content content,jsp.work_site_name workSite,
jsp.work_procedure workType
from jj_weeks_plan jwp
left join jj_risk_precaution jsp on jsp.id=jwp.risk_precaution_id
where ticket_id like concat('%',concat(#{id},'%'))
and jwp.delete_flag=0 and jsp.delete_flag=0
</select>
<select id="getTodayWarnInfo" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
select jwi.warn_type warnType ,jwi.handle handleState,jwi.handle_time handleTime,handle_user handleId,
jwi.sing_pro_name proName ,IFNULL(wi.`ignore`,0) isIgnore,
jwi.is_fh state,jwi.team_phone teamPhone,
su.user_name,su.login_name userName,su2.login_name handleUser,IFNULL(jwi.team_leader,'') fzrName,
jwi.risk_level riskLevel,jwi.t_class_id classId ,jwi.org_id ,jwi.team_id_car fzrNum,jwi.type,
jwi.key_id id ,jwi.remark handelRemark,jdc.`value`,
jwi.audit_status auditStatus, jwi.audit_user auditUser, jwi.audit_time auditTime, jwi.is_org isOrg,
jwi.audit_remark auditRemark
from jj_warn_info jwi
left join jj_data_code jdc on jdc.code_value=jwi.vlotage_level and jdc.`code`='voltage_level'
left JOIN jj_warn_ignore wi on jwi.team_id_car=wi.key_id and jwi.type=wi.type
left join sys_user su on jwi.user_id=su.id
left join sys_user su2 on jwi.handle_user=su2.id
where warn_day=CURRENT_DATE
<if test='dataType=="1"'>
and jdc.remarks='jsb'
</if>
<if test='dataType=="2"'>
and ( jdc.remarks is null or jdc.remarks='' or jdc.remarks!='jsb' )
</if>
<!--督查人员-->
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
ORDER BY jwi.handle_user asc
</select>
<select id="getTodayWarnInfo2" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
select jwi.warn_type warnType ,jwi.handle handleState,jwi.handle_time handleTime,handle_user handleId,
jwi.sing_pro_name proName ,IFNULL(wi.`ignore`,0) isIgnore,
jwi.is_fh state,jwi.team_phone teamPhone,
su.user_name,su.login_name userName,su2.login_name handleUser,IFNULL(jwi.team_leader,'') fzrName,
jwi.risk_level riskLevel,jwi.t_class_id classId ,jwi.org_id ,jwi.team_id_car fzrNum,jwi.type,
jwi.key_id id ,jwi.remark handelRemark,jdc.`value`,
jwi.audit_status auditStatus, jwi.audit_user auditUser, jwi.audit_time auditTime, jwi.is_org isOrg,
jwi.audit_remark auditRemark
from jj_warn_info jwi
left join jj_data_code jdc on jdc.code_value=jwi.vlotage_level and jdc.`code`='voltage_level'
left JOIN jj_warn_ignore wi on jwi.team_id_car=wi.key_id and jwi.type=wi.type
left join sys_user su on jwi.user_id=su.id
left join sys_user su2 on jwi.handle_user=su2.id
where warn_day=CURRENT_DATE and jwi.type not in(9,10,11)
<if test='dataType=="1"'>
and jdc.remarks='jsb'
</if>
<if test='dataType=="2"'>
and ( jdc.remarks is null or jdc.remarks='' or jdc.remarks!='jsb' )
</if>
<!--督查人员-->
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
ORDER BY jwi.handle_user asc
</select>
<select id="getTodayWarnList" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
select jwi.warn_type warnType ,jwi.handle handleState,jwi.handle_time handleTime,handle_user handleId,
jwi.sing_pro_name proName ,IFNULL(wi.`ignore`,0) isIgnore,
jwi.is_fh state,jwi.ticket_no ticketNo,jwi.work_content content,
jwi.t_class_id tClassId,jwi.start_time startTime,jwi.end_time ednTime,
jwi.t_gx tgx,jwi.y_gx ygx,jwi.t_work_num dNum,jwi.y_work_num yNum,
su.user_name,su.login_name userName,su2.login_name handleUser,IFNULL(jwi.team_leader,'') fzrName,
jwi.risk_level riskLevel,jwi.t_class_id classId ,jwi.org_id ,jwi.type,
jwi.key_id id ,jwi.remark handelRemark,so.city_name cityName,
jwi.work_team teamName,jwi.team_id_car fzrNum,jwi.team_phone phone,
jwi.add_gx addGx,jwi.del_gx delGx,
jwi.audit_status,jwi.audit_user,jwi.audit_time,jwi.is_org,jwi.vlotage_level
from jj_warn_info jwi
left JOIN jj_warn_ignore wi on jwi.team_id_car=wi.key_id and jwi.type=wi.type
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
where warn_day=CURRENT_DATE and jwi.type=#{type}
<!--督查人员-->
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
<if test="paramType!=null and paramType!=''">
and (
<if test="paramType1!=null and paramType1!=''">
jwi.work_content like concat('%',#{paramType1},'%') or
</if>
<if test="paramType2!=null and paramType2!=''">
jwi.work_content like concat('%',#{paramType2},'%') or
</if>
<if test="paramType3!=null and paramType3!=''">
jwi.work_content like concat('%',#{paramType3},'%') or
</if>
<if test="paramType4!=null and paramType4!=''">
jwi.work_content like concat('%',#{paramType4},'%') or
</if>
<if test="paramType!=null and paramType!=''">
jwi.work_content like concat('%',#{paramType},'%')
</if>
)
</if>
<if test="fzrName!= null and fzrName!= ''">
AND jwi.team_leader LIKE CONCAT('%',#{fzrName},'%')
</if>
<if test="proName!= null and proName!= ''">
AND jwi.sing_pro_name LIKE CONCAT('%',#{proName},'%')
</if>
<if test="org!= null and org!= ''">
AND jwi.org_id IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
ORDER BY jwi.handle_user asc
</select>
<select id="getTodayWarnNumList" resultType="java.lang.Integer">
select IFNULL(count(1),0) NUM
from jj_warn_info jwi
where type=1 and warn_day=CURRENT_DATE
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
union ALL
select count(1)
from jj_warn_info jwi
where type=2 and warn_day=CURRENT_DATE
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
union ALL
select count(1)
from jj_warn_info jwi
where type=3 and warn_day=CURRENT_DATE
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
union ALL
select count(1)
from jj_warn_info jwi
where type=4 and warn_day=CURRENT_DATE
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
union ALL
select count(1)
from jj_warn_info jwi
where type=5 and warn_day=CURRENT_DATE
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
union ALL
select count(1)
from jj_warn_info jwi
where type=6 and warn_day=CURRENT_DATE
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
union ALL
select count(1)
from jj_warn_info jwi
where type=7 and warn_day=CURRENT_DATE
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
union ALL
select count(1)
from jj_warn_info jwi
where type=8 and warn_day=CURRENT_DATE
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
union ALL
select count(1)
from jj_warn_info jwi
where type=11 and warn_day=CURRENT_DATE
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
union ALL
select count(1)
from jj_warn_info jwi
where type=10 and warn_day=CURRENT_DATE
<if test="isSup == 2">
AND jwi.user_id=#{currentUserId}
</if>
<if test="isSup == 3">
AND jwi.org_id = #{currentUserOrgId}
</if>
</select>
<select id="getPuidByClassId" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
select IFNULL(td.puid,td2.puid) puid ,jbl.camera_no cameraNo ,jcm.bidding_section_code bidNo
FROM jj_class_meetting jcm
left join jj_ball jbl on jcm.camera_id2=jbl.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_ball jbl2 on jcm.camera_id3=jbl2.id and jbl2.delete_flag=0
left join t_device td2 on td2.t_code=jbl2.camera_no and td2.is_flag=0
where jcm.id=#{classId}
</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.work_content content,jwi.t_gx tgx,jwi.y_gx ygx,jwi.add_gx addGx,jwi.open_html openTime,
jwi.wzx_reason reason
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
where 1=1
<if test="warnDay!=null and warnDay!=''">
and jwi.warn_day=#{warnDay}
</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>
<select id="getWarnInfoById" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
select jwi.warn_type warnType ,jwi.handle handleState,jwi.handle_time handleTime,handle_user handleId,
jwi.sing_pro_name proName ,IFNULL(wi.`ignore`,0) isIgnore,
jwi.is_fh state,jwi.team_phone teamPhone,
su.user_name,su.login_name userName,su2.login_name handleUser,IFNULL(jwi.team_leader,'') fzrName,
jwi.risk_level riskLevel,jwi.t_class_id classId ,jwi.org_id ,jwi.team_id_car fzrNum,jwi.type,
jwi.key_id id ,jwi.remark handelRemark,jdc.`value`,
jwi.audit_status auditStatus, jwi.audit_user auditUser, jwi.audit_time auditTime, jwi.is_org isOrg,
jwi.audit_remark auditRemark,
jwi.work_content content,jwi.t_gx tgx,jwi.y_gx ygx,jwi.add_gx addGx,jwi.open_html openTime,
jwi.wzx_reason reason, jwi.del_gx delGx,
jwi.t_work_num dNum,jwi.y_work_num yNum
from jj_warn_info jwi
left join jj_data_code jdc on jdc.code_value=jwi.vlotage_level and jdc.`code`='voltage_level'
left JOIN jj_warn_ignore wi on jwi.team_id_car=wi.key_id and jwi.type=wi.type
left join sys_user su on jwi.user_id=su.id
left join sys_user su2 on jwi.handle_user=su2.id
where jwi.key_id=#{id}
</select>
<select id="getWarnInfoDetails" resultType="com.sercurityControl.proteam.domain.EarlyEntity">
select jwi.warn_type warnType ,jwi.handle handleState,jwi.handle_time handleTime,handle_user handleId,
jwi.sing_pro_name proName ,IFNULL(wi.`ignore`,0) isIgnore,
jwi.is_fh state,jwi.team_phone teamPhone,
su.user_name,su.login_name userName,su2.login_name handleUser,IFNULL(jwi.team_leader,'') fzrName,
jwi.risk_level riskLevel,jwi.t_class_id classId ,jwi.org_id ,jwi.team_id_car fzrNum,jwi.type,
jwi.key_id id ,jwi.remark handelRemark,jdc.`value`,
jwi.audit_status auditStatus, jwi.audit_user auditUser, jwi.audit_time auditTime, jwi.is_org isOrg,
jwi.audit_remark auditRemark,
jwi.work_content content,jwi.t_gx tgx,jwi.y_gx ygx,jwi.add_gx addGx,jwi.open_html openTime,
jwi.wzx_reason reason,jwi.del_gx delGx,
jwi.t_work_num dNum,jwi.y_work_num yNum
from jj_warn_info jwi
left join jj_data_code jdc on jdc.code_value=jwi.vlotage_level and jdc.`code`='voltage_level'
left JOIN jj_warn_ignore wi on jwi.team_id_car=wi.key_id and jwi.type=wi.type
left join sys_user su on jwi.user_id=su.id
left join sys_user su2 on jwi.handle_user=su2.id
where jwi.t_class_id=#{classId} and jwi.type=#{type}
</select>
<select id="getNoBidNum" resultType="java.lang.Integer">
select count(1)
from jj_class_meetting jcm
left join t_user_handle tuh on tuh.fzr_num=jcm.id and tuh.type='7'
where jcm.current_constr_date=CURRENT_DATE and jcm.delete_flag=0 and jcm.camera_id is null and tuh.id is null
</select>
<select id="getUnLineNum" resultType="java.lang.Integer">
select count(1)
from jj_class_meetting jcm
left join t_user_handle tuh on tuh.fzr_num=jcm.id and tuh.type='7'
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 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
left join jj_ball jb3 on jb3.id=jcm.camera_id4
left join t_device td3 on td3.t_code=jb3.camera_no
where jcm.current_constr_date=CURRENT_DATE and jcm.delete_flag=0
and jcm.current_construction_status in('1','01')
and td.state=0 and ( jcm.camera_id3 is null or td2.state=0)
and ( jcm.camera_id4 is null or td3.state=0) and tuh.id is null
</select>
<select id="getWarnInfoHandle" resultType="java.lang.String">
SELECT jwi.warn_type
from jj_warn_info jwi
left join jj_data_code jdc on jdc.code_value=jwi.vlotage_level and jdc.`code`='voltage_level'
WHERE jwi.handle =0 and jwi.t_class_id=#{id}
and jwi.type in(4,5,6,7,8,9,10)
<if test='dataType=="1"'>
and jdc.remarks='jsb'
</if>
<if test='dataType=="2"'>
and ( jdc.remarks is null or jdc.remarks='' or jdc.remarks!='jsb' )
</if>
</select>
<select id="exportEarlyWarn" resultType="com.sercurityControl.proteam.domain.EarlyEntityExport">
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,
CASE jwi.risk_level WHEN '2' THEN '二级' WHEN '3' THEN '三级' WHEN '4' THEN '四级' WHEN '5' THEN '五级' END AS riskLevel,
CASE jwi.is_fh WHEN '1' THEN '符合' WHEN '2' THEN '不符合' ELSE '--' END AS isHl,
case jwi.handle =1 when '已核实' then '未核实' end handle
, jwi.remark handelRemark , jwi.is_fh , jwi.risk_level ,
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.work_content content,jwi.t_gx tgx,jwi.y_gx ygx,jwi.add_gx addGx,jwi.open_html openTime,
jwi.wzx_reason reason
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
where 1=1
<if test="warnDay!=null and warnDay!=''">
and jwi.warn_day=#{warnDay}
</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>