工程修改

This commit is contained in:
cwchen 2024-03-26 20:55:07 +08:00
parent c794562fa4
commit 16abd9875c
4 changed files with 19 additions and 11 deletions

View File

@ -100,11 +100,11 @@
</insert> </insert>
<!--删除边带设备--> <!--删除边带设备-->
<delete id="delDeviceBdById"> <delete id="delDeviceBdById">
DELETE FROM tb_pro_bd WHERE id = #{id} UPDATE tb_pro_bd SET del_flag = 0 WHERE id = #{id}
</delete> </delete>
<!--删除边带设备--> <!--删除边带设备-->
<delete id="delDeviceBdChildById"> <delete id="delDeviceBdChildById">
DELETE FROM tb_bd_device WHERE device_id = #{id} UPDATE tb_bd_device SET del_flage = 1 WHERE device_id = #{id}
</delete> </delete>
<!--获取边带列表--> <!--获取边带列表-->
@ -123,9 +123,10 @@
FROM tb_pro_bd tpb FROM tb_pro_bd tpb
LEFT JOIN sys_dict sd ON sd.dict_code = tpb.bd_type LEFT JOIN sys_dict sd ON sd.dict_code = tpb.bd_type
LEFT JOIN sys_dict sd2 ON sd2.dict_code = tpb.type_code LEFT JOIN sys_dict sd2 ON sd2.dict_code = tpb.type_code
LEFT JOIN tb_project tp ON tp.bid_code = tpb.bid_code LEFT JOIN tb_project tp ON tp.bid_code = tpb.bid_code AND tp.del_flag = 0
LEFT JOIN t_pro_gt tpg ON tpg.gt_id = tpb.gt_id LEFT JOIN t_pro_gt tpg ON tpg.gt_id = tpb.gt_id
<where> <where>
tpb.del_flag = 0
<if test="keyWord!=null and keyWord!=''"> <if test="keyWord!=null and keyWord!=''">
AND ( AND (
INSTR(tpb.bd_name,#{keyWord}) > 0 OR INSTR(tpb.bd_name,#{keyWord}) > 0 OR
@ -139,10 +140,10 @@
<!--边带编码是否重复--> <!--边带编码是否重复-->
<select id="isBdCodeExist" resultType="java.lang.Integer"> <select id="isBdCodeExist" resultType="java.lang.Integer">
<if test="id == null or id == ''"> <if test="id == null or id == ''">
SELECT COUNT(*) FROM tb_pro_bd tpb WHERE bd_code = #{bdCode} SELECT COUNT(*) FROM tb_pro_bd tpb WHERE bd_code = #{bdCode} AND del_flag = 0
</if> </if>
<if test="id != null and id != ''"> <if test="id != null and id != ''">
SELECT COUNT(*) FROM tb_pro_bd tpb WHERE bd_code = #{bdCode} AND id != #{id} SELECT COUNT(*) FROM tb_pro_bd tpb WHERE bd_code = #{bdCode} AND id != #{id} AND del_flag = 0
</if> </if>
</select> </select>
<!--边带设备详情--> <!--边带设备详情-->
@ -160,7 +161,7 @@
</select> </select>
<!--边带设备是否包含子设备--> <!--边带设备是否包含子设备-->
<select id="isHasChildDeviceBd" resultType="java.lang.Integer"> <select id="isHasChildDeviceBd" resultType="java.lang.Integer">
SELECT COUNT(*) FROM tb_bd_device WHERE bd_id = #{id} SELECT COUNT(*) FROM tb_bd_device WHERE bd_id = #{id} AND del_flage = 0
</select> </select>
<!--获取边带子设备列表--> <!--获取边带子设备列表-->
<select id="getDeviceBdChildList" resultType="com.securitycontrol.entity.background.vo.DeviceBdChildVo"> <select id="getDeviceBdChildList" resultType="com.securitycontrol.entity.background.vo.DeviceBdChildVo">
@ -181,6 +182,7 @@
LEFT JOIN sys_dict sd2 ON sd2.dict_code = tbd.status LEFT JOIN sys_dict sd2 ON sd2.dict_code = tbd.status
LEFT JOIN sys_area sa ON tbd.area_id = sa.area_id LEFT JOIN sys_area sa ON tbd.area_id = sa.area_id
<where> <where>
tbd.del_flage = 0
<if test="keyWord!=null and keyWord!=''"> <if test="keyWord!=null and keyWord!=''">
AND ( AND (
INSTR(tpb.bd_name,#{keyWord}) > 0 INSTR(tpb.bd_name,#{keyWord}) > 0
@ -191,10 +193,10 @@
<!--边带设备编码是否重复--> <!--边带设备编码是否重复-->
<select id="isDeviceCodeExist" resultType="java.lang.Integer"> <select id="isDeviceCodeExist" resultType="java.lang.Integer">
<if test="deviceId == null or deviceId == ''"> <if test="deviceId == null or deviceId == ''">
SELECT COUNT(*) FROM tb_bd_device tbd WHERE device_code = #{deviceCode} SELECT COUNT(*) FROM tb_bd_device tbd WHERE device_code = #{deviceCode} AND del_flage = 0
</if> </if>
<if test="deviceId != null and deviceId != ''"> <if test="deviceId != null and deviceId != ''">
SELECT COUNT(*) FROM tb_bd_device tbd WHERE device_code = #{deviceCode} AND device_id != #{deviceId} SELECT COUNT(*) FROM tb_bd_device tbd WHERE device_code = #{deviceCode} AND device_id != #{deviceId} AND tbd.del_flage = 0
</if> </if>
</select> </select>
<!--边带设备详情--> <!--边带设备详情-->

View File

@ -26,6 +26,7 @@
<if test="startTime != null and startTime!=''">start_time,</if> <if test="startTime != null and startTime!=''">start_time,</if>
<if test="endTime != null and endTime!=''">end_time,</if> <if test="endTime != null and endTime!=''">end_time,</if>
<if test="org != null and org!=''">org,</if> <if test="org != null and org!=''">org,</if>
del_flag,
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="proId != null and proId != ''">#{proId},</if> <if test="proId != null and proId != ''">#{proId},</if>
@ -48,6 +49,7 @@
<if test="startTime != null and startTime!=''">#{startTime},</if> <if test="startTime != null and startTime!=''">#{startTime},</if>
<if test="endTime != null and endTime!=''">#{endTime},</if> <if test="endTime != null and endTime!=''">#{endTime},</if>
<if test="org != null and org!=''">#{org},</if> <if test="org != null and org!=''">#{org},</if>
0,
</trim> </trim>
</if> </if>
<if test="type == 2"> <if test="type == 2">
@ -156,7 +158,7 @@
</update> </update>
<!--删除工程--> <!--删除工程-->
<delete id="delPro"> <delete id="delPro">
DELETE FROM tb_project WHERE pro_id = #{proId} UPDATE tb_project SET del_flag = 1 WHERE pro_id = #{proId}
</delete> </delete>
<!--删除工程工序计划--> <!--删除工程工序计划-->
<delete id="delProGxPlan"> <delete id="delProGxPlan">
@ -194,6 +196,7 @@
FROM tb_project tp FROM tb_project tp
LEFT JOIN sys_build sb ON tp.org = sb.org_id LEFT JOIN sys_build sb ON tp.org = sb.org_id
<where> <where>
tp.del_flag = 0
<if test="keyWord !=null and keyWord!=''"> <if test="keyWord !=null and keyWord!=''">
AND ( AND (
INSTR(tp.pro_name,#{keyWord}) > 0 OR INSTR(tp.pro_name,#{keyWord}) > 0 OR
@ -298,10 +301,10 @@
</select> </select>
<select id="proIsExist" resultType="java.lang.Integer"> <select id="proIsExist" resultType="java.lang.Integer">
<if test="proId == null or proId == ''"> <if test="proId == null or proId == ''">
SELECT COUNT(*) FROM tb_project tp WHERE bid_code = #{bidCode} SELECT COUNT(*) FROM tb_project tp WHERE bid_code = #{bidCode} AND del_flag = 0
</if> </if>
<if test="proId != null and proId != ''"> <if test="proId != null and proId != ''">
SELECT COUNT(*) FROM tb_project tp WHERE bid_code = #{bidCode} AND pro_id != #{proId} SELECT COUNT(*) FROM tb_project tp WHERE bid_code = #{bidCode} AND pro_id != #{proId} AND del_flag = 0
</if> </if>
</select> </select>
<!--获取工序计划作业权重占比--> <!--获取工序计划作业权重占比-->

View File

@ -64,6 +64,7 @@
FROM tb_project tp FROM tb_project tp
LEFT JOIN sys_build sb ON tp.org = sb.org_id LEFT JOIN sys_build sb ON tp.org = sb.org_id
<where> <where>
tp.del_flag = 0
<if test="keyWord !=null and keyWord!=''"> <if test="keyWord !=null and keyWord!=''">
AND ( AND (
INSTR(tp.pro_name,#{keyWord}) > 0 OR INSTR(tp.pro_name,#{keyWord}) > 0 OR

View File

@ -86,6 +86,7 @@
pro_name AS name, pro_name AS name,
pro_type AS proType pro_type AS proType
FROM tb_project FROM tb_project
WHERE del_flag = 0
</select> </select>
<!--区域列表下拉选--> <!--区域列表下拉选-->
<select id="getAreaLists" resultType="com.securitycontrol.entity.system.vo.SelectVo"> <select id="getAreaLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
@ -104,6 +105,7 @@
SELECT id,bd_name AS name,bid_code AS bidCode,gt_id AS gtId SELECT id,bd_name AS name,bid_code AS bidCode,gt_id AS gtId
FROM tb_pro_bd FROM tb_pro_bd
<where> <where>
del_flag = 0
<if test="bidCode!=null and bidCode !=''"> <if test="bidCode!=null and bidCode !=''">
AND bid_code = #{bidCode} AND bid_code = #{bidCode}
</if> </if>