-- 控货订单数据刷新
-- 更新历史控货订单数据要求：
-- 1.订单控货=是 && 控货状态=控货中/部分控货 && 订单创建时间<=2024-11.28 00:00 && 订单发货人电话=订单收货人电话，更新订单限制修改收货人=否
UPDATE ecw_order o
    join ecw_order_consignor nor
on o.order_id = nor.order_id
    join ecw_order_consignee nee
    on o.order_id = nee.order_id
    SET o.is_limit_update_consignee = 0
WHERE o.is_cargo_control = 1 AND o.create_time <= '2024-11.28 00:00:00' AND nor.country_code = nee.country_code AND nor.phone = nee.phone;



-- 添加常用客户提货网点sql

INSERT INTO `system_dict_type`(`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`,
                                        `update_time`, `deleted`)
VALUES (null, '常用提货网点', 'pickup_points', 0, NULL, '115', '2024-11-29 14:39:24', '115',
        '2024-11-29 14:39:24', b'0');

INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`,
                                `creator`, `create_time`, `updater`, `update_time`, `deleted`, `label_en`)
VALUES
    (1, 'Alaba', '1', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Alaba'),
    (2, 'Tradefair', '2', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Tradefair'),
    (3, 'Island', '3', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Island'),
    (4, 'Oshodi', '4', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Oshodi'),
    (5, 'Onitsha', '5', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Onitsha'),
    (6, 'Kano', '6', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Kano'),
    (7, 'Odunade', '7', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Odunade'),
    (8, 'Accra', '8', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Accra'),
    (9, 'Kumasi', '9', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Kumasi'),
    (10, 'Abidjan', '10', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Abidjan'),
    (11, 'Dar es Salaam', '11', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Dar es Salaam'),
    (12, 'Dubai', '12', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Dubai'),
    (13, 'Nairobi', '13', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Nairobi'),
    (14, 'Mombasa', '14', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Mombasa'),
    (15, 'Nakuru', '15', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Nakuru'),
    (16, 'Maputo', '16', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Maputo'),
    (17, 'Beira', '17', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Beira'),
    (18, 'Chimoio', '18', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Chimoio'),
    (19, 'Quelimane', '19', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Quelimane'),
    (20, 'Nampula', '20', 'pickup_points', 0, 'default', '', NULL, '1', '2024-11-29 14:39:24', '115', '2024-11-29 14:39:24', b'0', 'Nampula');