增加逻辑:删除仓库删除关联的商品的初始库存,删除仓库删除关联的商品的当前库存

This commit is contained in:
jishenghua
2024-08-29 00:14:37 +08:00
parent 6ab20c7baa
commit b0c0c18f3d
5 changed files with 42 additions and 14 deletions

View File

@@ -31,4 +31,15 @@
select ifnull(mcs.current_unit_price,0) as current_unit_price from jsh_material_current_stock mcs where mcs.material_id=#{materialId} limit 1
</select>
<update id="batchDeleteByDepots">
update jsh_material_current_stock
set delete_flag='1'
where 1=1
and depot_id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper>

View File

@@ -3,16 +3,27 @@
<mapper namespace="com.jsh.erp.datasource.mappers.MaterialInitialStockMapperEx">
<insert id="batchInsert" parameterType="java.util.List">
insert into jsh_material_initial_stock (material_id, depot_id, number)
values
<foreach collection="list" item="item" separator=",">
(#{item.materialId,jdbcType=BIGINT}, #{item.depotId,jdbcType=BIGINT},#{item.number,jdbcType=DECIMAL})
</foreach >
insert into jsh_material_initial_stock (material_id, depot_id, number)
values
<foreach collection="list" item="item" separator=",">
(#{item.materialId,jdbcType=BIGINT}, #{item.depotId,jdbcType=BIGINT},#{item.number,jdbcType=DECIMAL})
</foreach >
</insert>
<select id="getListExceptZero" resultType="com.jsh.erp.datasource.entities.MaterialInitialStock">
select * from jsh_material_initial_stock where number!=0
and ifnull(delete_flag,'0') !='1'
select * from jsh_material_initial_stock where number!=0
and ifnull(delete_flag,'0') !='1'
</select>
<update id="batchDeleteByDepots">
update jsh_material_initial_stock
set delete_flag='1'
where 1=1
and depot_id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper>