diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/MonthlyCustomerShipmentStatVO.java b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/MonthlyCustomerShipmentStatVO.java index 68adf333a..8d03d1636 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/MonthlyCustomerShipmentStatVO.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/domain/vo/MonthlyCustomerShipmentStatVO.java @@ -87,5 +87,13 @@ public class MonthlyCustomerShipmentStatVO implements Serializable { /* 进口实际重量 */ @Excel(name = "进口实际重量") private BigDecimal importWeight; + + /* 其他票数 */ + @Excel(name = "其他票数") + private Integer otherTickets; + + /* 其他实际重量 */ + @Excel(name = "其他实际重量") + private BigDecimal otherWeight; } diff --git a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml index 8ea1e99f7..653255a7a 100644 --- a/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisWaybillMapper.xml @@ -4009,7 +4009,9 @@ 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, 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 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' @@ -4139,18 +4141,30 @@ - AND EXISTS ( - SELECT 1 FROM emis_trans_line tl - WHERE tl.line_code = a.trans_line_type - AND tl.del_flag = '0' - - AND a.receive_country = '0086' - - - AND FIND_IN_SET(tl.trans_type, #{transType}) + + AND a.receive_country != '0086' + AND NOT EXISTS ( + SELECT 1 FROM emis_trans_line tl + WHERE tl.line_code = a.trans_line_type + AND tl.del_flag = '0' AND a.send_country = '0086' - - ) + AND tl.trans_type IN ('1','2','3','4','5') + ) + + + AND EXISTS ( + SELECT 1 FROM emis_trans_line tl + WHERE tl.line_code = a.trans_line_type + AND tl.del_flag = '0' + + AND a.receive_country = '0086' + + + AND FIND_IN_SET(tl.trans_type, #{transType}) + AND a.send_country = '0086' + + ) +