毛利分析的客户区域筛选。
This commit is contained in:
@@ -24,6 +24,8 @@ public class PrcProfitReportQuery extends BaseEntity
|
||||
private String customerCode;
|
||||
/** 客户代码拆分后的多值查询条件。 */
|
||||
private List<String> customerCodes;
|
||||
/** 按客户当前区域筛选。 */
|
||||
private String customerArea;
|
||||
private String customerName;
|
||||
/** 客户名称拆分后的多值查询条件。 */
|
||||
private List<String> customerNames;
|
||||
|
||||
@@ -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 >= #{beginBizDate}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user