毛利分析的客户区域筛选。

This commit is contained in:
caojia
2026-11-05 14:26:36 +08:00
parent 218001e6ae
commit 1727386811
3 changed files with 59 additions and 7 deletions
@@ -119,6 +119,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="profitReportFromAndWhere">
from prc_income_bill i
inner join prc_order_bill p on p.bill_id = i.bill_id
<if test="customerArea != null and customerArea != ''">
left join ctr_customer c on c.customer_id = p.customer_id and c.del_flag = '0'
</if>
<!-- 提成表关联暂停使用,毛利报表不再依赖提成配置。
left join prc_profit_commission_rate cr
on cr.belong_saler_code = i.belong_saler_code and cr.status = '0'
@@ -126,6 +129,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<!-- 不将未匹配产品、国家或重量段的计费失败订单纳入毛利报表;保留历史空值(按成功处理)。 -->
and (p.billing_fail_status is null or p.billing_fail_status not in (1, 2, 3))
<if test="customerArea != null and customerArea != ''">
and c.customer_area = #{customerArea}
</if>
<if test="beginBizDate != null">
and p.biz_date &gt;= #{beginBizDate}
</if>