bns_jjsp_service/securityControl-modules/securityControl-decision/target/classes/mapper/ProjectSketchMapper.xml

82 lines
5.0 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.decision.mapper.ProjectSketchMapper">
<select id="getProjectList" resultType="com.sercurityControl.decision.domain.ProjectSketch">
select id, project_name, bid_no, build_org_name, build_org_no, descirbe, money,
location, stage, quality_feature, quality_demand, check_demand,
(select date_format(start_time,'%Y-%m-%d') from jj_bid_project b where project_sketch.bid_no = b.bid_no limit 1) as start_date
from project_sketch
<where>
<if test="projectName != null and projectName != ''"> and project_name like concat('%',#{projectName},'%')</if>
<if test="buildOrgNo != null and buildOrgNo != ''"> and build_org_no = #{buildOrgNo}</if>
</where>
union all
select '' as id ,bid_name as project_name,bid_no,build_unit as build_org_name,build_no as build_org_no,'' as descirbe,'' as money,
'' as location, '' as stage, '' as quality_feature, '' as quality_demand, '' as check_demand,
date_format(start_time,'%Y-%m-%d') as start_date
from jj_bid_project
<where>
and not exists(select 1 from project_sketch p where jj_bid_project.bid_no = p.bid_no)
<if test="projectName != null and projectName != ''"> and bid_name like concat('%',#{projectName},'%')</if>
<if test="buildOrgNo != null and buildOrgNo != ''"> and build_no = #{buildOrgNo}</if>
</where>
</select>
<select id="getList" resultType="com.sercurityControl.decision.domain.ProjectSketch">
select id, project_name, bid_no, build_org_name, build_org_no, descirbe, money,
location, stage, quality_feature, quality_demand, check_demand
from project_sketch
<where>
<if test="projectName != null and projectName != ''"> and project_name like concat('%',#{projectName},'%')</if>
<if test="buildOrgNo != null and buildOrgNo != ''"> and build_org_no = #{buildOrgNo}</if>
</where>
</select>
<select id="getRiskList" resultType="com.sercurityControl.decision.domain.vo.SafeRiskVo">
select zyp.job_name as ticket_name, zyp.job_gx,zyp.job_site,org_name as build_org_name,
job_risk_fc_level_num as risk_grade, zyp.project_name,date(job_actual_start_time) as start_date,date(job_actual_end_time) as end_date
from t_ticket_info zyp
inner join sys_org o on o.org_id = zyp.build_org_no
<where>
<if test="projectName != null and projectName != ''">and zyp.`project_name` like concat('%',#{projectName},'%') </if>
<if test="buildOrgNo != null and buildOrgNo != ''">and zyp.`build_org_no` = #{buildOrgNo} </if>
<if test="riskGrade != null and riskGrade != ''">and zyp.`job_risk_fc_level_num` = #{riskGrade} </if>
<if test="startDate != null and startDate != ''">and job_actual_start_time >= #{startDate} and job_actual_end_time &lt;= #{endDate}</if>
</where>
</select>
<select id="getNoticeList" resultType="com.sercurityControl.decision.domain.SeriousPeccancy">
select org_name as build_org_name,level_id,content,tnv.create_time as supervise_date ,tnv.status,pro_name as project_name
from t_notice_voi tnv
inner join sys_org o on o.org_id = tnv.org
<where>
<if test="projectName != null and projectName != ''"> and tnv.pro_name like concat('%',#{projectName},'%')</if>
<if test="buildOrgNo != null and buildOrgNo != ''"> and tnv.org = #{buildOrgNo}</if>
<if test="startDate != null and startDate != ''">and tnv.create_time = #{startDate} </if>
</where>
</select>
<insert id="insert">
insert into project_sketch (id, project_name, bid_no, build_org_name, build_org_no, descirbe, money, location, stage,
quality_feature, quality_demand, check_demand, create_time, update_time)
values (#{id},#{projectName},#{bidNo},#{buildOrgName},#{buildOrgNo},#{descirbe},#{money},#{location},#{stage},
#{qualityFeature},#{qualityDemand},#{checkDemand},now(),now())
</insert>
<update id="update">
update project_sketch
<set>
<if test="descirbe != null and descirbe != ''">descirbe = #{descirbe}, </if>
<if test="money != null and money != ''">money = #{money}, </if>
<if test="location != null and location != ''">location = #{location}, </if>
<if test="stage != null and stage != ''">stage = #{stage}, </if>
<if test="qualityFeature != null and qualityFeature != ''">quality_feature = #{qualityFeature}, </if>
<if test="qualityDemand != null and qualityDemand != ''">quality_demand = #{qualityDemand}, </if>
<if test="checkDemand != null and checkDemand != ''">check_demand = #{checkDemand}, </if>
update_time = now()
</set>
where id = #{id}
</update>
</mapper>