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

51 lines
2.9 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.WeekRiskMapper">
<!--查询球机国标编码校验-->
<select id="getWeekRiskList" resultType="com.sercurityControl.proteam.domain.WeekRiskEntity" parameterType="com.sercurityControl.proteam.domain.WeekRiskEntity">
select jwp.id weekId,jwp.planned_start_date startDate,jwp.planned_end_date endDate,
jtm.working_team_name teamName,so.city_name buildUnit,
jwp.build_unit_code buildNo,jwp.re_assessment_risk_level riskLevel,
jsp.work_content workContent,jwp.bidding_section_name projectName,
jsp.work_type workType,jsp.work_procedure workGx,jsp.work_site_name workName
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 jj_team jtm on jwp.team_id=jtm.id and jtm.delete_flag=0
left join sys_org so on so.org_id=jwp.build_unit_code
<where>
<if test="keyWord != null and keyWord != ''">
and (
jtm.working_team_name LIKE CONCAT('%',#{keyWord},'%') or
so.city_name LIKE CONCAT('%',#{keyWord},'%') or
jwp.re_assessment_risk_level LIKE CONCAT('%',#{keyWord},'%') or
jsp.work_content LIKE CONCAT('%',#{keyWord},'%') or
jwp.bidding_section_name LIKE CONCAT('%',#{keyWord},'%')
)
</if>
<if test="orgList!=null and orgList!=''">
AND jwp.build_unit_code IN (
<foreach collection="orgList" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
AND DATE_FORMAT(jwp.planned_start_date,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate},'%Y-%m-%d') and DATE_FORMAT(#{endDate},'%Y-%m-%d')
AND DATE_FORMAT(jwp.planned_end_date,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate},'%Y-%m-%d') and DATE_FORMAT(#{endDate},'%Y-%m-%d')
</if>
<if test="proList!=null and proList!=''">
AND jwp.bidding_section_name IN (
<foreach collection="proList" item="item" separator=",">
#{item}
</foreach>
)
</if>
</where>
</select>
<select id="getProject" resultType="com.sercurityControl.proteam.domain.WeekRiskEntity">
select distinct bidding_section_name projectName
from jj_weeks_plan jwp
</select>
</mapper>