1295 lines
60 KiB
Plaintext
1295 lines
60 KiB
Plaintext
|
|
<?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.HomeDataMapper">
|
||
|
|
|
||
|
|
<select id="getProNum" resultType="java.lang.Integer">
|
||
|
|
SELECT
|
||
|
|
count( jbp.bid_no ) AS num
|
||
|
|
FROM
|
||
|
|
jj_bid_project jbp
|
||
|
|
<where>
|
||
|
|
<if test="orgId != null and orgId != ''">
|
||
|
|
jbp.build_no=#{orgId}
|
||
|
|
</if>
|
||
|
|
<if test="isStop == null">
|
||
|
|
AND jbp.status = '0'
|
||
|
|
</if>
|
||
|
|
<if test="isStop == 1">
|
||
|
|
and (jbp.is_stop = '1' OR CONCAT(jbp.is_stop,'1') = '1')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jbp.pro_type IN ('00','01')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jbp.pro_type IN ('03','05')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '' ">
|
||
|
|
AND jbp.pro_type IN ('00','01','03','05')
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getProNumByWork" resultType="java.lang.Integer"
|
||
|
|
parameterType="java.lang.String">
|
||
|
|
select count(a.bid_no) from
|
||
|
|
(SELECT jbp.bid_no FROM t_class_metting jz
|
||
|
|
LEFT JOIN jj_bid_project jbp on jz.bid_code=jbp.bid_no
|
||
|
|
where jz.work_day=#{workDate} and jz.del_flag='0'
|
||
|
|
<if test="orgId != null and orgId != ''">
|
||
|
|
and jbp.build_no=#{orgId}
|
||
|
|
</if>
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jbp.pro_type IN ('00','01')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jbp.pro_type IN ('03','05')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '' ">
|
||
|
|
AND jbp.pro_type IN ('00','01','03','05')
|
||
|
|
</if>
|
||
|
|
GROUP BY jbp.bid_no)a
|
||
|
|
</select>
|
||
|
|
<select id="getProList" resultType="com.sercurityControl.proteam.domain.ProData"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.ProData">
|
||
|
|
select jbp.bid_no as bidCode,so.city_name as buildUnit,jbp.bid_name as bidName,
|
||
|
|
IFNULL(sd2.`name`,jbp.pro_type) as proType,jbp.jL_dw as jlUnit,jbp.sg_dw as workUnit,if(jbp.is_stop =
|
||
|
|
1,'已停工','未停工') as isStop,
|
||
|
|
if(jz.bid_code is null,'未施工','在施工') as proStatus
|
||
|
|
from jj_bid_project jbp
|
||
|
|
LEFT JOIN (
|
||
|
|
SELECT DISTINCT tcm.bid_code
|
||
|
|
FROM t_class_metting tcm
|
||
|
|
WHERE tcm.work_day=CURRENT_DATE() AND tcm.del_flag='0'
|
||
|
|
)jz ON jbp.bid_no = jz.bid_code
|
||
|
|
left join sys_dist sd on sd.code='pro_type'
|
||
|
|
left join sys_dist sd2 on sd2.p_id=sd.id and sd2.code=jbp.pro_type
|
||
|
|
LEFT JOIN sys_org so on so.org_id=jbp.build_no
|
||
|
|
<where>
|
||
|
|
<if test="buildCode!=null and buildCode!=''">
|
||
|
|
jbp.build_no IN (
|
||
|
|
<foreach collection="buildCodeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="buildUnit != null and buildUnit != ''">
|
||
|
|
and jbp.build_unit LIKE CONCAT('%',#{buildUnit},'%')
|
||
|
|
</if>
|
||
|
|
<if test="bidName != null and bidName != ''">
|
||
|
|
and jbp.bid_name LIKE CONCAT('%',#{bidName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jbp.pro_type IN ('00','01')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jbp.pro_type IN ('03','05')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '' ">
|
||
|
|
AND jbp.pro_type IN ('00','01','03','05')
|
||
|
|
</if>
|
||
|
|
<if test='proStatus=="1"'>
|
||
|
|
and jz.bid_code is not null
|
||
|
|
</if>
|
||
|
|
<if test='proStatus=="0"'>
|
||
|
|
and jz.bid_code is null
|
||
|
|
</if>
|
||
|
|
<if test="isStop != null and isStop != ''">
|
||
|
|
<if test='isStop==0'>
|
||
|
|
and jbp.is_stop=#{isStop}
|
||
|
|
</if>
|
||
|
|
<if test='isStop==1'>
|
||
|
|
and (jbp.is_stop=#{isStop} OR CONCAT(jbp.is_stop,'1') = '1')
|
||
|
|
</if>
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getDayPlan" resultType="com.sercurityControl.proteam.domain.DayPlanNum"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.DayPlanNum">
|
||
|
|
|
||
|
|
|
||
|
|
</select>
|
||
|
|
<select id="getWeekPlanDayNum" resultType="com.sercurityControl.proteam.domain.vo.StatEntity"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.WeekRiskData">
|
||
|
|
SELECT city_name name,SUM(any_value(NUM)) NUM , SUM(any_value(NUM2)) NUM2
|
||
|
|
FROM (
|
||
|
|
select city_name,IFNULL(wn.num ,0) NUM ,0 NUM2
|
||
|
|
from sys_org so
|
||
|
|
left join (
|
||
|
|
select count(1) num,build_unit_code build_no
|
||
|
|
FROM jj_weeks_plan
|
||
|
|
where #{curryDay} between planned_start_date and planned_end_date and (re_assessment_risk_level in ('三级','3') )
|
||
|
|
GROUP BY build_unit_code
|
||
|
|
)wn on wn.build_no=so.org_id
|
||
|
|
UNION ALL
|
||
|
|
select city_name,0,IFNULL(wn.num ,0)num
|
||
|
|
from sys_org so
|
||
|
|
left join (
|
||
|
|
select count(1) num,build_unit_code build_no
|
||
|
|
FROM jj_weeks_plan
|
||
|
|
where #{curryDay} between planned_start_date and planned_end_date and (re_assessment_risk_level='二级' or re_assessment_risk_level='2' )
|
||
|
|
GROUP BY build_unit_code
|
||
|
|
)wn on wn.build_no=so.org_id
|
||
|
|
)B
|
||
|
|
GROUP BY city_name
|
||
|
|
ORDER BY NUM DESC
|
||
|
|
</select>
|
||
|
|
<select id="getWeekPlanListByTime" resultType="com.sercurityControl.proteam.domain.WeekRiskData"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.WeekRiskData">
|
||
|
|
SELECT so.city_name as buildUnit,jwp.bidding_section_name as proName,
|
||
|
|
jwp.re_assessment_risk_level as riskType,jdc.value as workType,jt.working_team_name as workTeam,
|
||
|
|
jsp.work_site_name as workPosition,
|
||
|
|
jsp.work_content as workContent,
|
||
|
|
jwp.planned_start_date as planStartTime,
|
||
|
|
jwp.planned_end_date as planEndTime
|
||
|
|
FROM jj_weeks_plan jwp
|
||
|
|
left join jj_risk_precaution jsp on jsp.id=jwp.risk_precaution_id
|
||
|
|
LEFT JOIN sys_org so ON so.org_id=jwp.build_unit_code
|
||
|
|
left join jj_data_code jdc on jdc.code_value=jsp.work_type and jdc.code='WORK_TYPE'
|
||
|
|
left join jj_team jt on jt.id =jwp.team_id
|
||
|
|
where 1=1
|
||
|
|
<if test="curryDay != null and curryDay != ''">
|
||
|
|
AND #{curryDay} between jwp.planned_start_date and jwp.planned_end_date
|
||
|
|
</if>
|
||
|
|
<if test="buildUnitCode!=null and buildUnitCode!=''">
|
||
|
|
AND jwp.build_unit_code IN (
|
||
|
|
<foreach collection="buildUnitCodeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="buildUnit != null and buildUnit != ''">
|
||
|
|
and so.city_name LIKE CONCAT('%',#{buildUnit},'%')
|
||
|
|
</if>
|
||
|
|
<if test="proName != null and proName != ''">
|
||
|
|
and jwp.bidding_section_name LIKE CONCAT('%',#{proName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="workType != null and workType != ''">
|
||
|
|
and jdc.value LIKE CONCAT('%',#{workType},'%')
|
||
|
|
</if>
|
||
|
|
<if test="workTeam != null and workTeam != ''">
|
||
|
|
and jt.working_team_name LIKE CONCAT('%',#{workTeam},'%')
|
||
|
|
</if>
|
||
|
|
<if test="riskType != null and riskType != ''">
|
||
|
|
and jwp.re_assessment_risk_level =#{riskType}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<select id="getRiskMap" resultType="com.sercurityControl.proteam.domain.RiskMapData"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.RiskMapData">
|
||
|
|
select jcm.bidding_section_name proName,jcm.re_assessment_risk_level riskType,jcmi.work_manage workManage
|
||
|
|
,jcmi.work_manage_phone workManagePhone,jcmi.work_content workContent,jcmi.team_name foreman,
|
||
|
|
td.state as ballStatus,jcm.tool_box_talk_Latitude lat,jcm.tool_box_talk_longitude lon,
|
||
|
|
jcm .build_unit_code buildCode,cmw.num
|
||
|
|
from jj_class_meetting jcm
|
||
|
|
LEFT JOIN t_class_metting_warn cmw on jcm.id=cmw.class_id
|
||
|
|
left join jj_class_metting_info jcmi on jcmi.class_id=jcm.id
|
||
|
|
left join jj_ball jbl on jbl.id=jcm.camera_id
|
||
|
|
left join t_device td on td.t_code=jbl.camera_no
|
||
|
|
where jcm.current_constr_date=CURRENT_DATE() AND jcm.delete_flag = '0'
|
||
|
|
<if test="riskType != null and riskType != ''">
|
||
|
|
and jcm.re_assessment_risk_level = #{riskType}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getWeatherMap" resultType="com.sercurityControl.proteam.domain.WeatherMapData">
|
||
|
|
select name as cictyName,REAL_TIME_TEMP as currentTemp,weather as weather,
|
||
|
|
CONCAT(TEMP_MIN,'~',TEMP_MAX) as dayTemp,REAL_TIME_WEATHER as weatherStatus,org.lon,org.lat
|
||
|
|
from t_weather tw
|
||
|
|
LEFT JOIN sys_org org on tw.`NAME`=org.city_name
|
||
|
|
where create_time=#{currentDay}
|
||
|
|
and HOURS=#{hour}
|
||
|
|
|
||
|
|
</select>
|
||
|
|
<select id="getWeatherAlert" resultType="java.lang.String">
|
||
|
|
select content
|
||
|
|
from t_wather_warn tww
|
||
|
|
LEFT JOIN sys_org org on tww.city= concat(org.city_name,'市')
|
||
|
|
where tww.state = '1'
|
||
|
|
<if test="currentDay == null || currentDay == ''">
|
||
|
|
and TO_DAYS(tww.create_time)=TO_DAYS(now())
|
||
|
|
</if>
|
||
|
|
<if test="currentDay != null and currentDay != ''">
|
||
|
|
and TO_DAYS(tww.create_time)=TO_DAYS(#{currentDay})
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="orgId != null and orgId != ''">
|
||
|
|
and org.org_id= #{orgId}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<select id="getWeatherAlertPlus" resultType="java.util.Map">
|
||
|
|
select content,date_format(create_time,'%Y-%m-%d') currentDay
|
||
|
|
from t_wather_warn tww
|
||
|
|
LEFT JOIN sys_org org on tww.city= concat(org.city_name,'市')
|
||
|
|
where 1 =1
|
||
|
|
<if test="currentDay == null || currentDay == ''">
|
||
|
|
and TO_DAYS(tww.create_time)=TO_DAYS(now())
|
||
|
|
</if>
|
||
|
|
<if test="currentDay != null and currentDay != ''">
|
||
|
|
and TO_DAYS(tww.create_time)=TO_DAYS(#{currentDay})
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="orgId != null and orgId != ''">
|
||
|
|
and org.org_id= #{orgId}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getTicketNumByType" resultType="com.sercurityControl.proteam.domain.TicketTypeNum"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.TicketTypeNum">
|
||
|
|
select tti.re_assessment_risk_level ticketType,count(tti.id) as riskNum
|
||
|
|
from jj_ticket tti
|
||
|
|
LEFT JOIN jj_single_project jsp on jsp.single_project_code=tti.single_project_code
|
||
|
|
where tti.ticket_status='05' and tti.delete_flag=0
|
||
|
|
<if test="buildCode != null and buildCode != ''">
|
||
|
|
and tti.build_unit_code= #{buildCode}
|
||
|
|
</if>
|
||
|
|
<if test="proType != '' and proType != null and proType!=04">
|
||
|
|
AND jsp.single_project_type = #{proType}
|
||
|
|
</if>
|
||
|
|
<if test="proType != '' and proType != null and proType==04">
|
||
|
|
AND (jsp.single_project_type NOT IN ('1','3') OR jbp.single_project_type IS NULL)
|
||
|
|
</if>
|
||
|
|
GROUP BY tti.re_assessment_risk_level
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getTicketNumByCicty" resultType="com.sercurityControl.proteam.domain.TicketCityNum"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.TicketCityNum">
|
||
|
|
select org.city_name as cictyName, count(a.id) as ticketNum FROM
|
||
|
|
sys_org org
|
||
|
|
LEFT JOIN
|
||
|
|
(select tti.*
|
||
|
|
from t_ticket_info tti
|
||
|
|
LEFT JOIN jj_bid_project jbp on tti.bid_no=jbp.bid_no
|
||
|
|
where tti.job_type=#{ticketType} AND tti.flag = '1'
|
||
|
|
<if test="dateType == 3">
|
||
|
|
AND (STR_TO_DATE( #{ticketDate}, '%Y-%m-%d' ) BETWEEN STR_TO_DATE( tti.job_plan_start_time, '%Y-%m-%d' ) AND
|
||
|
|
STR_TO_DATE( tti.job_plan_end_time, '%Y-%m-%d' ) )
|
||
|
|
</if>
|
||
|
|
<if test="dateType != 3">
|
||
|
|
AND STR_TO_DATE( tti.job_plan_end_time, '%Y-%m-%d' ) >= #{format}
|
||
|
|
AND STR_TO_DATE( tti.job_plan_start_time, '%Y-%m-%d' ) <= #{ticketDate}
|
||
|
|
</if>
|
||
|
|
)a on a.build_org_no=org.org_id
|
||
|
|
GROUP BY org.org_id
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getTicketList" resultType="com.sercurityControl.proteam.domain.TicketData"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.TicketData">
|
||
|
|
select so.city_name as buildName,jbp.build_unit_code as buildCode,tti.ticket_name as ticketName,
|
||
|
|
tti.ticket_no as ticketNo,tti.re_assessment_risk_level as riskType,
|
||
|
|
tti.re_assessment_risk_level riskRetestType,
|
||
|
|
tti.ticket_type ticketType,tti.id ,
|
||
|
|
tti.bidding_section_name as signName,jbp.single_project_code as signCode,
|
||
|
|
tti.working_team_name as foreman
|
||
|
|
from jj_ticket tti
|
||
|
|
LEFT JOIN jj_single_project jbp on tti.single_project_code=jbp.single_project_code
|
||
|
|
left join sys_org so on so.org_id=tti.build_unit_code
|
||
|
|
left join jj_data_code jdc on jdc.code_value=tti.re_assessment_risk_level and jdc.code='risk_level'
|
||
|
|
<where>
|
||
|
|
tti.ticket_status = '05' AND tti.delete_flag = '0'
|
||
|
|
<if test="buildCode!=null and buildCode!=''">
|
||
|
|
AND tti.build_unit_code IN (
|
||
|
|
<foreach collection="buildCodeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="ticketName != null and ticketName != ''">
|
||
|
|
and tti.ticket_name like concat('%',#{ticketName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="ticketNo != null and ticketNo != ''">
|
||
|
|
and tti.ticket_no like concat('%',#{ticketNo},'%')
|
||
|
|
</if>
|
||
|
|
<if test="signName != null and signName != ''">
|
||
|
|
and tti.bidding_section_name like concat('%',#{signName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="riskType!=null and riskType!=''">
|
||
|
|
AND tti.re_assessment_risk_level IN (
|
||
|
|
<foreach collection="riskTypeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="proType != '' and proType != null and proType!=04">
|
||
|
|
AND jbp.single_project_type = #{proType}
|
||
|
|
</if>
|
||
|
|
<if test="proType != '' and proType != null and proType==04">
|
||
|
|
AND (jbp.single_project_type NOT IN ('1','3') OR jbp.single_project_type IS NULL)
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
<!--人员统计站班会全部人员-->
|
||
|
|
<select id="getClassPeopleNum" resultType="com.sercurityControl.proteam.domain.PersonNum" parameterType="com.sercurityControl.proteam.domain.PersonNum">
|
||
|
|
select IFNULL(jdc.`value`,'一般作业人员') personType,count(1) personNum
|
||
|
|
from jj_class_meeting_people jcmp
|
||
|
|
left join jj_data_code jdc on jcmp.position_code=jdc.code_value AND jdc.`code`='POSITION_CODE'
|
||
|
|
left join jj_class_meetting jcm on jcm.id =jcmp.tool_box_talk_id
|
||
|
|
WHERE jcm.current_constr_date =CURRENT_DATE()
|
||
|
|
<if test='isSup=="3"'>
|
||
|
|
and jcmp.build_unit_code=#{orgId}
|
||
|
|
</if>
|
||
|
|
GROUP BY jdc.`value`
|
||
|
|
</select>
|
||
|
|
<!--日考勤统计-->
|
||
|
|
<select id="getDayAttendanceNum" resultType="com.sercurityControl.proteam.domain.PersonNum">
|
||
|
|
select pt.personType,count(tpa.id_card) as personNum
|
||
|
|
FROM t_person_attendance tpa
|
||
|
|
LEFT JOIN t_class_metting_people tcmp on tpa.id_card=tcmp.id_number AND tcmp.create_day=#{currentDay}
|
||
|
|
LEFT JOIN t_class_metting jzb on tcmp.class_id=jzb.class_id AND jzb.work_day=#{currentDay}
|
||
|
|
left JOIN
|
||
|
|
(select value as id,name as personType from p_code where code_type='00000003') pt on pt.id=tcmp.people_type
|
||
|
|
where tpa.att_date=#{currentDay} AND pt.personType IS NOT NULL
|
||
|
|
GROUP BY pt.personType
|
||
|
|
</select>
|
||
|
|
<!--实时在场-->
|
||
|
|
<select id="getRealTimeNum" resultType="com.sercurityControl.proteam.domain.PersonNum">
|
||
|
|
select count(DISTINCT tpa.id_card) personNum,pt.people_type_name personType
|
||
|
|
from t_person_attendance tpa
|
||
|
|
INNER JOIN(
|
||
|
|
select distinct bak_ic, people_type_name,single_no
|
||
|
|
from jj_person
|
||
|
|
)pt on pt.bak_ic=tpa.id_card and pt.single_no=tpa.sing_code
|
||
|
|
INNER join jj_fix_ybz fy on fy.single_no=tpa.sing_code AND fy.`status` ='1' and fy.is_tc = '1'
|
||
|
|
WHERE fy.single_no IS NOT NULL and tpa.att_date=#{currentDay}
|
||
|
|
GROUP BY pt.people_type_name
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getPersonListByAtt" resultType="com.sercurityControl.proteam.domain.PersonData"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.PersonData">
|
||
|
|
select tpa.person_name as personName,IFNULL(pt.personType,'其他作业人员') personType,tcmp.age,jzb.bid_name as
|
||
|
|
proName,tpa.id_card idNumber,
|
||
|
|
jzb.team_name as teamName,jzb.work_manager as workManage,jzb.work_manager_phone as foremanPhone
|
||
|
|
FROM t_person_attendance tpa
|
||
|
|
LEFT JOIN t_class_metting_people tcmp on tpa.id_card=tcmp.id_number AND tcmp.create_day=#{currentDay}
|
||
|
|
LEFT JOIN t_class_metting jzb on tcmp.class_id=jzb.class_id AND jzb.work_day=#{currentDay}
|
||
|
|
LEFT JOIN
|
||
|
|
(select value as id,name as personType
|
||
|
|
from p_code where code_type='00000003' ) pt on pt.id=tcmp.people_type
|
||
|
|
where tpa.att_date=#{currentDay}
|
||
|
|
<if test="personName != null and personName != ''">
|
||
|
|
and tpa.person_name like concat('%',#{personName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="teamName != null and teamName != ''">
|
||
|
|
and jzb.team_name like concat('%',#{teamName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="proName != null and proName != ''">
|
||
|
|
and jzb.bid_name like concat('%',#{proName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="personType==1">
|
||
|
|
and pt.personType in ('副班长', '工作负责人', '班长兼指挥', '班组安全员')
|
||
|
|
</if>
|
||
|
|
<if test="personType==2">
|
||
|
|
and pt.personType in ('牵张机械操作手', '其他技术人员', '班组技术兼质检员', '特殊工种作业人员', '班组技术员兼质检员')
|
||
|
|
</if>
|
||
|
|
<if test="personType==3">
|
||
|
|
and pt.personType not in ('副班长', '工作负责人', '班长兼指挥', '班组安全员', '牵张机械操作手', '其他技术人员', '班组技术兼质检员', '特殊工种作业人员',
|
||
|
|
'班组技术员兼质检员')
|
||
|
|
</if>
|
||
|
|
<if test="peoType != null and peoType != ''">
|
||
|
|
and pt.personType like concat('%',#{peoType},'%')
|
||
|
|
</if>
|
||
|
|
|
||
|
|
</select>
|
||
|
|
<select id="getPersonList" resultType="com.sercurityControl.proteam.domain.PersonData"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.PersonData">
|
||
|
|
select jcm.id ,ju.mobile phone,jcmp.real_name personName ,jdc.`value` personType,
|
||
|
|
jcm.bidding_section_name proName,jcmi.team_name teamName,so.city_name orgName ,jcmi.work_content workContent,
|
||
|
|
concat(jcmi.work_manage,":",jcmi.work_manage_phone) workManage,jcmi.work_manage_num idNumber
|
||
|
|
from jj_class_meetting jcm
|
||
|
|
left join sys_org so on so.org_id=jcm.build_unit_code
|
||
|
|
left join jj_class_metting_info jcmi ON jcm.id=jcmi.class_id
|
||
|
|
LEFT join jj_class_meeting_people jcmp ON jcm.id=jcmp.tool_box_talk_id
|
||
|
|
left join jj_data_code jdc on jdc.code_value=jcmp.position_code and jdc.code='POSITION_CODE'
|
||
|
|
left JOIN jj_user ju on ju.personnel_id=jcmp.personnel_id
|
||
|
|
where jcm.current_constr_date=#{currentDay}
|
||
|
|
<if test="personName != null and personName != ''">
|
||
|
|
and jcmp.real_name like concat('%',#{personName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="teamName != null and teamName != ''">
|
||
|
|
and jcmi.team_name like concat('%',#{teamName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="proName != null and proName != ''">
|
||
|
|
and jcm.bidding_section_name like concat('%',#{proName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="personType==1 or personType==2">
|
||
|
|
and jdc.`value` in(
|
||
|
|
<foreach collection="typeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="personType==3">
|
||
|
|
and (
|
||
|
|
jdc.`value` not in(
|
||
|
|
<foreach collection="typeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
) or jdc.`value` is null or jdc.`value` ='')
|
||
|
|
</if>
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getPersonList2" resultType="com.sercurityControl.proteam.domain.PersonData"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.PersonData">
|
||
|
|
select cmp.class_id,cmp.phone,cmp.user_name personName, IFNULL(pc.personType,'一般作业人员')personType,
|
||
|
|
cm.bid_name proName,cm.team_name teamName,so.city_name orgName,cm.work_content workContent,
|
||
|
|
concat(cm.work_manager,":",cm.work_manager_phone) workManage,cmp.id_number idNumber
|
||
|
|
FROM t_class_metting_people cmp
|
||
|
|
left join (
|
||
|
|
select value as id,name as personType from p_code where code_type='00000003') pc on pc.id=cmp.people_type
|
||
|
|
left join t_class_metting cm on cmp.class_id=cm.class_id
|
||
|
|
left join sys_org so on so.org_id=cm.org
|
||
|
|
where cmp.create_day=#{currentDay}
|
||
|
|
<if test="personName != null and personName != ''">
|
||
|
|
and cmp.`user_name` like concat('%',#{personName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="teamName != null and teamName != ''">
|
||
|
|
and cm.team_name like concat('%',#{teamName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="proName != null and proName != ''">
|
||
|
|
and cm.sign_name like concat('%',#{proName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="personType==1 or personType==2">
|
||
|
|
and pc.personType in(
|
||
|
|
<foreach collection="typeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="personType==3">
|
||
|
|
and (
|
||
|
|
pc.personType not in(
|
||
|
|
<foreach collection="typeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
) or pc.personType is null or pc.personType='')
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getPersonListByZc" resultType="com.sercurityControl.proteam.domain.PersonData"
|
||
|
|
parameterType="com.sercurityControl.proteam.domain.PersonData">
|
||
|
|
select DISTINCT tpa.id_card, IFNULL(pt.people_type_name,'其他作业人员') personType,tpa.person_name personName,fy.single_name proName,
|
||
|
|
fy.build_org_name,pt.team_name teamName,pt. phone foremanPhone
|
||
|
|
from t_person_attendance tpa
|
||
|
|
INNER JOIN(
|
||
|
|
select distinct bak_ic, people_type_name,single_no,team_name,phone
|
||
|
|
from jj_person
|
||
|
|
)pt on pt.bak_ic=tpa.id_card and pt.single_no=tpa.sing_code
|
||
|
|
INNER join jj_fix_ybz fy on fy.single_no=tpa.sing_code
|
||
|
|
WHERE fy.single_no IS NOT NULL AND fy.`status` ='1' and fy.is_tc = '1' AND tpa.att_date=#{currentDay}
|
||
|
|
<if test="personName != null and personName != ''">
|
||
|
|
and tpa.`person_name` like concat('%',#{personName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="teamName != null and teamName != ''">
|
||
|
|
and pt.team_name like concat('%',#{teamName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="proName != null and proName != ''">
|
||
|
|
and fy.single_name like concat('%',#{proName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="personType==1">
|
||
|
|
and pt.people_type_name in ('副班长', '工作负责人', '班长兼指挥', '班组安全员')
|
||
|
|
</if>
|
||
|
|
<if test="personType==2">
|
||
|
|
and pt.people_type_name in ('牵张机械操作手', '其他技术人员', '班组技术兼质检员', '特殊工种作业人员', '班组技术员兼质检员')
|
||
|
|
</if>
|
||
|
|
<if test="personType==3">
|
||
|
|
and pt.people_type_name not in ('副班长', '工作负责人', '班长兼指挥', '班组安全员', '牵张机械操作手', '其他技术人员', '班组技术兼质检员', '特殊工种作业人员',
|
||
|
|
'班组技术员兼质检员')
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getRiskByDate" resultType="com.sercurityControl.proteam.domain.RiskDay">
|
||
|
|
|
||
|
|
select jzb.risk_level as riskType ,count(class_id) as riskNum
|
||
|
|
from t_class_metting jzb
|
||
|
|
LEFT JOIN jj_bid_project jbp on jzb.bid_code=jbp.bid_no
|
||
|
|
where jzb.work_day=#{date} and jzb.org=#{orgId}
|
||
|
|
GROUP BY jzb.risk_level
|
||
|
|
</select>
|
||
|
|
<!--日计划总数、已执行总数-->
|
||
|
|
<select id="getDayPlanNum" resultType="java.lang.Integer">
|
||
|
|
SELECT COUNT(*)
|
||
|
|
FROM t_daily_plan tdp
|
||
|
|
INNER JOIN jj_bid_project jbp ON tdp.bid_id = jbp.bid_no
|
||
|
|
<where>
|
||
|
|
jbp.pro_type IN ('00','01','03','05')
|
||
|
|
<if test="dayType == 3">
|
||
|
|
AND work_time = (curdate() - INTERVAL 0 DAY)
|
||
|
|
</if>
|
||
|
|
<if test="dayType == 2">
|
||
|
|
AND work_time = (curdate() - INTERVAL 1 DAY)
|
||
|
|
</if>
|
||
|
|
<if test="dayType == 1">
|
||
|
|
AND work_time = (curdate() - INTERVAL 2 DAY)
|
||
|
|
</if>
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jbp.pro_type IN ('00','01')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jbp.pro_type IN ('03','05')
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
UNION ALL
|
||
|
|
SELECT COUNT(*)
|
||
|
|
FROM t_daily_plan tdp
|
||
|
|
INNER JOIN jj_bid_project jbp ON tdp.bid_id = jbp.bid_no
|
||
|
|
INNER JOIN t_class_metting tcm ON tdp.bzz_bak_ic = tcm.work_manager_num AND tcm.del_flag = '0'
|
||
|
|
<where>
|
||
|
|
jbp.pro_type IN ('00','01','03','05')
|
||
|
|
<if test="dayType == 3">
|
||
|
|
AND tdp.work_time = (curdate() - INTERVAL 0 DAY)
|
||
|
|
AND tcm.work_day = (curdate() - INTERVAL 0 DAY)
|
||
|
|
</if>
|
||
|
|
<if test="dayType == 2">
|
||
|
|
AND tdp.work_time = (curdate() - INTERVAL 1 DAY)
|
||
|
|
AND tcm.work_day = (curdate() - INTERVAL 1 DAY)
|
||
|
|
</if>
|
||
|
|
<if test="dayType == 1">
|
||
|
|
AND tdp.work_time = (curdate() - INTERVAL 2 DAY)
|
||
|
|
AND tcm.work_day = (curdate() - INTERVAL 2 DAY)
|
||
|
|
</if>
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jbp.pro_type IN ('00','01')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jbp.pro_type IN ('03','05')
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
<!--查询当日施工的作业票数据 + 当日施工的站班会数据-->
|
||
|
|
<select id="getNewDayPlanNum" resultType="java.lang.Integer">
|
||
|
|
select COUNT(1)
|
||
|
|
from jj_ticket tti
|
||
|
|
LEFT JOIN jj_single_project jbp on tti.single_project_code=jbp.single_project_code
|
||
|
|
where tti.ticket_status='05' AND tti.delete_flag=0
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jbp.single_project_type IN ('00','1')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jbp.single_project_type IN ('3','05')
|
||
|
|
</if>
|
||
|
|
union all
|
||
|
|
select count(1)
|
||
|
|
from jj_class_meetting cm
|
||
|
|
left JOIN jj_single_project jbp ON cm.single_project_code = jbp.single_project_code
|
||
|
|
where cm.current_constr_date=curdate() and cm.delete_flag='0'
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jbp.single_project_type IN ('00','1')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jbp.single_project_type IN ('3','05')
|
||
|
|
</if>
|
||
|
|
|
||
|
|
</select>
|
||
|
|
<!--地市-日计划数量-->
|
||
|
|
<select id="getDayPlanOrgNum" resultType="java.util.Map">
|
||
|
|
SELECT so.org_id AS orgId,
|
||
|
|
so.city_name AS cityName,
|
||
|
|
COUNT(IF(jbp.id IS NOT NULL,1,NULL)) AS totalNum,
|
||
|
|
COUNT(IF(tcm.work_manager_num IS NOT NULL,1,NULL)) AS executedNum
|
||
|
|
FROM sys_org so
|
||
|
|
LEFT JOIN t_daily_plan tdp ON so.org_id = tdp.build_org_no
|
||
|
|
<if test="dayType == 3">
|
||
|
|
AND tdp.work_time = (curdate() - INTERVAL 0 DAY)
|
||
|
|
</if>
|
||
|
|
<if test="dayType == 2">
|
||
|
|
AND tdp.work_time = (curdate() - INTERVAL 1 DAY)
|
||
|
|
</if>
|
||
|
|
<if test="dayType == 1">
|
||
|
|
AND tdp.work_time = (curdate() - INTERVAL 2 DAY)
|
||
|
|
</if>
|
||
|
|
LEFT JOIN jj_bid_project jbp ON tdp.bid_id = jbp.bid_no AND jbp.pro_type IN ('00','01','03','05')
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jbp.pro_type IN ('00','01')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jbp.pro_type IN ('03','05')
|
||
|
|
</if>
|
||
|
|
LEFT JOIN t_class_metting tcm ON tdp.bzz_bak_ic = tcm.work_manager_num AND tcm.del_flag = '0' AND jbp.pro_type
|
||
|
|
IN ('01','03')
|
||
|
|
<if test="proType!='' and proType!=null">
|
||
|
|
AND jbp.pro_type = #{proType}
|
||
|
|
</if>
|
||
|
|
<if test="dayType == 3">
|
||
|
|
AND tcm.work_day = (curdate() - INTERVAL 0 DAY)
|
||
|
|
</if>
|
||
|
|
<if test="dayType == 2">
|
||
|
|
AND tcm.work_day = (curdate() - INTERVAL 1 DAY)
|
||
|
|
</if>
|
||
|
|
<if test="dayType == 1">
|
||
|
|
AND tcm.work_day = (curdate() - INTERVAL 2 DAY)
|
||
|
|
</if>
|
||
|
|
GROUP BY so.org_id
|
||
|
|
ORDER BY totalNum DESC,executedNum DESC
|
||
|
|
</select>
|
||
|
|
<!--地市-作业票+日计划数量-->
|
||
|
|
<select id="getNewDayPlanOrgNum" resultType="java.util.Map">
|
||
|
|
select c.org_id orgId,c.city_name cityName,d.num totalNum,c.num executedNum
|
||
|
|
from (
|
||
|
|
select so.org_id,so.city_name,IFNULL( a.num,0) num
|
||
|
|
FROM sys_org so
|
||
|
|
LEFT JOIN
|
||
|
|
(
|
||
|
|
select count(1) num,0,cm.build_unit_code org
|
||
|
|
from jj_class_meetting cm
|
||
|
|
LEFT JOIN jj_single_project jbp ON cm.single_project_code = jbp.single_project_code
|
||
|
|
where cm.current_constr_date=curdate() and cm.delete_flag='0'
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jbp.single_project_type IN ('00','1')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jbp.single_project_type IN ('3','05')
|
||
|
|
</if>
|
||
|
|
GROUP BY cm.build_unit_code
|
||
|
|
)a on a.org=so.org_id
|
||
|
|
)c
|
||
|
|
left join (
|
||
|
|
select so.org_id, so.city_name,IFNULL(a.num,0) num
|
||
|
|
FROM sys_org so
|
||
|
|
LEFT JOIN
|
||
|
|
(
|
||
|
|
select count(1) num,tti.build_unit_code org
|
||
|
|
FROM jj_ticket tti
|
||
|
|
LEFT JOIN jj_single_project jbp on tti.single_project_code=jbp.single_project_code
|
||
|
|
where tti.ticket_status='05' AND tti.delete_flag=0
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jbp.single_project_type IN ('00','1')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jbp.single_project_type IN ('3','05')
|
||
|
|
</if>
|
||
|
|
GROUP BY tti.build_unit_code
|
||
|
|
)a on a. org=so.org_id
|
||
|
|
)d on c.org_id=d.org_id
|
||
|
|
ORDER BY totalNum DESC,executedNum DESC
|
||
|
|
|
||
|
|
</select>
|
||
|
|
<select id="getAttendanceNum" resultType="java.lang.Integer">
|
||
|
|
SELECT COUNT(*)
|
||
|
|
FROM t_person_attendance tpa
|
||
|
|
LEFT JOIN jj_bid_project jbp ON tpa.bid_code = jbp.bid_no
|
||
|
|
WHERE jbp.build_no = #{orgId} AND tpa.att_date = curdate()
|
||
|
|
UNION ALL
|
||
|
|
SELECT COUNT(*)
|
||
|
|
FROM t_class_metting_people tcmp
|
||
|
|
LEFT JOIN t_class_metting tcm ON tcmp.class_id = tcm.class_id AND tcm.work_day = curdate()
|
||
|
|
WHERE tcm.org = #{orgId} AND tcmp.create_day = curdate()
|
||
|
|
</select>
|
||
|
|
<!--地市工程数量和占比-->
|
||
|
|
<select id="getOrgNumAndRateByPro" 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 b.buildNo,COUNT(b.buildNo) AS num FROM (
|
||
|
|
SELECT DISTINCT jfy.single_no AS singleNo,jfy.build_org_no AS buildNo
|
||
|
|
FROM jj_fix_ybz jfy
|
||
|
|
<where>
|
||
|
|
<if test='type == 1'>
|
||
|
|
and (( jfy.status = '1' AND jfy.is_tc = '1') or (jfy.status = '0' AND jfy.is_tc = '1'))
|
||
|
|
</if>
|
||
|
|
<if test="type == 2">
|
||
|
|
jfy.status = '1' AND jfy.is_tc = '1'
|
||
|
|
</if>
|
||
|
|
<if test="type == 3">
|
||
|
|
AND jfy.status = '0' AND jfy.is_tc = '1'
|
||
|
|
</if>
|
||
|
|
<if test="bidName != null and bidName != ''">
|
||
|
|
AND INSTR(jfy.single_name,#{bidName}) > 0
|
||
|
|
</if>
|
||
|
|
<if test="proType !=null and proType!=''">
|
||
|
|
AND jfy.single_type = #{proType}
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
) b
|
||
|
|
GROUP BY b.buildNo
|
||
|
|
|
||
|
|
)a ON a.buildNo = so.org_id
|
||
|
|
ORDER BY num DESC
|
||
|
|
</select>
|
||
|
|
<select id="getOrgNumAndRateByProNew" 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 b.buildNo,COUNT(b.buildNo) AS num FROM (
|
||
|
|
SELECT jfy.org AS singleNo,jfy.org AS buildNo
|
||
|
|
FROM tb_new_pro jfy
|
||
|
|
where jfy.is_pro='2'
|
||
|
|
<if test="type !=null and type != ''">
|
||
|
|
and jfy.pro_status = #{type}
|
||
|
|
</if>
|
||
|
|
<if test="type ==null and type == ''">
|
||
|
|
and jfy.pro_status = '-1'
|
||
|
|
</if>
|
||
|
|
<if test="bidName != null and bidName != ''">
|
||
|
|
AND INSTR(jfy.pro_name,#{bidName}) > 0
|
||
|
|
</if>
|
||
|
|
) b
|
||
|
|
GROUP BY b.buildNo
|
||
|
|
|
||
|
|
)a ON a.buildNo = so.org_id
|
||
|
|
ORDER BY num DESC
|
||
|
|
</select>
|
||
|
|
<!--地市周风险数量和占比-->
|
||
|
|
<select id="getOrgNumAndRateByWeek" resultType="java.util.Map">
|
||
|
|
select city_name,IFNULL(wn.num ,0) NUM
|
||
|
|
from sys_org so
|
||
|
|
left join (
|
||
|
|
select count(1) num,build_unit_code build_no
|
||
|
|
FROM jj_weeks_plan
|
||
|
|
where #{curryDay} between planned_start_date and planned_end_date
|
||
|
|
<if test='weekType==3'>
|
||
|
|
and (re_assessment_risk_level in ('三级','3') )
|
||
|
|
</if>
|
||
|
|
<if test='weekType==2'>
|
||
|
|
(re_assessment_risk_level='二级' or re_assessment_risk_level='2' )
|
||
|
|
</if>
|
||
|
|
GROUP BY build_unit_code
|
||
|
|
)wn on wn.build_no=so.org_id
|
||
|
|
ORDER BY num desc
|
||
|
|
</select>
|
||
|
|
<!--地市周风险数量和占比-二级页面-->
|
||
|
|
<select id="getOrgNumAndRateByWeekChild" 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 jwp.build_unit_code build_no ,COUNT(jwp.build_unit_code) AS num
|
||
|
|
FROM jj_weeks_plan jwp
|
||
|
|
left join jj_risk_precaution jsp on jsp.id=jwp.risk_precaution_id and jsp.delete_flag=0
|
||
|
|
LEFT JOIN sys_org so ON so.org_id=jwp.build_unit_code
|
||
|
|
left join jj_data_code jdc on jdc.code_value=jsp.work_type and jdc.code='WORK_TYPE'
|
||
|
|
left join jj_team jt on jt.id =jwp.team_id and jt.delete_flag=0
|
||
|
|
where 1=1
|
||
|
|
<if test="curryDay != null and curryDay != ''">
|
||
|
|
AND #{curryDay} between jwp.planned_start_date and jwp.planned_end_date
|
||
|
|
</if>
|
||
|
|
<if test="buildUnit != null and buildUnit != ''">
|
||
|
|
and so.city_name LIKE CONCAT('%',#{buildUnit},'%')
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="proName != null and proName != ''">
|
||
|
|
and jwp.bidding_section_name LIKE CONCAT('%',#{proName},'%')
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="workType != null and workType != ''">
|
||
|
|
and jdc.value LIKE CONCAT('%',#{workType},'%')
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="workTeam != null and workTeam != ''">
|
||
|
|
and jt.working_team_name LIKE CONCAT('%',#{workTeam},'%')
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="riskType != null and riskType != ''">
|
||
|
|
and jwp.re_assessment_risk_level =#{riskType}
|
||
|
|
</if>
|
||
|
|
GROUP BY jwp.build_unit_code
|
||
|
|
)a ON a.build_no = so.org_id
|
||
|
|
ORDER BY num DESC
|
||
|
|
</select>
|
||
|
|
<!--地市作业票数量和占比-二级页面-->
|
||
|
|
<select id="getOrgNumAndRateByTicket" 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 tti.build_unit_code build_org_no,COUNT(tti.build_unit_code) AS num
|
||
|
|
from jj_ticket tti
|
||
|
|
LEFT JOIN jj_single_project jbp on tti.single_project_code=jbp.single_project_code and jbp.delete_flag=0
|
||
|
|
left join sys_org so on so.org_id=tti.build_unit_code
|
||
|
|
where tti.ticket_status = '05' AND tti.delete_flag = '1'
|
||
|
|
<if test="ticketName != null and ticketName != ''">
|
||
|
|
and tti.ticket_name like concat('%',#{ticketName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="ticketNo != null and ticketNo != ''">
|
||
|
|
and tti.ticket_no like concat('%',#{ticketNo},'%')
|
||
|
|
</if>
|
||
|
|
<if test="signName != null and signName != ''">
|
||
|
|
and jbp.bidding_section_name like concat('%',#{signName},'%')
|
||
|
|
</if>
|
||
|
|
<if test="foreman != null and foreman != ''">
|
||
|
|
and tti.working_team_name like concat('%',#{foreman},'%')
|
||
|
|
</if>
|
||
|
|
<if test="riskType!=null and riskType!=''">
|
||
|
|
AND tti.re_assessment_risk_level IN (
|
||
|
|
<foreach collection="riskTypeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="proType != '' and proType != null and proType!=04">
|
||
|
|
AND jbp.single_project_type = #{proType}
|
||
|
|
</if>
|
||
|
|
<if test="proType != '' and proType != null and proType==04">
|
||
|
|
AND (jbp.single_project_type NOT IN ('1','3') OR jbp.pro_type IS NULL)
|
||
|
|
</if>
|
||
|
|
GROUP BY tti.build_unit_code
|
||
|
|
)a ON a.build_org_no = so.org_id
|
||
|
|
ORDER BY num DESC
|
||
|
|
</select>
|
||
|
|
<!-- 工程统计 -->
|
||
|
|
<select id="getNewProNumByType" resultType="java.lang.Integer">
|
||
|
|
select count(1) num
|
||
|
|
from tb_new_pro
|
||
|
|
WHERE is_pro='2' AND pro_status='1' and is_flag='0'
|
||
|
|
<if test="orgId!='' and orgId!=null">
|
||
|
|
AND org = #{orgId}
|
||
|
|
</if>
|
||
|
|
union all
|
||
|
|
select count(1) num
|
||
|
|
from tb_new_pro
|
||
|
|
WHERE is_pro='2' AND pro_status='1' and is_flag='0' and year_date=#{year}
|
||
|
|
<if test="orgId!='' and orgId!=null">
|
||
|
|
AND org = #{orgId}
|
||
|
|
</if>
|
||
|
|
union all
|
||
|
|
select count(1)
|
||
|
|
from tb_new_pro
|
||
|
|
WHERE is_pro='2' AND pro_status='2' and is_flag='0' and year_date=#{year}
|
||
|
|
<if test="orgId!='' and orgId!=null">
|
||
|
|
AND org = #{orgId}
|
||
|
|
</if>
|
||
|
|
union all
|
||
|
|
select count(1)
|
||
|
|
from tb_new_pro
|
||
|
|
WHERE is_pro='2' AND pro_status='3' and is_flag='0' and year_date=#{year}
|
||
|
|
<if test="orgId!='' and orgId!=null">
|
||
|
|
AND org = #{orgId}
|
||
|
|
</if>
|
||
|
|
union all
|
||
|
|
select count(1) num
|
||
|
|
from tb_new_pro
|
||
|
|
WHERE is_pro='2' AND pro_status='0' and is_flag='0' and year_date=#{year}
|
||
|
|
<if test="orgId!='' and orgId!=null">
|
||
|
|
AND org = #{orgId}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<!--根据工程类型和地市编码获取在建工程、在施工程、停工工程-->
|
||
|
|
<select id="getProNumByType" resultType="java.lang.Integer">
|
||
|
|
select count(ID) AS num
|
||
|
|
from jj_fix_ybz fy
|
||
|
|
where ( ( fy.`status`=1 AND fy.is_tc=1) OR ( fy.`status`=0 AND fy.is_tc=1))
|
||
|
|
<if test="proType !=null and proType!='' and proType != 04">
|
||
|
|
AND single_type = #{proType}
|
||
|
|
</if>
|
||
|
|
<if test="proType !=null and proType!='' and proType == 04">
|
||
|
|
AND single_type NOT IN ('01','03')
|
||
|
|
</if>
|
||
|
|
<if test="orgId!='' and orgId!=null">
|
||
|
|
AND build_org_no = #{orgId}
|
||
|
|
</if>
|
||
|
|
union all
|
||
|
|
select count(ID) AS num
|
||
|
|
from jj_fix_ybz fy
|
||
|
|
where fy.`status`=1 AND fy.is_tc=1
|
||
|
|
<if test="proType !=null and proType!='' and proType != 04">
|
||
|
|
AND single_type = #{proType}
|
||
|
|
</if>
|
||
|
|
<if test="proType !=null and proType!='' and proType == 04">
|
||
|
|
AND single_type NOT IN ('01','03')
|
||
|
|
</if>
|
||
|
|
<if test="orgId!='' and orgId!=null">
|
||
|
|
AND build_org_no = #{orgId}
|
||
|
|
</if>
|
||
|
|
union all
|
||
|
|
select count(ID) AS num
|
||
|
|
from jj_fix_ybz fy
|
||
|
|
where fy.`status`=0 AND fy.is_tc=1
|
||
|
|
<if test="proType !=null and proType!='' and proType != 04">
|
||
|
|
AND single_type = #{proType}
|
||
|
|
</if>
|
||
|
|
<if test="proType !=null and proType!='' and proType == 04">
|
||
|
|
AND single_type NOT IN ('01','03')
|
||
|
|
</if>
|
||
|
|
<if test="orgId!='' and orgId!=null">
|
||
|
|
AND build_org_no = #{orgId}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<!--获取工程信息 -->
|
||
|
|
<select id="getNewProListByType" resultType="com.sercurityControl.proteam.domain.ProData">
|
||
|
|
select org_name orgName,voltage_level voltageLevel,pro_name proName,img_progress imageProcess,single_type singType,
|
||
|
|
IFNULL(build_scale_line,build_scale_power) buildScale,IFNULL(physical_quantity_line,physical_quantity_main_tran) physicalQuantity,
|
||
|
|
year_date yearDate,kg_date kgTime,tc_date tcTime
|
||
|
|
from tb_new_pro pro
|
||
|
|
WHERE pro.is_pro='2' AND is_flag = '0'
|
||
|
|
<if test="yearDate!=null and yearDate!='' ">
|
||
|
|
AND year_date=#{yearDate}
|
||
|
|
</if>
|
||
|
|
<if test="type != null and type != ''">
|
||
|
|
AND pro_status = #{type}
|
||
|
|
</if>
|
||
|
|
<if test="type == null or type == ''">
|
||
|
|
AND pro_status = '-1'
|
||
|
|
</if>
|
||
|
|
<if test="buildCode!=null and buildCode!=''">
|
||
|
|
AND org IN (
|
||
|
|
<foreach collection="buildCodeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="bidName != null and bidName != ''">
|
||
|
|
AND INSTR(pro_name,#{bidName}) > 0
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<!--获取在建、在施、停工数据列表-->
|
||
|
|
<select id="getProListByType" resultType="com.sercurityControl.proteam.domain.ProData">
|
||
|
|
SELECT DISTINCT so.city_name AS buildUnit,
|
||
|
|
jfy.single_name AS bidName,
|
||
|
|
CASE jfy.single_type WHEN '01' THEN '变电'
|
||
|
|
WHEN '03' THEN '线路'
|
||
|
|
ELSE '其他' END AS proType,
|
||
|
|
jfy.jl_enter_name AS jlUnit,
|
||
|
|
jfy.sg_enter_name AS workUnit
|
||
|
|
FROM jj_fix_ybz jfy
|
||
|
|
LEFT JOIN sys_org so ON jfy.build_org_no = so.org_id
|
||
|
|
<where>
|
||
|
|
|
||
|
|
<if test='type == 1'>
|
||
|
|
and (( jfy.status = '1' AND jfy.is_tc = '1') or (jfy.status = '0' AND jfy.is_tc = '1'))
|
||
|
|
</if>
|
||
|
|
<if test="type == 2">
|
||
|
|
jfy.status = '1' AND jfy.is_tc = '1'
|
||
|
|
</if>
|
||
|
|
<if test="type == 3">
|
||
|
|
AND jfy.status = '0' AND jfy.is_tc = '1'
|
||
|
|
</if>
|
||
|
|
<if test="buildCode!=null and buildCode!=''">
|
||
|
|
AND jfy.build_org_no IN (
|
||
|
|
<foreach collection="buildCodeList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="bidName != null and bidName != ''">
|
||
|
|
AND INSTR(jfy.single_name,#{bidName}) > 0
|
||
|
|
</if>
|
||
|
|
<if test="proType !=null and proType!='' and proType!=04">
|
||
|
|
AND jfy.single_type = #{proType}
|
||
|
|
</if>
|
||
|
|
<if test="proType !=null and proType!='' and proType==04">
|
||
|
|
AND jfy.single_type NOT IN ('01','03')
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
<!--查询-->
|
||
|
|
<select id="getClassMettingData" parameterType="com.sercurityControl.proteam.domain.ClassMettingStaVo" resultType="com.sercurityControl.proteam.domain.ClassMettingStaVo">
|
||
|
|
<if test="type == 2">
|
||
|
|
SELECT so.city_name name ,ifnull(num,0) num
|
||
|
|
from sys_org so
|
||
|
|
LEFT join(
|
||
|
|
select jcm.build_unit_code org_id,COUNT(jcm.id) num
|
||
|
|
from jj_class_meetting jcm
|
||
|
|
where jcm.current_constr_date=#{curryDay} AND jcm.delete_flag=0
|
||
|
|
GROUP BY so.build_unit_code
|
||
|
|
)cm on cm.org_id=so.org_id
|
||
|
|
ORDER BY num desc
|
||
|
|
</if>
|
||
|
|
<if test="type==1">
|
||
|
|
SELECT ifNull(COUNT(id),0) num,'二级' name
|
||
|
|
FROM jj_class_meetting where current_constr_date=#{curryDay} and re_assessment_risk_level in ('2','二级') AND delete_flag = '0'
|
||
|
|
union ALL
|
||
|
|
SELECT ifNull(COUNT(id),0),'三级' name
|
||
|
|
FROM jj_class_meetting where current_constr_date=#{curryDay} and re_assessment_risk_level in ('3','三级') AND delete_flag = '0'
|
||
|
|
union ALL
|
||
|
|
|
||
|
|
SELECT ifNull(COUNT(id),0),'四级' name
|
||
|
|
FROM jj_class_meetting where current_constr_date=#{curryDay} and re_assessment_risk_level in ('4','四级') AND delete_flag = '0'
|
||
|
|
union ALL
|
||
|
|
SELECT ifNull(COUNT(id),0),'五级' name
|
||
|
|
FROM jj_class_meetting where current_constr_date=#{curryDay} and re_assessment_risk_level in ('5','五级') AND delete_flag = '0'
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<select id="getClassMettingList" parameterType="com.sercurityControl.proteam.domain.ClassMettingStaVo" resultType="com.sercurityControl.proteam.domain.ProData">
|
||
|
|
SELECT jcm.current_constr_date curryDay,jcmi.work_manage_phone workManagePhone,
|
||
|
|
jcmi.work_manage workManage,
|
||
|
|
jcm.bidding_section_name proName,
|
||
|
|
CASE jcm.current_construction_status WHEN '01' THEN '开工'
|
||
|
|
WHEN '02' THEN '暂停'
|
||
|
|
WHEN '03' THEN '进行中'
|
||
|
|
WHEN '04' THEN '完工'
|
||
|
|
END AS state,
|
||
|
|
jcm.re_assessment_risk_level riskLevel,
|
||
|
|
jcmi.work_content workContent,
|
||
|
|
so.city_name AS orgName
|
||
|
|
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
|
||
|
|
where jcm.current_constr_date=#{curryDay} AND jcm.delete_flag = '0'
|
||
|
|
<if test="orgList!=null and orgList!=''">
|
||
|
|
AND jcm.build_unit_code IN (
|
||
|
|
<foreach collection="orgList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="riskList!=null and riskList!=''">
|
||
|
|
AND jcm.re_assessment_risk_level IN (
|
||
|
|
<foreach collection="riskList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="keyWord!=null and keyWord!=''">
|
||
|
|
AND (
|
||
|
|
INSTR(jcmi.work_manage,#{keyWord}) > 0 OR
|
||
|
|
INSTR(jcm.bidding_section_name,#{keyWord}) > 0
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="state!=null and state!=''">
|
||
|
|
AND current_construction_status = #{state}
|
||
|
|
</if>
|
||
|
|
ORDER BY jcm.current_construction_status ASC,jcm.re_assessment_risk_level DESC
|
||
|
|
</select>
|
||
|
|
<!--地市站班会数量和占比-二级页面-->
|
||
|
|
<select id="getOrgNumAndRateByClass" 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 jcm.build_unit_code org,COUNT(jcm.id) AS num
|
||
|
|
FROM jj_class_meetting jcm
|
||
|
|
left join jj_class_metting_info jcmi on jcm.id=jcmi.class_id
|
||
|
|
WHERE delete_flag = '0' AND current_constr_date=#{curryDay}
|
||
|
|
<if test="orgList!=null and orgList!=''">
|
||
|
|
AND jcm.build_unit_code IN (
|
||
|
|
<foreach collection="orgList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="riskList!=null and riskList!=''">
|
||
|
|
AND jcm.re_assessment_risk_level IN (
|
||
|
|
<foreach collection="riskList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="keyWord!=null and keyWord!=''">
|
||
|
|
AND (
|
||
|
|
INSTR(jcmi.work_manage,#{keyWord}) > 0 OR
|
||
|
|
INSTR(jcm.bidding_section_name,#{keyWord}) > 0
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="state!=null and state!=''">
|
||
|
|
AND current_construction_status = #{state}
|
||
|
|
</if>
|
||
|
|
GROUP BY build_unit_code
|
||
|
|
)a ON a.org = so.org_id
|
||
|
|
ORDER BY num DESC
|
||
|
|
</select>
|
||
|
|
<!--查询日计划数据-->
|
||
|
|
<select id="getDailPlanList" parameterType="com.sercurityControl.proteam.domain.DailyPlanVo" resultType="com.sercurityControl.proteam.domain.DailyPlanVo">
|
||
|
|
SELECT plan.create_time createTime,so.city_name orgName,plan.bid_name bidName,plan.job_num jobNum,plan.zypfzr,plan.aqjhr
|
||
|
|
,plan.zybw,plan.zygx,plan.zynr,plan.fxdj,concat( plan.dqztsgjd,'%') dqztsgjd,plan.bzmc,concat(plan.bzz_name,plan.bzz_lxfs) bzzName,
|
||
|
|
plan.bzaqy,plan.bzzjy,plan.work_gk_content workGkContent,plan.work_time workTime,concat( plan.xmjl,plan.xmjl_lxfs) xmjl
|
||
|
|
FROM t_daily_plan plan
|
||
|
|
left join sys_org so on so.org_id=plan.build_org_no
|
||
|
|
<if test="planType!=null and planType!='' ">
|
||
|
|
left join t_class_metting cm on cm.work_manager_num=plan.bzz_bak_ic and cm.work_day=plan.work_time
|
||
|
|
</if>
|
||
|
|
<where>
|
||
|
|
<if test="planType!=null and planType!='' ">
|
||
|
|
<if test="planType=='01' ">
|
||
|
|
and cm.class_id is not null
|
||
|
|
</if>
|
||
|
|
<if test="planType=='02' ">
|
||
|
|
and cm.class_id is null
|
||
|
|
</if>
|
||
|
|
</if>
|
||
|
|
<if test="workTime!=null and workTime!=''">
|
||
|
|
and plan.work_time=#{workTime}
|
||
|
|
</if>
|
||
|
|
<if test="orgList!=null and orgList!=''">
|
||
|
|
and plan.build_org_no in(
|
||
|
|
<foreach collection="orgList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="keyWord!=null and keyWord!=''">
|
||
|
|
and (
|
||
|
|
plan.xmjl like concat('%',#{keyWord},'%') or
|
||
|
|
plan.xmjl_lxfs like concat('%',#{keyWord},'%') or
|
||
|
|
plan.zynr like concat('%',#{keyWord},'%') or
|
||
|
|
plan.zybw like concat('%',#{keyWord},'%') or
|
||
|
|
plan.fxdj like concat('%',#{keyWord},'%') or
|
||
|
|
plan.zygx like concat('%',#{keyWord},'%') or
|
||
|
|
plan.work_gk_content like concat('%',#{keyWord},'%') or
|
||
|
|
plan.bzzjy like concat('%',#{keyWord},'%') or
|
||
|
|
plan.bzaqy like concat('%',#{keyWord},'%') or
|
||
|
|
plan.bzz_name like concat('%',#{keyWord},'%') or
|
||
|
|
plan.bzz_lxfs like concat('%',#{keyWord},'%') or
|
||
|
|
plan.job_num like concat('%',#{keyWord},'%') or
|
||
|
|
plan.work_time like concat('%',#{keyWord},'%')
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
<select id="getNewDailPlanList1" parameterType="com.sercurityControl.proteam.domain.DailyPlanHome" resultType="com.sercurityControl.proteam.domain.DailyPlanHome">
|
||
|
|
SELECT jtt.bidding_section_name,so.city_name orgName,jtt.re_assessment_risk_level riskLevel,
|
||
|
|
concat(jio.replenish_content_1,IFNULL(jio.replenish_content_2,''),IFNULL(replenish_content_3,'')
|
||
|
|
,IFNULL(jio.replenish_content_4,''),IFNULL(jio.replenish_content_5,'')
|
||
|
|
,IFNULL(jio.replenish_content_6,''),IFNULL(jio.replenish_content_7,'')
|
||
|
|
) jobManRisk,jtt.id ticketId
|
||
|
|
from jj_ticket jtt
|
||
|
|
LEFT JOIN sys_org so on so.org_id=jtt.build_unit_code
|
||
|
|
left join jj_single_project jsp ON jsp.single_project_code=jtt.single_project_code
|
||
|
|
left join jj_info jio on jio.ref_id=jtt.id and jio.ext_type='40' and jio.content_type='03' -- 主要风险
|
||
|
|
WHERE jtt.delete_flag=0 and jtt.ticket_status='05'
|
||
|
|
<if test="orgList!=null and orgList!=''">
|
||
|
|
and jtt.build_unit_code in(
|
||
|
|
<foreach collection="orgList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jsp.single_project_type IN ('00','1')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jsp.single_project_type IN ('3','05')
|
||
|
|
</if>
|
||
|
|
<if test="keyWord!=null and keyWord!=''">
|
||
|
|
and (
|
||
|
|
jtt.bidding_section_name like concat('%',#{keyWord},'%') or
|
||
|
|
tti.city_name like concat('%',#{keyWord},'%') or
|
||
|
|
jio.replenish_content_1 like concat('%',#{keyWord},'%') or
|
||
|
|
jio.replenish_content_2 like concat('%',#{keyWord},'%') or
|
||
|
|
jio.replenish_content_3 like concat('%',#{keyWord},'%') or
|
||
|
|
jio.replenish_content_4 like concat('%',#{keyWord},'%') or
|
||
|
|
jio.replenish_content_5 like concat('%',#{keyWord},'%') or
|
||
|
|
jio.replenish_content_6 like concat('%',#{keyWord},'%') or
|
||
|
|
jio.replenish_content_7 like concat('%',#{keyWord},'%')
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<select id="getNewDailPlanList2" parameterType="com.sercurityControl.proteam.domain.DailyPlanHome" resultType="com.sercurityControl.proteam.domain.DailyPlanHome">
|
||
|
|
select jcmi.team_name teamName,jcmi.work_manage workManage, jcmi.work_content workContent,jcm.bidding_section_name proName,
|
||
|
|
jcmi.work_type workType,jcmi.work_gx workGx,jcm.re_assessment_risk_level riskLevel,so.city_name orgName
|
||
|
|
from jj_class_meetting jcm
|
||
|
|
left join sys_org so on jcm.build_unit_code=so.org_id
|
||
|
|
left join jj_class_metting_info jcmi on jcm.id=jcmi.class_id
|
||
|
|
left join jj_single_project jsp on jsp.single_project_code=jcm.single_project_code
|
||
|
|
where jcm.current_constr_date=current_date () AND jcm.delete_flag='0'
|
||
|
|
<if test="orgList!=null and orgList!=''">
|
||
|
|
and jcm.build_unit_code in(
|
||
|
|
<foreach collection="orgList" item="item" separator=",">
|
||
|
|
#{item}
|
||
|
|
</foreach>
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
<if test="proType == '01'">
|
||
|
|
AND jsp.single_project_type IN ('00','1')
|
||
|
|
</if>
|
||
|
|
<if test="proType == '03'">
|
||
|
|
AND jsp.single_project_type IN ('3','05')
|
||
|
|
</if>
|
||
|
|
<if test="keyWord!=null and keyWord!=''">
|
||
|
|
and (
|
||
|
|
jcmi.work_manage like concat('%',#{keyWord},'%') or
|
||
|
|
jcmi.team_name like concat('%',#{keyWord},'%') or
|
||
|
|
jcmi.work_content like concat('%',#{keyWord},'%') or
|
||
|
|
jcmi.work_type like concat('%',#{keyWord},'%') or
|
||
|
|
jcmi.work_gx like concat('%',#{keyWord},'%') or
|
||
|
|
jcm.bidding_section_name like concat('%',#{keyWord},'%')
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<select id="getOrgNumAndRateByDailPlan" resultType="java.util.Map" parameterType="com.sercurityControl.proteam.domain.DailyPlanVo">
|
||
|
|
SELECT so.org_id code,so.city_name name,IFNULL(a.num,0) num
|
||
|
|
FROM sys_org so
|
||
|
|
LEFT JOIN (
|
||
|
|
SELECT plan.build_unit_code build_org_no,COUNT(plan.id) num
|
||
|
|
FROM jj_day_plan plan
|
||
|
|
<if test="planType!=null and planType!='' ">
|
||
|
|
left join jj_class_meetting cm on cm.id=plan.tool_box_talk_id
|
||
|
|
</if>
|
||
|
|
<where>
|
||
|
|
<if test="planType!=null and planType!='' ">
|
||
|
|
<if test="planType=='01' ">
|
||
|
|
and cm.id is not null
|
||
|
|
</if>
|
||
|
|
<if test="planType=='02' ">
|
||
|
|
and cm.id is null
|
||
|
|
</if>
|
||
|
|
</if>
|
||
|
|
|
||
|
|
</where>
|
||
|
|
GROUP BY plan.build_unit_code
|
||
|
|
)a on a.build_org_no = so.org_id
|
||
|
|
ORDER BY num DESC
|
||
|
|
</select>
|
||
|
|
<select id="getWeekRiskNumByWeekTime" resultType="java.util.Map" parameterType="String" >
|
||
|
|
SELECT
|
||
|
|
COUNT(1) AS planNum ,
|
||
|
|
COUNT(IF(wplan.re_assessment_risk_level = '2',1,NULL)) AS twoRisk,
|
||
|
|
COUNT(IF(wplan.re_assessment_risk_level = '3' ,1,NULL)) AS threeRisk,
|
||
|
|
COUNT(IF((wplan.re_assessment_risk_level = '4' or wplan.re_assessment_risk_level = '5'),1,NULL)) AS foureRisk
|
||
|
|
FROM jj_weeks_plan wplan
|
||
|
|
WHERE (wplan.planned_start_date BETWEEN #{startTime} and #{endTime}
|
||
|
|
or wplan.planned_end_date BETWEEN #{startTime} and #{endTime})
|
||
|
|
</select>
|
||
|
|
<select id="getWeekRiskByRiskLevel" parameterType="String" resultType="com.sercurityControl.proteam.domain.MapsValueVo">
|
||
|
|
select '合计' name ,COUNT(1) num
|
||
|
|
from jj_weeks_plan jwp
|
||
|
|
left join sys_org so ON so.org_id=jwp.build_unit_code
|
||
|
|
WHERE (jwp.planned_start_date BETWEEN #{startTime} and #{endTime}
|
||
|
|
or jwp.planned_end_date BETWEEN #{startTime} and #{endTime})
|
||
|
|
and jwp.re_assessment_risk_level=#{riskLevel}
|
||
|
|
union ALL
|
||
|
|
select so.city_name name ,COUNT(1) num
|
||
|
|
from jj_weeks_plan jwp
|
||
|
|
left join sys_org so ON so.org_id=jwp.build_unit_code
|
||
|
|
WHERE (jwp.planned_start_date BETWEEN #{startTime} and #{endTime}
|
||
|
|
or jwp.planned_end_date BETWEEN #{startTime} and #{endTime}) and jwp.re_assessment_risk_level=#{riskLevel}
|
||
|
|
GROUP BY jwp.build_unit_code
|
||
|
|
</select>
|
||
|
|
<select id="getNexWeekPro" parameterType="String" resultType="com.sercurityControl.proteam.domain.vo.WeekPlanVo">
|
||
|
|
select so.abb_name cityName,jsp.work_content workContent,jwp.bidding_section_name proName,
|
||
|
|
jdc.`value` workType
|
||
|
|
from jj_weeks_plan jwp
|
||
|
|
left join jj_risk_precaution jsp ON jsp.id=jwp.risk_precaution_id
|
||
|
|
left join jj_data_code jdc on jdc.code_value=jsp.work_type and jdc.`code`='WORK_TYPE'
|
||
|
|
left join sys_org so ON so.org_id=jwp.build_unit_code
|
||
|
|
WHERE (jwp.planned_start_date BETWEEN #{startTime} and #{endTime}
|
||
|
|
or jwp.planned_end_date BETWEEN #{startTime} and #{endTime}) and jwp.re_assessment_risk_level=#{riskLevel}
|
||
|
|
</select>
|
||
|
|
<select id="getAllRiskLevelNum" resultType="java.util.Map" parameterType="String" >
|
||
|
|
SELECT
|
||
|
|
COUNT(1) AS planNum ,
|
||
|
|
COUNT(IF(wplan.re_assessment_risk_level = '2',1,NULL)) AS twoRisk,
|
||
|
|
COUNT(IF(wplan.re_assessment_risk_level = '3' ,1,NULL)) AS threeRisk,
|
||
|
|
COUNT(IF((wplan.re_assessment_risk_level = '4' or wplan.re_assessment_risk_level = '5') ,1,NULL)) AS foureRisk
|
||
|
|
FROM jj_weeks_plan wplan
|
||
|
|
WHERE #{time} BETWEEN wplan.planned_start_date and wplan.planned_end_date
|
||
|
|
</select>
|
||
|
|
<select id="getWzXx" parameterType="String" resultType="Integer">
|
||
|
|
select count(1)
|
||
|
|
FROM t_notice_voi
|
||
|
|
where (status=1 or status=3) and org=#{orgId} and is_flag=0
|
||
|
|
</select>
|
||
|
|
<!--是否报岗-->
|
||
|
|
<select id="getIsBg" resultType="Integer" parameterType="String">
|
||
|
|
select count(1)
|
||
|
|
from t_job_application
|
||
|
|
WHERE curry_day=#{nowDay} and org_id=#{orgId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getGtList" resultType="com.sercurityControl.proteam.dutyTask.domain.TowerVo">
|
||
|
|
select pro_name proName,gt_name towerName,lat,lon ,bid_no proNo
|
||
|
|
from t_pro_gt
|
||
|
|
where pro_no='1612P021000W01' AND is_flag = '0'
|
||
|
|
AND lat IS not null
|
||
|
|
</select>
|
||
|
|
<select id="getWorkInfo" resultType="com.sercurityControl.proteam.domain.WorkInfoVo">
|
||
|
|
select jrp.work_site_name workSite,jrp.work_type workType,
|
||
|
|
jrp.work_content workContent,jrp.work_procedure workGx
|
||
|
|
from jj_weeks_plan jwp
|
||
|
|
left join jj_risk_precaution jrp on jwp.risk_precaution_id=jrp.id
|
||
|
|
left join jj_data_code jdc on jrp.work_type=jdc.code_value and jdc.code='WORK_TYPE'
|
||
|
|
WHERE jwp.ticket_id=#{ticketId} AND jrp.work_content is not null
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|