fix(sip): 修复生成订单编码异常问题

- 优化了 selectMaxOrderCode 查询,使用动态长度计算订单编码的起始位置
- 提高了代码的灵活性和鲁棒性,避免了固定长度带来的潜在问题
master
chenhao 2025-06-06 17:47:34 +08:00
parent ab440f6896
commit d2eb5e8f9b
1 changed files with 1 additions and 3 deletions

View File

@ -95,12 +95,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</select>
<select id="selectMaxOrderCode" resultType="java.lang.Integer">
select ifnull( max(SUBSTR( order_code FROM 16 FOR 3 )), 0 )
select ifnull( max(SUBSTR( order_code FROM LENGTH(#{province})+1 FOR 3 )), 0 )
from project_order_info
where order_code like concat(#{province}, '%')
</select>
<select id="selectAgentProvinceByProjectId" resultType="java.lang.String">
select t2.province