Merge remote-tracking branch 'origin/feature/20260716/wms-module' into feature/20260716/wms-module
# Conflicts: # .gitignore
This commit is contained in:
@@ -65,10 +65,10 @@ mybatis-plus:
|
||||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||||
# id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||||
# id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
|
||||
# id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
|
||||
# id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
|
||||
id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
banner: false # 关闭控制台的 Banner 打印
|
||||
|
||||
@@ -2,11 +2,94 @@
|
||||
<!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.iostorinvdtl.IostorinvDtlMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
<sql id="availableInventoryColumns">
|
||||
gp.group_id AS group_id,
|
||||
gp.vehicle_code AS vehicle_code,
|
||||
gp.pcsn AS pcsn,
|
||||
gp.material_id AS material_id,
|
||||
gp.material_code AS material_code,
|
||||
mb.material_name AS material_name,
|
||||
gp.qty - COALESCE(gp.frozen_qty, 0) AS available_qty,
|
||||
gp.qty_unit_id AS qty_unit_id,
|
||||
gp.qty_unit_name AS qty_unit_name,
|
||||
gp.ext_code AS ext_code,
|
||||
gp.ext_type AS ext_type,
|
||||
gp.ext_dtl_code AS ext_dtl_code,
|
||||
sa.stor_id AS stor_id,
|
||||
sa.stor_code AS stor_code,
|
||||
sa.stor_name AS stor_name
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
<select id="selectAvailableInventoryPage"
|
||||
resultType="cn.code.nl.module.wms.controller.admin.iostorinv.vo.AvailableInventoryRespVO">
|
||||
SELECT <include refid="availableInventoryColumns"/>
|
||||
FROM wms_group_plate gp
|
||||
INNER JOIN (
|
||||
SELECT stor_id, storagevehicle_code, MAX(stor_code) AS stor_code, MAX(stor_name) AS stor_name
|
||||
FROM wms_structattr
|
||||
WHERE deleted = 0
|
||||
GROUP BY stor_id, storagevehicle_code
|
||||
) sa ON sa.storagevehicle_code = gp.vehicle_code
|
||||
LEFT JOIN base_materialbase mb ON mb.material_id = gp.material_id AND mb.deleted = 0
|
||||
WHERE sa.stor_id = #{reqVO.storId}
|
||||
AND gp.status = '可用'
|
||||
AND gp.qty - COALESCE(gp.frozen_qty, 0) > 0
|
||||
AND gp.deleted = 0
|
||||
<if test="reqVO.materialCode != null and reqVO.materialCode != ''">
|
||||
AND gp.material_code LIKE CONCAT('%', #{reqVO.materialCode}, '%')
|
||||
</if>
|
||||
<if test="reqVO.vehicleCode != null and reqVO.vehicleCode != ''">
|
||||
AND gp.vehicle_code LIKE CONCAT('%', #{reqVO.vehicleCode}, '%')
|
||||
</if>
|
||||
<if test="reqVO.pcsn != null and reqVO.pcsn != ''">
|
||||
AND gp.pcsn LIKE CONCAT('%', #{reqVO.pcsn}, '%')
|
||||
</if>
|
||||
ORDER BY gp.vehicle_code, gp.group_id
|
||||
</select>
|
||||
|
||||
<select id="selectAvailableInventoryByVehicleCodes"
|
||||
resultType="cn.code.nl.module.wms.controller.admin.iostorinv.vo.AvailableInventoryRespVO">
|
||||
SELECT <include refid="availableInventoryColumns"/>
|
||||
FROM wms_group_plate gp
|
||||
INNER JOIN (
|
||||
SELECT stor_id, storagevehicle_code, MAX(stor_code) AS stor_code, MAX(stor_name) AS stor_name
|
||||
FROM wms_structattr
|
||||
WHERE deleted = 0
|
||||
GROUP BY stor_id, storagevehicle_code
|
||||
) sa ON sa.storagevehicle_code = gp.vehicle_code
|
||||
LEFT JOIN base_materialbase mb ON mb.material_id = gp.material_id AND mb.deleted = 0
|
||||
WHERE sa.stor_id = #{storId}
|
||||
AND gp.status = '可用'
|
||||
AND gp.qty - COALESCE(gp.frozen_qty, 0) > 0
|
||||
AND gp.deleted = 0
|
||||
AND gp.vehicle_code IN
|
||||
<foreach collection="vehicleCodes" item="vehicleCode" open="(" separator="," close=")">
|
||||
#{vehicleCode}
|
||||
</foreach>
|
||||
ORDER BY gp.vehicle_code, gp.group_id
|
||||
</select>
|
||||
|
||||
<select id="selectAvailableInventoryByVehicleCodesForUpdate"
|
||||
resultType="cn.code.nl.module.wms.controller.admin.iostorinv.vo.AvailableInventoryRespVO">
|
||||
SELECT <include refid="availableInventoryColumns"/>
|
||||
FROM wms_group_plate gp
|
||||
INNER JOIN (
|
||||
SELECT stor_id, storagevehicle_code, MAX(stor_code) AS stor_code, MAX(stor_name) AS stor_name
|
||||
FROM wms_structattr
|
||||
WHERE deleted = 0
|
||||
GROUP BY stor_id, storagevehicle_code
|
||||
) sa ON sa.storagevehicle_code = gp.vehicle_code
|
||||
LEFT JOIN base_materialbase mb ON mb.material_id = gp.material_id AND mb.deleted = 0
|
||||
WHERE sa.stor_id = #{storId}
|
||||
AND gp.status = '可用'
|
||||
AND gp.qty - COALESCE(gp.frozen_qty, 0) > 0
|
||||
AND gp.deleted = 0
|
||||
AND gp.vehicle_code IN
|
||||
<foreach collection="vehicleCodes" item="vehicleCode" open="(" separator="," close=")">
|
||||
#{vehicleCode}
|
||||
</foreach>
|
||||
ORDER BY gp.vehicle_code, gp.group_id
|
||||
FOR UPDATE
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user