# 退款单新增商家备注字段
USE mall4cloud_order_0;
DELIMITER //
DROP PROCEDURE IF EXISTS updateRefundColumn //
CREATE PROCEDURE updateRefundColumn()
BEGIN
    DECLARE i INT;
    SET i = 0;
    WHILE i < 32 DO
        SET @add_column = CONCAT( 'ALTER TABLE order_refund_', i, " ADD COLUMN `shop_seller_msg` varchar(300) NULL COMMENT '商家备注(移交供应商处理时保存)' AFTER `seller_msg`" );
        PREPARE add_column FROM @add_column;
        EXECUTE add_column;
        SET i = i + 1;
    END WHILE;
END //
CALL updateRefundColumn() //
DROP  PROCEDURE updateRefundColumn //
DELIMITER;

USE mall4cloud_order_1;
DELIMITER //
DROP PROCEDURE IF EXISTS updateRefundColumn //
CREATE PROCEDURE updateRefundColumn()
BEGIN
    DECLARE i INT;
    SET i = 0;
    WHILE i < 32 DO
        SET @add_column = CONCAT( 'ALTER TABLE order_refund_', i, " ADD COLUMN `shop_seller_msg` varchar(300) NULL COMMENT '商家备注(移交供应商处理时保存)' AFTER `seller_msg`" );
        PREPARE add_column FROM @add_column;
        EXECUTE add_column;
        SET i = i + 1;
    END WHILE;
END //
CALL updateRefundColumn() //
DROP  PROCEDURE updateRefundColumn //
DELIMITER;

USE mall4cloud_order_2;
DELIMITER //
DROP PROCEDURE IF EXISTS updateRefundColumn //
CREATE PROCEDURE updateRefundColumn()
BEGIN
    DECLARE i INT;
    SET i = 0;
    WHILE i < 32 DO
        SET @add_column = CONCAT( 'ALTER TABLE order_refund_', i, " ADD COLUMN `shop_seller_msg` varchar(300) NULL COMMENT '商家备注(移交供应商处理时保存)' AFTER `seller_msg`" );
        PREPARE add_column FROM @add_column;
        EXECUTE add_column;
        SET i = i + 1;
    END WHILE;
END //
CALL updateRefundColumn() //
DROP  PROCEDURE updateRefundColumn //
DELIMITER;

USE mall4cloud_order_3;
DELIMITER //
DROP PROCEDURE IF EXISTS updateRefundColumn //
CREATE PROCEDURE updateRefundColumn()
BEGIN
    DECLARE i INT;
    SET i = 0;
    WHILE i < 32 DO
        SET @add_column = CONCAT( 'ALTER TABLE order_refund_', i, " ADD COLUMN `shop_seller_msg` varchar(300) NULL COMMENT '商家备注(移交供应商处理时保存)' AFTER `seller_msg`" );
        PREPARE add_column FROM @add_column;
        EXECUTE add_column;
        SET i = i + 1;
    END WHILE;
END //
CALL updateRefundColumn() //
DROP  PROCEDURE updateRefundColumn //
DELIMITER;

USE mall4cloud_order_4;
DELIMITER //
DROP PROCEDURE IF EXISTS updateRefundColumn //
CREATE PROCEDURE updateRefundColumn()
BEGIN
    DECLARE i INT;
    SET i = 0;
    WHILE i < 32 DO
        SET @add_column = CONCAT( 'ALTER TABLE order_refund_', i, " ADD COLUMN `shop_seller_msg` varchar(300) NULL COMMENT '商家备注(移交供应商处理时保存)' AFTER `seller_msg`" );
        PREPARE add_column FROM @add_column;
        EXECUTE add_column;
        SET i = i + 1;
    END WHILE;
END //
CALL updateRefundColumn() //
DROP  PROCEDURE updateRefundColumn //
DELIMITER;

USE mall4cloud_order_5;
DELIMITER //
DROP PROCEDURE IF EXISTS updateRefundColumn //
CREATE PROCEDURE updateRefundColumn()
BEGIN
    DECLARE i INT;
    SET i = 0;
    WHILE i < 32 DO
        SET @add_column = CONCAT( 'ALTER TABLE order_refund_', i, " ADD COLUMN `shop_seller_msg` varchar(300) NULL COMMENT '商家备注(移交供应商处理时保存)' AFTER `seller_msg`" );
        PREPARE add_column FROM @add_column;
        EXECUTE add_column;
        SET i = i + 1;
    END WHILE;
END //
CALL updateRefundColumn() //
DROP  PROCEDURE updateRefundColumn //
DELIMITER;

USE mall4cloud_order_6;
DELIMITER //
DROP PROCEDURE IF EXISTS updateRefundColumn //
CREATE PROCEDURE updateRefundColumn()
BEGIN
    DECLARE i INT;
    SET i = 0;
    WHILE i < 32 DO
        SET @add_column = CONCAT( 'ALTER TABLE order_refund_', i, " ADD COLUMN `shop_seller_msg` varchar(300) NULL COMMENT '商家备注(移交供应商处理时保存)' AFTER `seller_msg`" );
        PREPARE add_column FROM @add_column;
        EXECUTE add_column;
        SET i = i + 1;
    END WHILE;
END //
CALL updateRefundColumn() //
DROP  PROCEDURE updateRefundColumn //
DELIMITER;

USE mall4cloud_order_7;
DELIMITER //
DROP PROCEDURE IF EXISTS updateRefundColumn //
CREATE PROCEDURE updateRefundColumn()
BEGIN
    DECLARE i INT;
    SET i = 0;
    WHILE i < 32 DO
        SET @add_column = CONCAT( 'ALTER TABLE order_refund_', i, " ADD COLUMN `shop_seller_msg` varchar(300) NULL COMMENT '商家备注(移交供应商处理时保存)' AFTER `seller_msg`" );
        PREPARE add_column FROM @add_column;
        EXECUTE add_column;
        SET i = i + 1;
    END WHILE;
END //
CALL updateRefundColumn() //
DROP  PROCEDURE updateRefundColumn //
DELIMITER;


# 添加小程序发货定时任务
USE `mall4cloud_job`;
INSERT INTO `xxl_job_info`(`job_group`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`,
                                     `schedule_type`, `schedule_conf`, `misfire_strategy`, `executor_route_strategy`,
                                     `executor_handler`, `executor_param`, `executor_block_strategy`,
                                     `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`,
                                     `glue_remark`, `glue_updatetime`, `child_jobid`, `trigger_status`,
                                     `trigger_last_time`, `trigger_next_time`)
VALUES (2, '小程序发货虚拟订单和自提订单定时任务', '2023-09-15 13:53:42', '2023-09-15 13:53:42', 'admin', '',
        'CRON', '0 0/1 * * * ?', 'DO_NOTHING', 'FIRST', 'wxAppShipment', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '',
        'GLUE代码初始化', '2023-09-15 13:53:42', '', 0, 0, 0);
