新增库存列表接口,根据订单编号排序

追加入库接口逻辑修改
This commit is contained in:
2026-02-05 16:25:28 +08:00
parent 6ffafc81f4
commit 27a105b4f6
9 changed files with 170 additions and 19 deletions

View File

@@ -140,6 +140,33 @@
AND is_delete = '0'
</select>
<!-- 根据 pcode + 小仓编码 精准定位 -->
<select id="selectByPcodeAndWarehouse"
resultType="com.zg.project.information.domain.PcdeDetail">
SELECT
id,
pcode,
scene,
parent_warehouse_code AS parentWarehouseCode,
parent_warehouse_name AS parentWarehouseName,
warehouse_code AS warehouseCode,
warehouse_name AS warehouseName,
encoded_id AS encodedId,
tag,
is_delete AS isDelete,
created_by AS createdBy,
created_at AS createdAt,
updated_by AS updatedBy,
updated_at AS updatedAt,
remark
FROM pcde_detail
WHERE pcode = #{pcode}
AND warehouse_code = #{warehouseCode}
AND is_delete = '0'
LIMIT 1
</select>
<!-- 根据库位编码查编码后ID -->
<select id="selectEncodedIdByPcode"
resultType="java.lang.String"

View File

@@ -104,7 +104,6 @@
<select id="selectRkBillList" parameterType="RkBill" resultMap="RkBillResult">
<include refid="selectRkBillVo"/>
<where>
AND rb.is_delivery ='1'
<if test="wlType != null and wlType != ''">
AND rb.wl_type = #{wlType}
</if>
@@ -121,7 +120,7 @@
AND rb.operation_type = #{operationType}
</if>
<if test="bizTypeList != null and bizTypeList.size > 0">
<if test="bizTypeList != null and bizTypeList.size() > 0">
AND rb.biz_type IN
<foreach collection="bizTypeList" item="bt" open="(" separator="," close=")">
#{bt}

View File

@@ -500,4 +500,75 @@
ORDER BY t.operation_time DESC, t.id DESC
</select>
<!-- ========================= 按单据号排序查询列表 ========================= -->
<select id="selectRkInfoListOrderByBillNo" parameterType="RkInfo" resultMap="RkInfoResult">
<include refid="selectRkInfoVo"/>
<where>
ri.exec_status = 1
AND ri.is_chuku = 0
AND ri.is_delete = 0
<if test="operationType != null and operationType != ''">
AND ri.operation_type LIKE CONCAT('%', #{operationType}, '%')
</if>
<if test="sapNo != null and sapNo != ''">
AND ri.sap_no LIKE CONCAT('%', #{sapNo}, '%')
</if>
<if test="xmNo != null and xmNo != ''">
AND ri.xm_no LIKE CONCAT('%', #{xmNo}, '%')
</if>
<if test="xmMs != null and xmMs != ''">
AND ri.xm_ms LIKE CONCAT('%', #{xmMs}, '%')
</if>
<if test="wlNo != null and wlNo != ''">
AND ri.wl_no LIKE CONCAT('%', #{wlNo}, '%')
</if>
<if test="wlMs != null and wlMs != ''">
AND ri.wl_ms LIKE CONCAT('%', #{wlMs}, '%')
</if>
<if test="gysMc != null and gysMc != ''">
AND ri.gys_mc LIKE CONCAT('%', #{gysMc}, '%')
</if>
<if test="pcode != null and pcode != ''">
AND ri.pcode LIKE CONCAT('%', #{pcode}, '%')
</if>
<if test="bizType != null and bizType != ''">
AND ri.biz_type LIKE CONCAT('%', #{bizType}, '%')
</if>
<if test="wlType != null and wlType != ''">
AND ri.wl_type LIKE CONCAT('%', #{wlType}, '%')
</if>
<if test="cangku != null and cangku != ''">
AND ri.cangku LIKE CONCAT('%', #{cangku}, '%')
</if>
<if test="billNo != null and billNo != ''">
AND ri.bill_no LIKE CONCAT('%', #{billNo}, '%')
</if>
<if test="isDelete != null and isDelete != ''">
AND ri.is_delete = #{isDelete}
</if>
<!-- 出入库时间范围 -->
<if test="startDate != null">
AND ri.operation_time &gt;= #{startDate}
</if>
<if test="endDate != null">
AND ri.operation_time &lt;= #{endDate}
</if>
</where>
ORDER BY
/* 1. 纯数字优先 */
(ri.sap_no REGEXP '^[0-9]+$') DESC,
/* 2. 纯数字按【从小到大】 */
CASE
WHEN ri.sap_no REGEXP '^[0-9]+$'
THEN CAST(ri.sap_no AS UNSIGNED)
ELSE 999999999999
END ASC,
/* 3. 字母混合按字符串 */
ri.sap_no ASC
</select>
</mapper>