设备管理-检查项维护V1

highway
wws 1 year ago
parent 5205fab4f9
commit 57ffbd7968

@ -72,4 +72,10 @@ public interface EquCheckItemDetailMapper {
* @return * @return
*/ */
List<EquCheckItemDetail> selectEquCheckItemDetailByParentCode(String itemCode); List<EquCheckItemDetail> selectEquCheckItemDetailByParentCode(String itemCode);
/**
* id
* @param itemId
*/
void deleteEquCheckItemDetailByItemId(String itemId);
} }

@ -205,6 +205,9 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int deleteEquCheckItemByItemIds(String[] itemIds) { public int deleteEquCheckItemByItemIds(String[] itemIds) {
for (String data : itemIds) {
equCheckItemDetailMapper.deleteEquCheckItemDetailByItemId(data);
}
return equCheckItemMapper.deleteEquCheckItemByItemIds(itemIds); return equCheckItemMapper.deleteEquCheckItemByItemIds(itemIds);
} }
@ -217,6 +220,8 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int deleteEquCheckItemByItemId(String itemId) { public int deleteEquCheckItemByItemId(String itemId) {
// 通过id删除标准信息
equCheckItemDetailMapper.deleteEquCheckItemDetailByItemId(itemId);
return equCheckItemMapper.deleteEquCheckItemByItemId(itemId); return equCheckItemMapper.deleteEquCheckItemByItemId(itemId);
} }
} }

@ -47,22 +47,24 @@
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if> <if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
<if test="detailCode != null and detailCode != ''"> and detail_code = #{detailCode}</if> <if test="detailCode != null and detailCode != ''"> and detail_code = #{detailCode}</if>
</where> </where>
and del_flag = '0'
</select> </select>
<select id="selectEquCheckItemDetailByDetailId" parameterType="String" resultMap="EquCheckItemDetailResult"> <select id="selectEquCheckItemDetailByDetailId" parameterType="String" resultMap="EquCheckItemDetailResult">
<include refid="selectEquCheckItemDetailVo"/> <include refid="selectEquCheckItemDetailVo"/>
where detail_id = #{detailId} where detail_id = #{detailId} and del_flag = '0'
</select> </select>
<select id="selectSerialNumber" resultType="java.lang.Integer"> <select id="selectSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(detail_id)+1 AS serialNum SELECT COUNT(detail_id)+1 AS serialNum
FROM equ_check_item_detail FROM equ_check_item_detail
WHERE CONVERT(date, GETDATE()) = CONVERT(date,created_time) and parent_code = #{itemCode}; WHERE CONVERT(date, GETDATE()) = CONVERT(date,created_time) and parent_code = #{itemCode} and del_flag = '0'
</select> </select>
<select id="selectEquCheckItemDetailByParentCode" parameterType="String" resultMap="EquCheckItemDetailResult"> <select id="selectEquCheckItemDetailByParentCode" parameterType="String" resultMap="EquCheckItemDetailResult">
<include refid="selectEquCheckItemDetailVo"/> <include refid="selectEquCheckItemDetailVo"/>
where parent_code = #{parentCode} where parent_code = #{parentCode} and del_flag = '0'
ORDER BY created_time
</select> </select>
<insert id="insertEquCheckItemDetail" parameterType="EquCheckItemDetail"> <insert id="insertEquCheckItemDetail" parameterType="EquCheckItemDetail">
@ -127,17 +129,24 @@
<if test="updatedBy != null and updatedBy != ''">updated_by = #{updatedBy},</if> <if test="updatedBy != null and updatedBy != ''">updated_by = #{updatedBy},</if>
<if test="detailCode != null and detailCode != ''">detail_code = #{detailCode},</if> <if test="detailCode != null and detailCode != ''">detail_code = #{detailCode},</if>
</trim> </trim>
where detail_id = #{detailId} where detail_id = #{detailId} and del_flag = '0'
</update> </update>
<delete id="deleteEquCheckItemDetailByDetailId" parameterType="String"> <delete id="deleteEquCheckItemDetailByDetailId" parameterType="String">
delete from equ_check_item_detail where detail_id = #{detailId} update equ_check_item_detail set del_flag = '1' where detail_id = #{detailId}
</delete> </delete>
<delete id="deleteEquCheckItemDetailByDetailIds" parameterType="String"> <delete id="deleteEquCheckItemDetailByDetailIds" parameterType="String">
delete from equ_check_item_detail where detail_id in update equ_check_item_detail set del_flag = '1' where detail_id in
<foreach item="detailId" collection="array" open="(" separator="," close=")"> <foreach item="detailId" collection="array" open="(" separator="," close=")">
#{detailId} #{detailId}
</foreach> </foreach>
</delete> </delete>
<delete id="deleteEquCheckItemDetailByItemId" parameterType="String">
update equ_check_item_detail
set del_flag = '1'
where parent_code = (
select item_code from equ_check_item where item_id = #{itemId} )
</delete>
</mapper> </mapper>

@ -47,23 +47,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTimeStart != null "> and CONVERT(date,updated_time) >= #{updateTimeStart}</if> <if test="updateTimeStart != null "> and CONVERT(date,updated_time) >= #{updateTimeStart}</if>
<if test="updateTimeEnd != null "> and #{updateTimeEnd} >= CONVERT(date,updated_time)</if> <if test="updateTimeEnd != null "> and #{updateTimeEnd} >= CONVERT(date,updated_time)</if>
<if test="updatedBy != null and updatedBy != ''"> and updated_by like concat('%', #{updatedBy}, '%')</if> <if test="updatedBy != null and updatedBy != ''"> and updated_by like concat('%', #{updatedBy}, '%')</if>
and del_flag = '0'
ORDER BY created_time DESC
</where> </where>
</select> </select>
<select id="selectEquCheckItemByItemId" parameterType="String" resultMap="EquCheckItemResult"> <select id="selectEquCheckItemByItemId" parameterType="String" resultMap="EquCheckItemResult">
<include refid="selectEquCheckItemVo"/> <include refid="selectEquCheckItemVo"/>
where item_id = #{itemId} where item_id = #{itemId} and del_flag = '0'
</select> </select>
<select id="selectEquCheckItemByItemName" parameterType="String" resultMap="EquCheckItemResult"> <select id="selectEquCheckItemByItemName" parameterType="String" resultMap="EquCheckItemResult">
<include refid="selectEquCheckItemVo"/> <include refid="selectEquCheckItemVo"/>
where item_name = #{itemName} where item_name = #{itemName} and del_flag = '0'
</select> </select>
<select id="selectSerialNumber" resultType="java.lang.Integer"> <select id="selectSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(item_id)+1 AS serialNum SELECT COUNT(item_id)+1 AS serialNum
FROM equ_check_item FROM equ_check_item
WHERE CONVERT(date, GETDATE()) = CONVERT(date,created_time); WHERE CONVERT(date, GETDATE()) = CONVERT(date,created_time) and del_flag = '0'
</select> </select>
<insert id="insertEquCheckItem" parameterType="EquCheckItem"> <insert id="insertEquCheckItem" parameterType="EquCheckItem">
@ -125,15 +127,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updatedTime != null">updated_time = #{updatedTime},</if> <if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="updatedBy != null and updatedBy != ''">updated_by = #{updatedBy},</if> <if test="updatedBy != null and updatedBy != ''">updated_by = #{updatedBy},</if>
</trim> </trim>
where item_id = #{itemId} where item_id = #{itemId} and del_flag = '0'
</update> </update>
<delete id="deleteEquCheckItemByItemId" parameterType="String"> <delete id="deleteEquCheckItemByItemId" parameterType="String">
delete from equ_check_item where item_id = #{itemId} update equ_check_item set del_flag = '1' where item_id = #{itemId}
</delete> </delete>
<delete id="deleteEquCheckItemByItemIds" parameterType="String"> <delete id="deleteEquCheckItemByItemIds" parameterType="String">
delete from equ_check_item where item_id in update equ_check_item set del_flag = '1' where item_id in
<foreach item="itemId" collection="array" open="(" separator="," close=")"> <foreach item="itemId" collection="array" open="(" separator="," close=")">
#{itemId} #{itemId}
</foreach> </foreach>

Loading…
Cancel
Save