feat:出库单一键设置功能及移库单CRUD
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.code.nl.module.wms.dal.mysql.moveinvdtl.MoveInvDtlMapper">
|
||||
|
||||
<select id="selectByMoveinvId"
|
||||
resultType="cn.code.nl.module.wms.dal.dataobject.moveinvdtl.MoveInvDtlDO">
|
||||
SELECT *
|
||||
FROM wms_moveinvdtl
|
||||
WHERE moveinv_id = #{moveinvId}
|
||||
ORDER BY seq_no
|
||||
</select>
|
||||
|
||||
<delete id="deleteByMoveinvId">
|
||||
DELETE FROM wms_moveinvdtl WHERE moveinv_id = #{moveinvId}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -1,12 +1,107 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.code.nl.module.wms.dal.mysql.structAttr.StrucAttrMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
<select id="selectMoveAvailableInventory"
|
||||
resultType="cn.code.nl.module.wms.controller.admin.moveinv.vo.MoveInvInventoryRespVO">
|
||||
SELECT sa.struct_id,
|
||||
sa.struct_code,
|
||||
sa.struct_name,
|
||||
sa.sect_id,
|
||||
sa.sect_code,
|
||||
sa.sect_name,
|
||||
sa.stor_id,
|
||||
sa.storagevehicle_code,
|
||||
sa.layer_num,
|
||||
MAX(gp.material_code) AS material_code,
|
||||
MAX(gp.pcsn) AS pcsn,
|
||||
MAX(gp.qty_unit_id) AS qty_unit_id,
|
||||
MAX(gp.qty_unit_name) AS qty_unit_name,
|
||||
SUM(gp.qty) AS qty,
|
||||
MAX(gp.ext_code) AS source_bill_code
|
||||
FROM wms_structattr sa
|
||||
JOIN wms_group_plate gp
|
||||
ON gp.vehicle_code = sa.storagevehicle_code
|
||||
AND gp.deleted = 0
|
||||
AND gp.status = '02'
|
||||
WHERE sa.deleted = '0'
|
||||
AND sa.is_used = 1
|
||||
AND sa.lock_type = '1'
|
||||
AND sa.storagevehicle_code IS NOT NULL
|
||||
AND sa.storagevehicle_code != ''
|
||||
<if test="storId != null and storId != ''">
|
||||
AND sa.stor_id = #{storId}
|
||||
</if>
|
||||
<if test="sectId != null and sectId != ''">
|
||||
AND sa.sect_id = #{sectId}
|
||||
</if>
|
||||
<if test="vehicleCodes != null and vehicleCodes.size() > 0">
|
||||
AND sa.storagevehicle_code IN
|
||||
<foreach collection="vehicleCodes" item="code" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY sa.struct_id, sa.struct_code, sa.struct_name, sa.sect_id, sa.sect_code,
|
||||
sa.sect_name, sa.stor_id, sa.storagevehicle_code, sa.layer_num
|
||||
ORDER BY sa.struct_id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
<select id="selectMoveTargetCandidates"
|
||||
resultType="cn.code.nl.module.wms.dal.dataobject.structAttr.StrucAttrDO">
|
||||
SELECT *
|
||||
FROM wms_structattr
|
||||
WHERE deleted = '0'
|
||||
AND is_used = 1
|
||||
AND lock_type = '1'
|
||||
AND (storagevehicle_code IS NULL OR storagevehicle_code = '')
|
||||
AND stor_id = #{storId}
|
||||
AND sect_id = #{sectId}
|
||||
AND layer_num = #{layerNum}
|
||||
ORDER BY row_num, col_num, block_num, struct_id
|
||||
</select>
|
||||
|
||||
<select id="selectByStructCode"
|
||||
resultType="cn.code.nl.module.wms.dal.dataobject.structAttr.StrucAttrDO">
|
||||
SELECT *
|
||||
FROM wms_structattr
|
||||
WHERE deleted = '0'
|
||||
AND struct_code = #{structCode}
|
||||
</select>
|
||||
|
||||
<update id="lockForMoveOut">
|
||||
UPDATE wms_structattr
|
||||
SET lock_type = '4',
|
||||
inv_type = '3',
|
||||
inv_id = #{invId},
|
||||
inv_code = #{invCode}
|
||||
WHERE deleted = '0'
|
||||
AND struct_code = #{structCode}
|
||||
AND lock_type = '1'
|
||||
AND storagevehicle_code IS NOT NULL
|
||||
AND storagevehicle_code != ''
|
||||
</update>
|
||||
|
||||
<update id="lockForMoveIn">
|
||||
UPDATE wms_structattr
|
||||
SET lock_type = '5',
|
||||
inv_type = '3',
|
||||
inv_id = #{invId},
|
||||
inv_code = #{invCode}
|
||||
WHERE deleted = '0'
|
||||
AND struct_code = #{structCode}
|
||||
AND lock_type = '1'
|
||||
AND (storagevehicle_code IS NULL OR storagevehicle_code = '')
|
||||
</update>
|
||||
|
||||
<update id="unlockMoveInv">
|
||||
UPDATE wms_structattr
|
||||
SET lock_type = '1',
|
||||
inv_type = NULL,
|
||||
inv_id = NULL,
|
||||
inv_code = NULL
|
||||
WHERE deleted = '0'
|
||||
AND inv_id = #{invId}
|
||||
AND lock_type IN ('4', '5')
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user