优化订单分批出入库的状态计算逻辑

This commit is contained in:
季圣华
2022-05-17 00:04:35 +08:00
parent ae216488fe
commit 8b88d0abc4
4 changed files with 89 additions and 9 deletions

View File

@@ -90,6 +90,11 @@
<result column="total_num" jdbcType="VARCHAR" property="totalNum" />
</resultMap>
<resultMap id="materialSumMap" type="com.jsh.erp.datasource.entities.DepotItemVo4MaterialAndSum">
<result column="material_extend_id" jdbcType="VARCHAR" property="materialExtendId" />
<result column="oper_number" jdbcType="VARCHAR" property="operNumber" />
</resultMap>
<select id="selectByConditionDepotItem" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap">
select *
FROM jsh_depot_item
@@ -614,4 +619,20 @@
where di.material_id=#{mId} and di.depot_id=#{depotId}
and ifnull(di.delete_flag,'0') !='1'
</select>
<select id="getLinkBillDetailMaterialSum" resultMap="materialSumMap">
select di.material_extend_id, sum(di.oper_number) oper_number from jsh_depot_head dh
left join jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
where dh.number=#{linkNumber}
and ifnull(dh.delete_flag,'0') !='1'
group by di.material_extend_id
</select>
<select id="getBatchBillDetailMaterialSum" resultMap="materialSumMap">
select di.material_extend_id, sum(di.oper_number) oper_number from jsh_depot_head dh
left join jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
where dh.link_number=#{linkNumber} and dh.type=#{type}
and ifnull(dh.delete_flag,'0') !='1'
group by di.material_extend_id
</select>
</mapper>