demand: 月结客户出货统计增加其他

committer: heyu
This commit is contained in:
aike 2025-11-12 11:31:06 +08:00
parent 0b90432a1b
commit 8049915cd8
2 changed files with 34 additions and 12 deletions

View File

@ -87,5 +87,13 @@ public class MonthlyCustomerShipmentStatVO implements Serializable {
/* 进口实际重量 */ /* 进口实际重量 */
@Excel(name = "进口实际重量") @Excel(name = "进口实际重量")
private BigDecimal importWeight; private BigDecimal importWeight;
/* 其他票数 */
@Excel(name = "其他票数")
private Integer otherTickets;
/* 其他实际重量 */
@Excel(name = "其他实际重量")
private BigDecimal otherWeight;
} }

View File

@ -4009,7 +4009,9 @@
SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '4' THEN 1 ELSE 0 END) AS seaTickets, SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '4' THEN 1 ELSE 0 END) AS seaTickets,
IFNULL(SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '4' THEN a.bill_weight ELSE 0 END), 0) AS seaWeight, IFNULL(SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '4' THEN a.bill_weight ELSE 0 END), 0) AS seaWeight,
SUM(CASE WHEN a.receive_country = '0086' THEN 1 ELSE 0 END) AS importTickets, SUM(CASE WHEN a.receive_country = '0086' THEN 1 ELSE 0 END) AS importTickets,
IFNULL(SUM(CASE WHEN a.receive_country = '0086' THEN a.bill_weight ELSE 0 END), 0) AS importWeight IFNULL(SUM(CASE WHEN a.receive_country = '0086' THEN a.bill_weight ELSE 0 END), 0) AS importWeight,
SUM(CASE WHEN a.receive_country != '0086' AND NOT (a.send_country = '0086' AND tl.trans_type IN ('1','2','3','4','5')) THEN 1 ELSE 0 END) AS otherTickets,
IFNULL(SUM(CASE WHEN a.receive_country != '0086' AND NOT (a.send_country = '0086' AND tl.trans_type IN ('1','2','3','4','5')) THEN a.bill_weight ELSE 0 END), 0) AS otherWeight
FROM emis_waybill a FROM emis_waybill a
LEFT JOIN emis_trans_line tl ON a.trans_line_type = tl.line_code AND tl.del_flag = '0' LEFT JOIN emis_trans_line tl ON a.trans_line_type = tl.line_code AND tl.del_flag = '0'
LEFT JOIN emis_customer_user cu ON a.customer_code = cu.customer_code AND cu.del_flag = '0' LEFT JOIN emis_customer_user cu ON a.customer_code = cu.customer_code AND cu.del_flag = '0'
@ -4139,18 +4141,30 @@
</if> </if>
<!-- 运输方式筛选 --> <!-- 运输方式筛选 -->
<if test="transType != null and transType != ''"> <if test="transType != null and transType != ''">
AND EXISTS ( <if test="transType == 'other'">
SELECT 1 FROM emis_trans_line tl AND a.receive_country != '0086'
WHERE tl.line_code = a.trans_line_type AND NOT EXISTS (
AND tl.del_flag = '0' SELECT 1 FROM emis_trans_line tl
<if test="transType == 'import'"> WHERE tl.line_code = a.trans_line_type
AND a.receive_country = '0086' AND tl.del_flag = '0'
</if>
<if test="transType != 'import'">
AND FIND_IN_SET(tl.trans_type, #{transType})
AND a.send_country = '0086' AND a.send_country = '0086'
</if> AND tl.trans_type IN ('1','2','3','4','5')
) )
</if>
<if test="transType != 'other'">
AND EXISTS (
SELECT 1 FROM emis_trans_line tl
WHERE tl.line_code = a.trans_line_type
AND tl.del_flag = '0'
<if test="transType == 'import'">
AND a.receive_country = '0086'
</if>
<if test="transType != 'import'">
AND FIND_IN_SET(tl.trans_type, #{transType})
AND a.send_country = '0086'
</if>
)
</if>
</if> </if>
<!-- 权限控制 --> <!-- 权限控制 -->
<if test="params.privSiteCode != null and params.privSiteCode != '88888'"> <if test="params.privSiteCode != null and params.privSiteCode != '88888'">