optimize: 两条sql分开执行
This commit is contained in:
parent
0663529f27
commit
611a5eeb53
|
|
@ -34,6 +34,8 @@ public interface BomNewEbomChildMapper extends BaseMapper<BomNewEbomChildEntity>
|
|||
|
||||
void deleteAllChildren(Long rowId);
|
||||
|
||||
void updateBomExist0(Long rowId);
|
||||
|
||||
void delBomChild(@Param("bomRowIds") List<Long> bomRowIds);
|
||||
|
||||
List<BomNewPbomParentVO> getBomByMaterialNo(String materialNo);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ public class BomNewEbomChildService extends ServiceImpl<BomNewEbomChildMapper, B
|
|||
|
||||
public void deleteAllChildren(Long parentRowId) {
|
||||
baseMapper.deleteAllChildren(parentRowId);
|
||||
baseMapper.updateBomExist0(parentRowId);
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> updateEBomMaterialUse(Collection<String> materialNos) {
|
||||
|
|
|
|||
|
|
@ -73,6 +73,11 @@
|
|||
</foreach>
|
||||
group by b.material_no;
|
||||
</update>
|
||||
<update id="updateBomExist0">
|
||||
UPDATE t_bom_new_ebom_parent
|
||||
SET bom_exist=0
|
||||
WHERE row_id = #{rowId};
|
||||
</update>
|
||||
|
||||
<select id="getChildMaxExceptionState" resultType="com.nflg.product.bomnew.pojo.vo.ChildMaxExceptionStateVO">
|
||||
select max(exception_status) maxExceptionState, parent_row_id from t_bom_new_ebom_child
|
||||
|
|
@ -112,10 +117,7 @@
|
|||
<delete id="deleteAllChildren">
|
||||
DELETE
|
||||
FROM t_bom_new_ebom_child
|
||||
WHERE parent_row_id = #{parentRowId};
|
||||
UPDATE t_bom_new_ebom_parent
|
||||
SET bom_exist=0
|
||||
WHERE row_id = #{parentRowId};
|
||||
WHERE parent_row_id = #{rowId};
|
||||
</delete>
|
||||
|
||||
<delete id="delBomChild">
|
||||
|
|
|
|||
Loading…
Reference in New Issue