bns-zhgd-service/bonus-modules/bonus-base/src/main/resources/mapper/smartsite/basic/TtProjectSingleMapper.xml

129 lines
9.7 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.bonus.base.basic.mapper.TtProjectSingleMapper">
<insert id="addTtProjectSingle">
insert into tt_project_single
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectSingleName != null and projectSingleName != ''">project_single_name,</if>
<if test="projectId != null">project_id,</if>
<if test="projectSingleCode != null and projectSingleCode != ''">project_single_code,</if>
<if test="safeCode != null">safe_code,</if>
<if test="projectType != null and projectType != ''">project_type,</if>
<if test="detailType != null and detailType != ''">detail_type,</if>
<if test="projectStatus != null and projectStatus != ''">project_status,</if>
<if test="constructionStatus != null and constructionStatus != ''">construction_status,</if>
<if test="voltageLevel != null and voltageLevel != ''">voltage_level,</if>
<if test="constructionNature != null and constructionNature != ''">construction_nature,</if>
<if test="majorProject != null and majorProject != ''">major_project,</if>
<if test="provincialCompany != null and provincialCompany != ''">provincial_company,</if>
<if test="constructionManagement != null and constructionManagement != ''">construction_management,</if>
<if test="comCode != null and comCode != ''">com_code,</if>
<if test="address != null and address != ''">address,</if>
<if test="currentCurrent != null and currentCurrent != ''">current_current,</if>
<if test="lineLength != null and lineLength != ''">line_length,</if>
<if test="substationCapacity != null and substationCapacity != ''">substation_capacity,</if>
<if test="planStartTime != null ">plan_start_time,</if>
<if test="planEndTime != null ">plan_end_time,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null ">end_time,</if>
<if test="towerNum != null and towerNum != ''">tower_num,</if>
<if test="engineeringCompleted != null and engineeringCompleted != ''">engineering_completed,</if>
<if test="towerCompleted != null and towerCompleted != ''">tower_completed,</if>
<if test="erectionCompleted != null and erectionCompleted != ''">erection_completed,</if>
<if test="remark != null and remark != ''">remark,</if>
del_flag
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectSingleName != null and projectSingleName != ''">#{projectSingleName},</if>
<if test="projectId != null">#{projectId},</if>
<if test="projectSingleCode != null and projectSingleCode != ''">#{projectSingleCode},</if>
<if test="safeCode != null">#{safeCode},</if>
<if test="projectType != null and projectType != ''">#{projectType},</if>
<if test="detailType != null and detailType != ''">#{detailType},</if>
<if test="projectStatus != null and projectStatus != ''">#{projectStatus},</if>
<if test="constructionStatus != null and constructionStatus != ''">#{constructionStatus},</if>
<if test="voltageLevel != null and voltageLevel != ''">#{voltageLevel},</if>
<if test="constructionNature != null and constructionNature != ''">#{constructionNature},</if>
<if test="majorProject != null and majorProject != ''">#{majorProject},</if>
<if test="provincialCompany != null and provincialCompany != ''">#{provincialCompany},</if>
<if test="constructionManagement != null and constructionManagement != ''">#{constructionManagement},</if>
<if test="comCode != null and comCode != ''">#{comCode},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="currentCurrent != null and currentCurrent != ''">#{currentCurrent},</if>
<if test="lineLength != null and lineLength != ''">#{lineLength},</if>
<if test="substationCapacity != null and substationCapacity != ''">#{substationCapacity},</if>
<if test="planStartTime != null ">#{planStartTime},</if>
<if test="planEndTime != null ">#{planEndTime},</if>
<if test="startTime != null ">#{startTime},</if>
<if test="endTime != null ">#{endTime},</if>
<if test="towerNum != null and towerNum != ''">#{towerNum},</if>
<if test="engineeringCompleted != null and engineeringCompleted != ''">#{engineeringCompleted},</if>
<if test="towerCompleted != null and towerCompleted != ''">#{towerCompleted},</if>
<if test="erectionCompleted != null and erectionCompleted != ''">#{erectionCompleted},</if>
<if test="remark != null and remark != ''">#{remark},</if>
1
</trim>
</insert>
<update id="updateTtProjectSingle">
update tt_project_single set project_single_name = #{projectSingleName},project_id = #{projectId},
project_single_code = #{projectSingleCode},safe_code = #{safeCode},project_type=#{projectType},
detail_type = #{detailType},project_status= #{projectStatus},construction_status= #{constructionStatus},
voltage_level = #{voltageLevel},construction_nature = #{constructionNature},
major_project=#{majorProject},provincial_company = #{provincialCompany},
construction_management = #{constructionManagement},com_code = #{comCode},address = #{address},
current_current = #{currentCurrent},line_length = #{lineLength},
substation_capacity = #{substationCapacity}, plan_start_time = #{planStartTime},
plan_end_time = #{planEndTime}, start_time = #{start_time},end_time = #{endTime},
tower_num = #{towerNum},engineering_completed = #{engineeringCompleted},
tower_completed = #{towerCmpleted},erection_completed = #{erectionCompleted},remark = #{remark}
where project_single_id = #{projectSingleId}
</update>
<delete id="delTtProjectSingle">
update tt_project_single set del_flag = 0 where project_single_id = #{projectSingleId}
</delete>
<select id="ttProjectSingleList" resultType="com.bonus.base.basic.domain.vo.TtProjectSingleVo">
select project_single_id as projectSingleId, project_single_name as projectSingleName,
project_id as projectId, project_single_code as projectSingleCode,safe_code as safeCode,
project_type as projectType,detail_type as detailType,project_status as projectStatus,
construction_status as constructionStatus,voltage_level as voltageLevel,
construction_nature as constructionNature,major_project as majorProject,
provincial_company as provincialCompany,construction_management as constructionManagement,
com_code as comCode,address as address,current_current as currentCurrent,line_length as lineLength,
substation_capacity as substationCapacity,plan_start_time as planStartTime,
plan_end_time as planEndTime,start_time as startTime,end_time as endTime,tower_num as towerNum,
engineering_completed as engineeringCompleted,tower_completed as towerCmpleted,
erection_completed as erectionCompleted, remark as remark
from tt_project_single
where del_flag=1
<if test="projectId != '' and projectId != null"> and project_id = #{projectId}</if>
<if test="provincialCompany != '' and provincialCompany != null"> and provincial_company = #{provincialCompany}</if>
<if test="majorProject != '' and majorProject != null"> and major_project = #{majorProject}</if>
<if test="keyWord != null and keyWord != ''">
and (
address like concat('%', #{keyWord}, '%') or
construction_nature like concat('%', #{keyWord}, '%') or
com_code like concat('%', #{keyWord}, '%') or
safe_code like concat('%', #{keyWord}, '%')
)
</if>
</select>
<select id="ttProjectSingleById" resultType="com.bonus.base.basic.domain.vo.TtProjectSingleVo">
select project_single_id as projectSingleId, project_single_name as projectSingleName,
project_id as projectId, project_single_code as projectSingleCode,safe_code as safeCode,
project_type as projectType,detail_type as detailType,project_status as projectStatus,
construction_status as constructionStatus,voltage_level as voltageLevel,
construction_nature as constructionNature,major_project as majorProject,
provincial_company as provincialCompany,construction_management as constructionManagement,
com_code as comCode,address as address,current_current as currentCurrent,line_length as lineLength,
substation_capacity as substationCapacity,plan_start_time as planStartTime,
plan_end_time as planEndTime,start_time as startTime,end_time as endTime,tower_num as towerNum,
engineering_completed as engineeringCompleted,tower_completed as towerCmpleted,
erection_completed as erectionCompleted, remark as remark
from tt_project_single
where project_single_id = #{projectSingleId}
</select>
</mapper>