137 lines
6.1 KiB
XML
137 lines
6.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.sercurityControl.proteam.mapper.NewDutyMapper">
|
|
|
|
|
|
<select id="getPageList" resultType="com.sercurityControl.proteam.domain.vo.NewDutyVo">
|
|
select jcm.id classId,jcm.current_construction_status workDay,cmw.warn_type warnInfo,
|
|
jcmp.real_name bzzName,jus.mobile bzzPhone,jcm.ticket_no ticketNo,cmc.is_pj isPj,
|
|
jcm.bidding_section_name bidName,jcm.bidding_section_code bidCode,cmc.is_check isXs,
|
|
jcm.current_constr_headcount sgnum,jcm.build_unit_code org,so.city_name orgName,
|
|
CASE jcm.current_construction_status
|
|
WHEN '01' THEN '开工'
|
|
WHEN '02' THEN '暂停'
|
|
WHEN '03' THEN '完工'
|
|
WHEN '04' THEN '完工' END AS sgStatus,
|
|
jcmp.id_card bzzNum,jcm.re_assessment_risk_level riskLevel,
|
|
td.mac_id macId,td.puid,td.state ballStatus,
|
|
jt.working_team_name teamName,jt.team_id teamId,
|
|
jcm.prj_name proName,
|
|
ju.unit_name sgdw, -- 施工单位
|
|
jcm.supervision_unit_name jldw -- 监理单位
|
|
from jj_class_meetting jcm
|
|
LEFT join jj_class_metting_info jcmi on jcmi.class_id= jcm.id
|
|
LEFT join jj_ticket jt on jcm.ticket_id=jt.id
|
|
left join sys_org so on so.org_id=jcm.build_unit_code
|
|
left join t_class_metting_check cmc on cmc.class_id=jcm.id
|
|
left join jj_ball jbl on jbl.id=jcm.camera_id2
|
|
LEFT join t_device td on td.t_code=jbl.camera_no and td.is_flag=0
|
|
left join jj_unit ju on ju.unified_social_credit_id=jcm.constr_unified_social_credit_id -- and ju.unit_type=6 -- 施工单位
|
|
left join t_class_metting_warn cmw on cmw.class_id=jcm.id
|
|
left join jj_class_meeting_people jcmp on jcmp.tool_box_talk_id=jcm.id and jcmp.position_code='0900101' and jcmp.position_flag='1'
|
|
LEFT JOIN jj_user jus on jus.id=jcmp.personnel_id
|
|
WHERE jcm.delete_flag=0
|
|
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
|
|
and jcm.current_constr_date BETWEEN #{startTime} AND #{endTime}
|
|
</if>
|
|
<if test="isSup == 1">
|
|
AND (cmc.quality_user = 'AU' OR cmc.quality_user IS NULL)
|
|
</if>
|
|
<if test="isSup == 2">
|
|
AND cmc.check_user = #{currentUserId}
|
|
</if>
|
|
<if test="isSup == 3">
|
|
AND jcm.build_unit_code = #{currentUserOrgId}
|
|
</if>
|
|
<if test="sgs!=null and sgs!=''">
|
|
AND jcm.current_construction_status IN (
|
|
<foreach collection="sgs" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="orgIds!=null and orgIds!=''">
|
|
AND jcm.build_unit_code IN (
|
|
<foreach collection="orgIds" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="keyWord!=null and keyWord!=''">
|
|
AND (
|
|
INSTR(cmw.warn_type,#{keyWord}) > 0 OR
|
|
INSTR(jcm.bidding_section_code,#{keyWord}) > 0 OR
|
|
INSTR(jcm.bidding_section_name,#{keyWord}) > 0 OR
|
|
INSTR(jt.working_team_name,#{keyWord}) > 0 OR
|
|
INSTR(td.td_code,#{keyWord}) > 0 OR
|
|
INSTR(td.mac_id,#{keyWord}) > 0 OR
|
|
INSTR(td.td_code,#{keyWord}) > 0 OR
|
|
INSTR(jcm.ticket_no,#{keyWord}) > 0 OR
|
|
INSTR(jcm.re_assessment_risk_level,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_content,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_manage_phone,#{keyWord}) > 0 OR
|
|
INSTR(so.city_name,#{keyWord}) > 0 OR
|
|
INSTR(jcmi.work_manage,#{keyWord}) > 0
|
|
)
|
|
</if>
|
|
ORDER BY jcm.create_time desc
|
|
</select>
|
|
<select id="getAllTask" resultType="java.lang.Integer">
|
|
select count(distinct cm.id)
|
|
from jj_class_meetting cm
|
|
left join t_class_metting_check cmc on cmc.class_id=cm.id
|
|
LEFT join sys_user su on su.id=cmc.check_user
|
|
where cm.delete_flag=0
|
|
<if test="workDay!=null and workDay!=''">
|
|
and cm.current_constr_date=current_date()
|
|
</if>
|
|
<if test="isSup == 1">
|
|
AND (cmc.quality_user = 'AU' OR cmc.quality_user IS NULL)
|
|
</if>
|
|
<if test="isSup == 2">
|
|
AND cmc.check_user = #{currentUserId}
|
|
</if>
|
|
<if test="isSup == 3">
|
|
AND cm.build_unit_code = #{currentUserOrgId}
|
|
</if>
|
|
<if test="sgStatus!=null and sgStatus!=''">
|
|
AND cm.current_construction_status=#{sgStatus}
|
|
</if>
|
|
<if test="isXs!=null and isXs!=''">
|
|
AND cmc.is_check=#{isXs}
|
|
</if>
|
|
</select>
|
|
<select id="getHsNum" resultType="java.lang.Integer">
|
|
select IFNULL(count(1),0)
|
|
from t_user_handle tuh
|
|
left join jj_class_meetting cm on cm.id=tuh.fzr_num
|
|
where DATE_FORMAT(tuh.create_time, '%Y-%m-%d')=CURRENT_DATE
|
|
and cm.current_constr_date=current_date()
|
|
<if test="isSup == 2">
|
|
AND tuh.user = #{currentUserId}
|
|
</if>
|
|
<if test="isSup == 3">
|
|
AND cm.current_construction_status = #{currentUserOrgId}
|
|
</if>
|
|
</select>
|
|
<!--今日违章统计-->
|
|
<select id="getDutyWz" resultType="java.lang.Integer">
|
|
select count(1)
|
|
FROM t_notice_voi tnv
|
|
where tnv.create_time=current_date() AND tnv.status!='8'
|
|
and tnv.is_flag = '0'
|
|
<if test="isSup == 2 or isSup == 3">
|
|
AND tnv.iss_user = #{currentUserId}
|
|
</if>
|
|
<if test="sgs!=null and sgs!=''">
|
|
AND tnv.status IN (
|
|
<foreach collection="sgs" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
</select>
|
|
|
|
</mapper>
|
|
|