INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(7,'审批银行收款明细','7','receipt_link',0,'default','',NULL,'1','2025-01-02 17:35:17','1','2025-01-02 17:35:17',b'0','Approve Bank Receipt',NULL);
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(7,'审批银行收款明细','7','receipt_link',0,'default','',NULL,'1','2025-01-02 17:35:17','1','2025-01-02 17:35:17',b'0','Approve Bank Receipt',NULL);
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(8,'核销收款单','8','receipt_link',0,'default','',NULL,'1','2025-01-02 17:35:36','1','2025-01-02 17:35:36',b'0','Write Off Receipt',NULL);
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(8,'核销收款单','8','receipt_link',0,'default','',NULL,'1','2025-01-02 17:35:36','1','2025-01-02 17:35:36',b'0','Write Off Receipt',NULL);
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(9,'反核销收款单','9','receipt_link',0,'default','',NULL,'1','2025-01-02 17:35:52','1','2025-01-02 17:35:52',b'0','Reject Write Off Receipt',NULL);
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(9,'反核销收款单','9','receipt_link',0,'default','',NULL,'1','2025-01-02 17:35:52','1','2025-01-02 17:35:52',b'0','Reject Write Off Receipt',NULL);
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(2,'小于等于','2','income_relation_symbol',0,'default','',NULL,'1','2025-01-09 13:46:19','1','2025-01-09 13:46:19',b'0','Less or equal','inférieur ou égal à');
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(4,'开票资料消息','4','internal_message_type',0,'default','',NULL,'1','2025-01-10 15:32:05','1','2025-01-10 15:32:05',b'0','Invoicing Data Message',' Message d\'information sur la facturation');
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(5,'开票消息','5','internal_message_type',0,'default','',NULL,'1','2025-01-10 15:33:02','1','2025-01-10 15:33:02',b'0','Invoicing Message','Message de facturation');
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(0,'未完成','0','lading_Bill_Status_Data',0,'default','',NULL,'2696','2025-01-13 17:15:41','2696','2025-01-13 17:15:41',b'0','unfinished','To Be Continued.');
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(0,'目的国','0','attribution_of_income',0,'default','',NULL,'2696','2025-01-14 16:25:16','2696','2025-01-14 16:25:16',b'0','country of destination','Pays de destination');
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(1,'始发国','1','attribution_of_income',0,'default','',NULL,'2696','2025-01-14 16:25:53','2696','2025-01-14 16:25:53',b'0','Country of origin','Pays de départ');
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(0,'大于等于','gePickRatio','pickup_rate_comparison_symbols',0,'default','',NULL,'1','2025-01-15 18:15:04','1','2025-01-16 15:13:07',b'0','great than or equal to','Supérieur ou égal');
INSERTINTO`system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`label_en`,`label_fr`)VALUES(1,'小于等于','lePickRatio','pickup_rate_comparison_symbols',0,'default','',NULL,'1','2025-01-15 18:16:04','1','2025-01-16 15:13:44',b'0','less than or equal to','Inférieur ou égal');
INSERTINTO`system_menu`(`name`,`permission`,`menu_type`,`sort`,`parent_id`,`path`,`icon`,`component`,`status`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`is_show_in_menu_bar`,`name_en`,`keepalive`,`redirect`,`badge_field`)VALUES('申请开票','ecw:voucher:applyInvoice',3,13,1634,'','','',0,'1','2024-12-23 09:24:01','1','2024-12-23 09:24:01',b'0',b'1','Apply for Invoice',b'0',NULL,NULL);
INSERTINTO`system_menu`(`name`,`permission`,`menu_type`,`sort`,`parent_id`,`path`,`icon`,`component`,`status`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`is_show_in_menu_bar`,`name_en`,`keepalive`,`redirect`,`badge_field`)VALUES('申请开票','ecw:voucher:applyInvoice',3,13,1634,'','','',0,'1','2024-12-23 09:24:01','1','2024-12-23 09:24:01',b'0',b'1','Apply for Invoice',b'0',NULL,NULL);
UPDATE`system_menu`SET`name`='应收报表',`permission`='',`menu_type`=2,`sort`=0,`parent_id`=(SELECTtmp.idFROM(SELECTidFROMsystem_menuWHERE`name`='应收')tmp),`path`='self_no_report',`icon`='button',`component`='ecw/financial/selfNoReport',`status`=0,`creator`='115',`create_time`='2023-07-15 23:06:11',`updater`='2696',`update_time`='2025-01-14 16:00:54',`deleted`=b'0',`is_show_in_menu_bar`=b'1',`name_en`='Self No Report',`keepalive`=b'0',`redirect`=NULL,`badge_field`=NULLWHERE`id`=2131;
(select su.nickname from system_user su where su.deleted = 0 and su.id = o.salesman_id) as salesman_name,
(select min(wi.`in_time`) from ecw_order_warehouse_in wi where wi.deleted = 0 and wi.order_id = o.order_id ) as in_time
FROM ecw_order o
LEFT JOIN (
SELECT
ewl.id AS line_id,
ew_start.id AS start_warehouse_id,
ew_dest.id AS dst_warehouse_id,
ew_start.title_zh AS start_title_zh,
IF( #{query.lang} = 0, ew_dest.title_zh, ew_dest.title_en ) AS dst_warehouse_name,
IF( #{query.lang} = 0, ew_start.title_zh, ew_start.title_en ) AS start_warehouse_name
FROM
ecw_warehouse_line ewl
LEFT JOIN ecw_warehouse ew_start ON ewl.start_warehouse_id = ew_start.id
LEFT JOIN ecw_warehouse ew_dest ON ewl.dest_warehouse_id = ew_dest.id
) w ON w.line_id = o.line_id
LEFT JOIN ecw_order_consignor nor on nor.order_id = o.order_id and nor.deleted = 0
LEFT JOIN ecw_order_consignee nee on nee.order_id = o.order_id and nee.deleted = 0
LEFT JOIN ecw_make_bill_of_lading bl on bl.order_id = o.order_id and bl.deleted = 0
LEFT JOIN ecw_customer norc on norc.id = nor.customer_id
LEFT JOIN ecw_customer neeo on neeo.id = nee.customer_id
WHERE o.`container_number` = #{query.containerNumber}
</select>
<sqlid="containerOrderSummaryQuery">
<iftest="query.orderNo != null and query.orderNo != '' ">
AND o.`order_no` like concat("%",concat(#{query.orderNo},"%"))
</if>
<iftest="query.tidanNo != null and query.tidanNo != '' ">
AND o.`tidan_no` like concat("%",concat(#{query.tidanNo},"%"))
</if>
<iftest="query.marks != null and query.marks != '' ">
AND o.`marks` like concat("%",concat(#{query.marks},"%"))
</if>
<iftest="query.consignorKey != null and query.consignorKey != '' ">
AND (concat(IFNULL(nor.`name`,''),IFNULL(nor.`name_en`,''),IFNULL(nor.`phone`,'')) like
concat("%",concat(#{query.consignorKey},"%"))
OR nor.customer_id in (select c.id from ecw_customer c where c.number like
concat("%",concat(#{query.consignorKey},"%"))))
</if>
<iftest="query.consigneeKey != null and query.consigneeKey != '' ">
AND (concat(IFNULL(nee.`name`,''),IFNULL(nee.`name_en`,''),IFNULL(nee.`phone`,'')) like
concat("%",concat(#{query.consigneeKey},"%"))
OR nee.customer_id in (select c.id from ecw_customer c where c.number like
concat("%",concat(#{query.consigneeKey},"%"))))
</if>
<iftest="query.startWarehouseIds !=null and query.startWarehouseIds.size() > 0 and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
<iftest="query.startWarehouseIds !=null and query.startWarehouseIds.size() > 0 and (query.destWarehouseIds==null or query.destWarehouseIds.size() == 0) ">
<iftest="(query.startWarehouseIds ==null or query.startWarehouseIds.size() == 0) and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
AND concat(r.`title_zh`, r.`title_en`) like concat("%",concat(#{query.title},"%"))
AND concat(r.`title_zh`, r.`title_en`) like concat("%",concat(#{query.title},"%"))
</if>
</if>
<iftest="query.consignorNameOrPhone != null and query.consignorNameOrPhone != '' ">
<iftest="query.consignorNameOrPhone != null and query.consignorNameOrPhone != '' ">
AND (nor.`name` like concat("%",#{query.consignorNameOrPhone},"%") or nor.`phone` like concat("%",#{query.consignorNameOrPhone},"%") or nor.`company` like concat("%",#{query.consignorNameOrPhone},"%"))
AND (nor.`name` like concat("%",#{query.consignorNameOrPhone},"%") or nor.`phone` like
concat("%",#{query.consignorNameOrPhone},"%") or nor.`company` like
concat("%",#{query.consignorNameOrPhone},"%"))
</if>
</if>
<iftest="query.consigneeNameOrPhone != null and query.consigneeNameOrPhone != '' ">
<iftest="query.consigneeNameOrPhone != null and query.consigneeNameOrPhone != '' ">
AND (nee.`name` like concat("%",#{query.consigneeNameOrPhone},"%") or nee.`phone` like concat("%",#{query.consigneeNameOrPhone},"%") or nee.`company` like concat("%",#{query.consigneeNameOrPhone},"%"))
AND (nee.`name` like concat("%",#{query.consigneeNameOrPhone},"%") or nee.`phone` like
concat("%",#{query.consigneeNameOrPhone},"%") or nee.`company` like
concat("%",#{query.consigneeNameOrPhone},"%"))
</if>
</if>
<iftest="query.orderNo != null and query.orderNo != '' ">
<iftest="query.orderNo != null and query.orderNo != '' ">
AND r.`order_no` like concat("%",concat(#{query.orderNo},"%"))
AND r.`order_no` like concat("%",concat(#{query.orderNo},"%"))
LEFT JOIN ( SELECT shipment_id, COUNT( DISTINCT order_id ) AS orderCount FROM ecw_box_preload_goods WHERE deleted = 0 AND is_remove = 0 GROUP BY shipment_id ) preload ON box.id = preload.shipment_id
LEFT JOIN ( SELECT shipment_id, COUNT(*) AS ladingCount FROM ecw_make_bill_of_lading WHERE deleted = 0 AND STATUS = 2 GROUP BY shipment_id ) lading ON box.id = lading.shipment_id
WHERE
box.deleted = 0 AND box.pr_status > 21 AND box.dest_country_id > 0
<iftest="query.beginDaogangTime != null and query.endDaogangTime != null">
AND box.dg_date BETWEEN #{query.beginDaogangTime} AND #{query.endDaogangTime}
</if>
<iftest="query.beginQingguanTime != null and query.endQingguanTime != null">
AND box.qg_date BETWEEN #{query.beginQingguanTime} AND #{query.endQingguanTime}
</if>
<iftest="query.selfNo != null and query.selfNo != '' ">
AND box.self_no LIKE concat('%',#{query.selfNo},'%')
</if>
<iftest="query.startWarehouseIdList != null and query.startWarehouseIdList.size() > 0">