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

追加入库接口逻辑修改
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

@@ -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>