<?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.thhy.engineering.modules.biz.engineering.mapper.SysProjectMapper">
|
<resultMap id="BaseResultMap" type="com.thhy.engineering.modules.biz.engineering.entity.SysProject">
|
<!--
|
WARNING - @mbg.generated
|
This element is automatically generated by MyBatis Generator, do not modify.
|
This element was generated on Fri Mar 31 12:43:12 CST 2023.
|
-->
|
<id column="pro_id" jdbcType="VARCHAR" property="proId" />
|
<result column="pro_name" jdbcType="VARCHAR" property="proName" />
|
<result column="pro_desc" jdbcType="VARCHAR" property="proDesc" />
|
<result column="start_date" jdbcType="TIMESTAMP" property="startDate" />
|
<result column="pro_time" jdbcType="INTEGER" property="proTime" />
|
<result column="plan_output" jdbcType="INTEGER" property="planOutput" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
|
<result column="pro_number" jdbcType="VARCHAR" property="proNumber" />
|
<result column="company_id" jdbcType="VARCHAR" property="companyId" />
|
<result column="create_unit" jdbcType="VARCHAR" property="createUnit" />
|
<result column="plan_unit" jdbcType="VARCHAR" property="planUnit" />
|
<result column="supervision_unit" jdbcType="VARCHAR" property="supervisionUnit" />
|
<result column="construction_unit" jdbcType="VARCHAR" property="constructionUnit" />
|
<result column="outside_diameter" jdbcType="DOUBLE" property="outsideDiameter" />
|
<result column="inner_diameter" jdbcType="DOUBLE" property="innerDiameter" />
|
<result column="thickness" jdbcType="DOUBLE" property="thickness" />
|
<result column="ring_width" jdbcType="DOUBLE" property="ringWidth" />
|
<result column="concrete_strength_grade" jdbcType="VARCHAR" property="concreteStrengthGrade" />
|
<result column="impermeability_level" jdbcType="VARCHAR" property="impermeabilityLevel" />
|
<result column="waterproof_type" jdbcType="INTEGER" property="waterproofType" />
|
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
|
<result column="completed_quantity" jdbcType="INTEGER" property="completedQuantity" />
|
</resultMap>
|
|
|
<select id="proNameByOne" parameterType="java.lang.String" resultType="java.lang.String">
|
select pro_id from sys_project where is_use=1
|
and pro_name=#{proName}
|
</select>
|
|
<insert id="projectInsert" useGeneratedKeys="true" keyProperty="pro_id">
|
insert into sys_project
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="proId != null">
|
pro_id,
|
</if>
|
<if test="proName != null">
|
pro_name,
|
</if>
|
<if test="proDesc != null">
|
pro_desc,
|
</if>
|
<if test="startDate != null">
|
start_date,
|
</if>
|
<if test="proTime != null">
|
pro_time,
|
</if>
|
<if test="planOutput != null">
|
plan_output,
|
</if>
|
<if test="createTime != null">
|
create_time,
|
</if>
|
<if test="createUser != null">
|
create_user,
|
</if>
|
<if test="proNumber != null">
|
pro_number,
|
</if>
|
<if test="companyId != null">
|
company_id,
|
</if>
|
<if test="createUnit != null">
|
create_unit,
|
</if>
|
<if test="planUnit != null">
|
plan_unit,
|
</if>
|
<if test="supervisionUnit != null">
|
supervision_unit,
|
</if>
|
<if test="constructionUnit != null">
|
construction_unit,
|
</if>
|
<if test="outsideDiameter != null">
|
outside_diameter,
|
</if>
|
<if test="innerDiameter != null">
|
inner_diameter,
|
</if>
|
<if test="thickness != null">
|
thickness,
|
</if>
|
<if test="ringWidth != null">
|
ring_width,
|
</if>
|
<if test="concreteStrengthGrade != null">
|
concrete_strength_grade,
|
</if>
|
<if test="impermeabilityLevel != null">
|
impermeability_level,
|
</if>
|
<if test="waterproofType != null">
|
waterproof_type,
|
</if>
|
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="proId != null">
|
#{proId,jdbcType=VARCHAR},
|
</if>
|
<if test="proName != null">
|
#{proName,jdbcType=VARCHAR},
|
</if>
|
<if test="proDesc != null">
|
#{proDesc,jdbcType=VARCHAR},
|
</if>
|
<if test="startDate != null">
|
#{startDate,jdbcType=TIMESTAMP},
|
</if>
|
<if test="proTime != null">
|
#{proTime,jdbcType=INTEGER},
|
</if>
|
<if test="planOutput != null">
|
#{planOutput,jdbcType=INTEGER},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createUser != null">
|
#{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="proNumber != null">
|
#{proNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="companyId != null">
|
#{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="createUnit != null">
|
#{createUnit,jdbcType=VARCHAR},
|
</if>
|
<if test="planUnit != null">
|
#{planUnit,jdbcType=VARCHAR},
|
</if>
|
<if test="supervisionUnit != null">
|
#{supervisionUnit,jdbcType=VARCHAR},
|
</if>
|
<if test="constructionUnit != null">
|
#{constructionUnit,jdbcType=VARCHAR},
|
</if>
|
<if test="outsideDiameter != null">
|
#{outsideDiameter,jdbcType=DOUBLE},
|
</if>
|
<if test="innerDiameter != null">
|
#{innerDiameter,jdbcType=DOUBLE},
|
</if>
|
<if test="thickness != null">
|
#{thickness,jdbcType=DOUBLE},
|
</if>
|
<if test="ringWidth != null">
|
#{ringWidth,jdbcType=DOUBLE},
|
</if>
|
<if test="concreteStrengthGrade != null">
|
#{concreteStrengthGrade,jdbcType=VARCHAR},
|
</if>
|
<if test="impermeabilityLevel != null">
|
#{impermeabilityLevel,jdbcType=VARCHAR},
|
</if>
|
<if test="waterproofType != null">
|
#{waterproofType,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<insert id="proTurnsInsert" >
|
insert into sys_pro_turn
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="proId != null">
|
pro_id,
|
</if>
|
<if test="turn != null">
|
turn,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id},
|
</if>
|
<if test="proId != null">
|
#{proId,jdbcType=VARCHAR},
|
</if>
|
<if test="turn != null">
|
#{turn,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
|
<insert id="proSizesInsert">
|
insert into sys_pro_sizes
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="proId != null">
|
pro_id,
|
</if>
|
<if test="sizes != null">
|
sizes,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id},
|
</if>
|
<if test="proId != null">
|
#{proId,jdbcType=VARCHAR},
|
</if>
|
<if test="sizes != null">
|
#{sizes,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<insert id="proHasInsert" >
|
insert into sys_pro_has
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="proId != null">
|
pro_id,
|
</if>
|
<if test="hasSteel != null">
|
has_steel,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id},
|
</if>
|
<if test="proId != null">
|
#{proId,jdbcType=VARCHAR},
|
</if>
|
<if test="hasSteel != null">
|
#{hasSteel,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<insert id="proGroutingInsert">
|
insert into sys_pro_grouting
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="proId != null">
|
pro_id,
|
</if>
|
<if test="groutingHoles != null">
|
grouting_holes,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id},
|
</if>
|
<if test="proId != null">
|
#{proId,jdbcType=VARCHAR},
|
</if>
|
<if test="groutingHoles != null">
|
#{groutingHoles,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
|
<insert id="proBlokInsert" >
|
insert into sys_pro_blok
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="proId != null">
|
pro_id,
|
</if>
|
<if test="blockNum != null">
|
block_num,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="proId != null">
|
#{proId,jdbcType=VARCHAR},
|
</if>
|
<if test="blockNum != null">
|
#{blockNum,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<select id="projectList" resultMap="BaseResultMap">
|
select
|
sp.*,
|
sc.company_name,
|
COUNT(tpi.pro_id) completed_quantity
|
from sys_project sp
|
left join sys_company sc on sp.company_id=sc.company_id
|
left join (SELECT pro_id FROM t_pipe_info WHERE check_result in (1,2,3)) tpi on tpi.pro_id = sp.pro_id
|
where sp.is_use=1
|
<if test="proName!=null and proName!='' ">
|
and sp.pro_name like concat('%',#{proName},'%')
|
</if>segment/segmentList
|
<if test="companyId!=null and companyId!='' ">
|
and sp.company_id=#{companyId}
|
</if>
|
GROUP BY sp.pro_id
|
order by sp.create_time desc
|
</select>
|
<select id="proBlokSelect" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.SysProBlok">
|
select spb.pro_id as proId,
|
spb.block_num as blockNum,
|
sd.dict_name as dictName
|
from sys_pro_blok spb
|
left join sys_dict sd on spb.block_num=sd.dict_id
|
where spb.pro_id=#{proId}
|
</select>
|
<select id="proGroutingSelect" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.SysProGrouting">
|
select spg.pro_id as proId,
|
spg.grouting_holes as groutingHoles,
|
sd.dict_name as dictName
|
from sys_pro_grouting spg
|
left join sys_dict sd on spg.grouting_holes=sd.dict_id
|
where spg.pro_id=#{proId}
|
</select>
|
<select id="proHasSelect" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.SysProHas">
|
select
|
sph.has_steel as hasSteel,
|
sph.pro_id as proId,
|
sd.dict_name as dictName
|
from sys_pro_has sph
|
left join sys_dict sd on sph.has_steel=sd.dict_id
|
where sph.pro_id=#{proId}
|
</select>
|
<select id="proSizesSelect" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.SysProSizes">
|
select sps.pro_id as proId,
|
sps.sizes as sizes,
|
sd.dict_name as dictName from sys_pro_sizes sps
|
left join sys_dict sd on sps.sizes=sd.dict_id
|
where sps.pro_id=#{proId}
|
</select>
|
<select id="proTurnSelect" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.SysProTurn">
|
select spt.pro_id as proId,
|
spt.turn as turn,
|
sd.dict_name as dictName from sys_pro_turn spt
|
left join sys_dict sd on spt.turn=sd.dict_id
|
where spt.pro_id=#{proId}
|
</select>
|
<select id="projectInfo" parameterType="java.lang.String" resultMap="BaseResultMap">
|
select * from sys_project where is_use=1 and pro_id=#{proId}
|
</select>
|
<update id="projectDel" parameterType="java.lang.String" >
|
update sys_project set is_use=2
|
where pro_id=#{proId}
|
</update>
|
<update id="projectUpdate">
|
update sys_project
|
<set>
|
<if test="proName != null">
|
pro_name = #{proName,jdbcType=VARCHAR},
|
</if>
|
<if test="proDesc != null">
|
pro_desc = #{proDesc,jdbcType=VARCHAR},
|
</if>
|
<if test="startDate != null">
|
start_date = #{startDate,jdbcType=TIMESTAMP},
|
</if>
|
<if test="proTime != null">
|
pro_time = #{proTime,jdbcType=INTEGER},
|
</if>
|
<if test="planOutput != null">
|
plan_output = #{planOutput,jdbcType=INTEGER},
|
</if>
|
<if test="createTime != null">
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createUser != null">
|
create_user = #{createUser,jdbcType=VARCHAR},
|
</if>
|
|
<if test="createUnit != null">
|
create_unit = #{createUnit,jdbcType=VARCHAR},
|
</if>
|
<if test="planUnit != null">
|
plan_unit = #{planUnit,jdbcType=VARCHAR},
|
</if>
|
<if test="supervisionUnit != null">
|
supervision_unit = #{supervisionUnit,jdbcType=VARCHAR},
|
</if>
|
<if test="constructionUnit != null">
|
construction_unit = #{constructionUnit,jdbcType=VARCHAR},
|
</if>
|
<if test="outsideDiameter != null">
|
outside_diameter = #{outsideDiameter,jdbcType=DOUBLE},
|
</if>
|
<if test="innerDiameter != null">
|
inner_diameter = #{innerDiameter,jdbcType=DOUBLE},
|
</if>
|
<if test="thickness != null">
|
thickness = #{thickness,jdbcType=DOUBLE},
|
</if>
|
<if test="ringWidth != null">
|
ring_width = #{ringWidth,jdbcType=DOUBLE},
|
</if>
|
<if test="concreteStrengthGrade != null">
|
concrete_strength_grade = #{concreteStrengthGrade,jdbcType=VARCHAR},
|
</if>
|
<if test="impermeabilityLevel != null">
|
impermeability_level = #{impermeabilityLevel,jdbcType=VARCHAR},
|
</if>
|
<if test="waterproofType != null">
|
waterproof_type = #{waterproofType,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where pro_id = #{proId,jdbcType=VARCHAR}
|
</update>
|
<delete id="proBlokDel" parameterType="java.lang.String" >
|
delete from sys_pro_blok where pro_id=#{proId}
|
</delete>
|
<delete id="proGroutingDel" parameterType="java.lang.String" >
|
delete from sys_pro_grouting where pro_id=#{proId}
|
</delete>
|
<delete id="proHasDel" parameterType="java.lang.String" >
|
delete from sys_pro_has where pro_id=#{proId}
|
</delete>
|
<delete id="proSizesDel" parameterType="java.lang.String" >
|
delete from sys_pro_sizes where pro_id=#{proId}
|
</delete>
|
<delete id="proTurnsDel" parameterType="java.lang.String" >
|
delete from sys_pro_turn where pro_id=#{proId}
|
</delete>
|
<select id="projectPullSize" resultType="com.thhy.engineering.modules.biz.engineering.entity.SysDict">
|
select sd.dict_id as dictId,sd.dict_name as dictName from sys_pro_sizes sps left join sys_dict sd
|
on sps.sizes=sd.dict_id
|
where sps.pro_id=#{proId} and sd.dict_type=#{dictType}
|
</select>
|
|
<select id="projectPullReinforcement" resultType="com.thhy.engineering.modules.biz.engineering.entity.SysDict">
|
select sd.dict_id as dictId,sd.dict_name as dictName from sys_pro_has sph left join sys_dict sd
|
on sph.has_steel=sd.dict_id
|
where sph.pro_id=#{proId} and sd.dict_type=#{dictType}
|
</select>
|
<select id="projectPullBlock" resultType="com.thhy.engineering.modules.biz.engineering.entity.SysDict">
|
select sd.dict_id as dictId,sd.dict_name as dictName from sys_pro_blok spb left join sys_dict sd
|
on spb.block_num=sd.dict_id
|
where spb.pro_id=#{proId} and sd.dict_type=#{dictType}
|
</select>
|
<select id="newByProject" resultType="com.thhy.engineering.modules.biz.engineering.entity.SysProject">
|
select pro_id as proId,pro_name as proName,pro_number as proNumber
|
from sys_project
|
where is_use=1
|
ORDER BY create_time desc LIMIT 0,1
|
</select>
|
<select id="projectListPull" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.ProjectPullDto">
|
select
|
pro_id as proId,pro_name as proName
|
from sys_project where is_use=1
|
<if test="companyId!=null and companyId!='' ">
|
and company_id=#{companyId}
|
</if>
|
</select>
|
<select id="projectSizeList" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.ProjectSizeDto">
|
SELECT
|
sp.pro_id as proId,
|
sp.pro_name as proName,
|
sps.sizes as sizeId,
|
sd.dict_name as sizeName
|
FROM
|
sys_project sp
|
LEFT JOIN sys_pro_sizes sps ON sp.pro_id = sps.pro_id
|
left join sys_dict sd on sps.sizes=sd.dict_id
|
where sp.is_use=1
|
<if test="companyId!=null and companyId!='' ">
|
and sp.company_id=#{companyId}
|
</if>
|
<if test="proId!=null and proId!='' ">
|
and sp.pro_id=#{proId}
|
</if>
|
<if test="sizeId!=null and sizeId!='' ">
|
and sps.sizes=#{sizeId}
|
</if>
|
order by sp.create_time,sd.create_time desc
|
</select>
|
<select id="projectSizeThingJsList" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.ProjectSizeDto">
|
SELECT
|
sp.pro_id as proId,
|
sp.pro_name as proName,
|
sps.sizes as sizeId,
|
sd.dict_name as sizeName
|
FROM
|
sys_project sp
|
LEFT JOIN sys_pro_sizes sps ON sp.pro_id = sps.pro_id
|
left join sys_dict sd on sps.sizes=sd.dict_id
|
where sp.is_use=1
|
<if test="companyId!=null and companyId!='' ">
|
and sp.company_id=#{companyId}
|
</if>
|
order by sp.create_time,sd.create_time desc
|
</select>
|
|
<select id="proHasList" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.ProjcetHasDto">
|
SELECT
|
sp.pro_id as proId,
|
sph.has_steel as hasSteel,
|
sd.dict_name as has,
|
sd.colors
|
FROM
|
sys_project sp
|
LEFT JOIN sys_pro_has sph ON sp.pro_id = sph.pro_id
|
left join sys_dict sd on sph.has_steel=sd.dict_id
|
where sp.is_use=1
|
and sp.pro_id=#{proId}
|
</select>
|
|
<select id="proBlokList" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.ProjectBlokDto">
|
SELECT
|
sp.pro_id as proId,
|
spb.block_num as blockNum,
|
sd.dict_name as blockName
|
FROM
|
sys_project sp
|
LEFT JOIN sys_pro_blok spb ON sp.pro_id = spb.pro_id
|
left join sys_dict sd on spb.block_num=sd.dict_id
|
where sp.is_use=1
|
and sp.pro_id=#{proId}
|
</select>
|
|
</mapper>
|