fix(oms/wms): 出库明细出库时间过滤严格按出仓日期outbound_date(去除建档时间兜底),所见即所筛

This commit is contained in:
rcx
2026-09-10 16:38:34 +08:00
parent 0b45ad181f
commit e2da7177f0
2 changed files with 9 additions and 9 deletions
@@ -565,12 +565,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="outOrderExpectEndTime != null"> <if test="outOrderExpectEndTime != null">
and b.expect_time &lt;= #{outOrderExpectEndTime} and b.expect_time &lt;= #{outOrderExpectEndTime}
</if> </if>
<!-- 出库时间区间(统计当天出库):优先实际出库时间OUTBOUND_TIME,为空按出仓日期OUTBOUND_DATE,再为空按建档时间兜底 --> <!-- 出库时间区间(统计当天出库):严格按出仓日期OUTBOUND_DATE过滤(页面所见即所筛) -->
<if test="outboundDateStart != null and outboundDateStart != ''"> <if test="outboundDateStart != null and outboundDateStart != ''">
and date_format(IFNULL(b.OUTBOUND_TIME, IFNULL(b.OUTBOUND_DATE, b.create_time)), '%Y-%m-%d') &gt;= #{outboundDateStart} and date_format(b.OUTBOUND_DATE, '%Y-%m-%d') &gt;= #{outboundDateStart}
</if> </if>
<if test="outboundDateEnd != null and outboundDateEnd != ''"> <if test="outboundDateEnd != null and outboundDateEnd != ''">
and date_format(IFNULL(b.OUTBOUND_TIME, IFNULL(b.OUTBOUND_DATE, b.create_time)), '%Y-%m-%d') &lt;= #{outboundDateEnd} and date_format(b.OUTBOUND_DATE, '%Y-%m-%d') &lt;= #{outboundDateEnd}
</if> </if>
and a.del_flag = 1 and a.del_flag = 1
and b.del_flag = 1 and b.del_flag = 1
@@ -404,7 +404,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
出库明细查询(关联出库单): 出库明细查询(关联出库单):
口径:仅已出库及后续完成状态(b.status in (9,12,13):已出库/已复核/已交接,与出库排名统计同口径); 口径:仅已出库及后续完成状态(b.status in (9,12,13):已出库/已复核/已交接,与出库排名统计同口径);
仅取 level=1 主行防父子行重复计数; 仅取 level=1 主行防父子行重复计数;
实际出仓日期筛选 IFNULL(b.outbound_date, b.create_time) 实际出仓日期筛选 b.outbound_date
注意:达梦数据库分页包裹查询不允许重复列名,单头列需与明细表 a 列名错开 注意:达梦数据库分页包裹查询不允许重复列名,单头列需与明细表 a 列名错开
b.out_order_number、b.warehouse_*、b.quantity 等与明细同名的列不重复查,明细行自带) b.out_order_number、b.warehouse_*、b.quantity 等与明细同名的列不重复查,明细行自带)
--> -->
@@ -474,12 +474,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<!-- 出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接,只统计已出库(9/12/13)的明细 --> <!-- 出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接,只统计已出库(9/12/13)的明细 -->
and b.status in (9, 12, 13) and b.status in (9, 12, 13)
<!-- 实际出仓日期区间(为空的历史单按建档时间兜底),用于统计当天出库 --> <!-- 实际出仓日期区间,用于统计当天出库(严格按出仓日期outbound_date过滤) -->
<if test="outboundDateStart != null and outboundDateStart != ''"> <if test="outboundDateStart != null and outboundDateStart != ''">
and date_format(IFNULL(b.outbound_date, b.create_time), '%Y-%m-%d') &gt;= #{outboundDateStart} and date_format(b.outbound_date, '%Y-%m-%d') &gt;= #{outboundDateStart}
</if> </if>
<if test="outboundDateEnd != null and outboundDateEnd != ''"> <if test="outboundDateEnd != null and outboundDateEnd != ''">
and date_format(IFNULL(b.outbound_date, b.create_time), '%Y-%m-%d') &lt;= #{outboundDateEnd} and date_format(b.outbound_date, '%Y-%m-%d') &lt;= #{outboundDateEnd}
</if> </if>
and a.level = 1 and a.level = 1
and a.del_flag = 1 and a.del_flag = 1
@@ -580,10 +580,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
and b.status in (9, 12, 13) and b.status in (9, 12, 13)
<if test="outboundDateStart != null and outboundDateStart != ''"> <if test="outboundDateStart != null and outboundDateStart != ''">
and date_format(IFNULL(b.outbound_date, b.create_time), '%Y-%m-%d') &gt;= #{outboundDateStart} and date_format(b.outbound_date, '%Y-%m-%d') &gt;= #{outboundDateStart}
</if> </if>
<if test="outboundDateEnd != null and outboundDateEnd != ''"> <if test="outboundDateEnd != null and outboundDateEnd != ''">
and date_format(IFNULL(b.outbound_date, b.create_time), '%Y-%m-%d') &lt;= #{outboundDateEnd} and date_format(b.outbound_date, '%Y-%m-%d') &lt;= #{outboundDateEnd}
</if> </if>
and a.level = 1 and a.level = 1
and a.del_flag = 1 and a.del_flag = 1