设备管理-检查项维护V1

highway
wws 1 year ago
parent 5205fab4f9
commit 57ffbd7968

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

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

@ -47,22 +47,24 @@
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
<if test="detailCode != null and detailCode != ''"> and detail_code = #{detailCode}</if>
</where>
and del_flag = '0'
</select>
<select id="selectEquCheckItemDetailByDetailId" parameterType="String" resultMap="EquCheckItemDetailResult">
<include refid="selectEquCheckItemDetailVo"/>
where detail_id = #{detailId}
where detail_id = #{detailId} and del_flag = '0'
</select>
<select id="selectSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(detail_id)+1 AS serialNum
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 id="selectEquCheckItemDetailByParentCode" parameterType="String" resultMap="EquCheckItemDetailResult">
<include refid="selectEquCheckItemDetailVo"/>
where parent_code = #{parentCode}
where parent_code = #{parentCode} and del_flag = '0'
ORDER BY created_time
</select>
<insert id="insertEquCheckItemDetail" parameterType="EquCheckItemDetail">
@ -127,17 +129,24 @@
<if test="updatedBy != null and updatedBy != ''">updated_by = #{updatedBy},</if>
<if test="detailCode != null and detailCode != ''">detail_code = #{detailCode},</if>
</trim>
where detail_id = #{detailId}
where detail_id = #{detailId} and del_flag = '0'
</update>
<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 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=")">
#{detailId}
</foreach>
</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>

@ -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="updateTimeEnd != null "> and #{updateTimeEnd} >= CONVERT(date,updated_time)</if>
<if test="updatedBy != null and updatedBy != ''"> and updated_by like concat('%', #{updatedBy}, '%')</if>
and del_flag = '0'
ORDER BY created_time DESC
</where>
</select>
<select id="selectEquCheckItemByItemId" parameterType="String" resultMap="EquCheckItemResult">
<include refid="selectEquCheckItemVo"/>
where item_id = #{itemId}
where item_id = #{itemId} and del_flag = '0'
</select>
<select id="selectEquCheckItemByItemName" parameterType="String" resultMap="EquCheckItemResult">
<include refid="selectEquCheckItemVo"/>
where item_name = #{itemName}
where item_name = #{itemName} and del_flag = '0'
</select>
<select id="selectSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(item_id)+1 AS serialNum
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>
<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="updatedBy != null and updatedBy != ''">updated_by = #{updatedBy},</if>
</trim>
where item_id = #{itemId}
where item_id = #{itemId} and del_flag = '0'
</update>
<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 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=")">
#{itemId}
</foreach>

Loading…
Cancel
Save