扫二维码签名;入库单号规则;

This commit is contained in:
王奎兴
2026-08-07 20:01:01 +08:00
parent 57b8dcfb02
commit fedeece533
6 changed files with 164 additions and 7 deletions
@@ -831,4 +831,53 @@
WHERE in_order_number = #{inOrderNumber}
</select>
<!-- 跨4张入库单表查询指定前缀+组织+仓库的所有入库单号(取最大序号+1,防止删单后单号重复) -->
<select id="getMaxStockInOrderByPrefixAndOrgAndWarehouse" resultType="java.lang.String">
SELECT in_order_number FROM reserve_stock_in_order
WHERE in_order_number LIKE concat(#{prefix}, '%')
AND del_flag = 1
<if test="organizationId != null">
AND organization_id = #{organizationId}
</if>
<if test="warehouseId != null">
AND warehouse_id = #{warehouseId}
</if>
UNION ALL
SELECT in_order_number FROM reservation_stock_in_order
WHERE in_order_number LIKE concat(#{prefix}, '%')
AND del_flag = 1
<if test="organizationId != null">
AND organization_id = #{organizationId}
</if>
<if test="warehouseId != null">
AND warehouse_id = #{warehouseId}
</if>
UNION ALL
SELECT in_order_number FROM execution_stock_in_order
WHERE in_order_number LIKE concat(#{prefix}, '%')
AND del_flag = 1
<if test="organizationId != null">
AND organization_id = #{organizationId}
</if>
<if test="warehouseId != null">
AND warehouse_id = #{warehouseId}
</if>
UNION ALL
SELECT in_order_number FROM NGWL_TEST_WMS.stock_in_order
WHERE in_order_number LIKE concat(#{prefix}, '%')
AND del_flag = 1
<if test="organizationId != null">
AND organization_id = #{organizationId}
</if>
<if test="warehouseId != null">
AND warehouse_id = #{warehouseId}
</if>
</select>
</mapper>