-- MiFaPay full payment country/channel import.
-- Generated from MiFaPay Apifox docs on 2026-04-30T07:20:36.014Z.
-- Exchange rates source: USD base, Thu, 30 Apr 2026 00:02:31 +0000.
-- Target app: LIKEI, V2 region commodity configuration.

START TRANSACTION;

SET @application_id := 2048200000000000701;
SET @region_id := '2046145518364221441';
SET @sys_origin := 'LIKEI';
SET @region_relation_group := 'OPEN_PAY_COUNTRY';
SET @factory_code := 'MIFA_PAY';
SET @type := 'GOLD';

INSERT INTO `sys_pay_application` (`id`, `app_name`, `app_code`, `android_link`, `ios_link`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@application_id, 'LIKEI', 'LIKEI', 'https://play.google.com/store/apps/details?id=com.org.yumiparty', '', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `app_name` = VALUES(`app_name`),
  `app_code` = VALUES(`app_code`),
  `android_link` = VALUES(`android_link`),
  `ios_link` = VALUES(`ios_link`),
  `update_time` = CURRENT_TIMESTAMP;

SET @factory_id := (SELECT `id` FROM `sys_pay_factory` WHERE `factory_code` = @factory_code LIMIT 1);
SET @factory_id := IFNULL(@factory_id, 2048200000000000101);
INSERT INTO `sys_pay_factory` (`id`, `factory_code`, `factory_name`, `factory_icon`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@factory_id, @factory_code, 'MiFaPay', '', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_name` = VALUES(`factory_name`),
  `factory_icon` = VALUES(`factory_icon`),
  `update_time` = CURRENT_TIMESTAMP;

-- Country code references. Do not insert/update sys_country_code here; missing countries are skipped downstream.
SET @cc_AE := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'AE' LIMIT 1);
SET @cc_AR := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'AR' LIMIT 1);
SET @cc_AT := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'AT' LIMIT 1);
SET @cc_AU := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'AU' LIMIT 1);
SET @cc_BD := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'BD' LIMIT 1);
SET @cc_BE := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'BE' LIMIT 1);
SET @cc_BG := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'BG' LIMIT 1);
SET @cc_BH := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'BH' LIMIT 1);
SET @cc_BR := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'BR' LIMIT 1);
SET @cc_CL := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'CL' LIMIT 1);
SET @cc_CN := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'CN' LIMIT 1);
SET @cc_CO := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'CO' LIMIT 1);
SET @cc_CY := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'CY' LIMIT 1);
SET @cc_CZ := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'CZ' LIMIT 1);
SET @cc_DE := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'DE' LIMIT 1);
SET @cc_DK := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'DK' LIMIT 1);
SET @cc_EC := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'EC' LIMIT 1);
SET @cc_EE := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'EE' LIMIT 1);
SET @cc_EG := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'EG' LIMIT 1);
SET @cc_ES := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'ES' LIMIT 1);
SET @cc_FI := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'FI' LIMIT 1);
SET @cc_FR := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'FR' LIMIT 1);
SET @cc_GB := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'GB' LIMIT 1);
SET @cc_GH := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'GH' LIMIT 1);
SET @cc_GR := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'GR' LIMIT 1);
SET @cc_HK := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'HK' LIMIT 1);
SET @cc_HR := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'HR' LIMIT 1);
SET @cc_HU := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'HU' LIMIT 1);
SET @cc_ID := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'ID' LIMIT 1);
SET @cc_IE := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'IE' LIMIT 1);
SET @cc_IN := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'IN' LIMIT 1);
SET @cc_IQ := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'IQ' LIMIT 1);
SET @cc_IT := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'IT' LIMIT 1);
SET @cc_JO := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'JO' LIMIT 1);
SET @cc_JP := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'JP' LIMIT 1);
SET @cc_KE := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'KE' LIMIT 1);
SET @cc_KR := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'KR' LIMIT 1);
SET @cc_KW := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'KW' LIMIT 1);
SET @cc_LI := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'LI' LIMIT 1);
SET @cc_LT := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'LT' LIMIT 1);
SET @cc_LU := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'LU' LIMIT 1);
SET @cc_LV := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'LV' LIMIT 1);
SET @cc_MN := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'MN' LIMIT 1);
SET @cc_MT := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'MT' LIMIT 1);
SET @cc_MX := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'MX' LIMIT 1);
SET @cc_MY := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'MY' LIMIT 1);
SET @cc_NL := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'NL' LIMIT 1);
SET @cc_NO := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'NO' LIMIT 1);
SET @cc_NP := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'NP' LIMIT 1);
SET @cc_OM := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'OM' LIMIT 1);
SET @cc_PE := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'PE' LIMIT 1);
SET @cc_PH := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'PH' LIMIT 1);
SET @cc_PK := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'PK' LIMIT 1);
SET @cc_PL := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'PL' LIMIT 1);
SET @cc_PT := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'PT' LIMIT 1);
SET @cc_QA := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'QA' LIMIT 1);
SET @cc_RO := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'RO' LIMIT 1);
SET @cc_RU := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'RU' LIMIT 1);
SET @cc_SA := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'SA' LIMIT 1);
SET @cc_SE := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'SE' LIMIT 1);
SET @cc_SG := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'SG' LIMIT 1);
SET @cc_SI := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'SI' LIMIT 1);
SET @cc_SK := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'SK' LIMIT 1);
SET @cc_TH := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'TH' LIMIT 1);
SET @cc_TR := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'TR' LIMIT 1);
SET @cc_TW := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'TW' LIMIT 1);
SET @cc_US := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'US' LIMIT 1);
SET @cc_VN := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'VN' LIMIT 1);
SET @cc_ZA := (SELECT `id` FROM `sys_country_code` WHERE `alpha_two` = 'ZA' LIMIT 1);
-- Pay countries and region exposure.
SET @pc_AE_AED := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_AE AND pc.`currency` = 'AED' LIMIT 1);
SET @pc_AE_AED := IF(@cc_AE IS NULL, NULL, IFNULL(@pc_AE_AED, 2049300000000200001));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_AE_AED, @cc_AE, 'AED', 3.67250000, 100, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_AE IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_AE_AED := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_AE_AED AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_AE_AED := IF(@pc_AE_AED IS NULL, NULL, IFNULL(@rr_AE_AED, 2049300000000700001));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_AE_AED, @sys_origin, @region_id, @pc_AE_AED, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AE_AED IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_AR_ARS := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_AR AND pc.`currency` = 'ARS' LIMIT 1);
SET @pc_AR_ARS := IF(@cc_AR IS NULL, NULL, IFNULL(@pc_AR_ARS, 2049300000000200002));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_AR_ARS, @cc_AR, 'ARS', 1395.28660000, 101, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_AR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_AR_ARS := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_AR_ARS AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_AR_ARS := IF(@pc_AR_ARS IS NULL, NULL, IFNULL(@rr_AR_ARS, 2049300000000700002));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_AR_ARS, @sys_origin, @region_id, @pc_AR_ARS, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AR_ARS IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_AT_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_AT AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_AT_EUR := IF(@cc_AT IS NULL, NULL, IFNULL(@pc_AT_EUR, 2049300000000200003));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_AT_EUR, @cc_AT, 'EUR', 0.85557900, 102, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_AT IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_AT_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_AT_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_AT_EUR := IF(@pc_AT_EUR IS NULL, NULL, IFNULL(@rr_AT_EUR, 2049300000000700003));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_AT_EUR, @sys_origin, @region_id, @pc_AT_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_AU_AUD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_AU AND pc.`currency` = 'AUD' LIMIT 1);
SET @pc_AU_AUD := IF(@cc_AU IS NULL, NULL, IFNULL(@pc_AU_AUD, 2049300000000200004));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_AU_AUD, @cc_AU, 'AUD', 1.40225600, 103, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_AU IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_AU_AUD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_AU_AUD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_AU_AUD := IF(@pc_AU_AUD IS NULL, NULL, IFNULL(@rr_AU_AUD, 2049300000000700004));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_AU_AUD, @sys_origin, @region_id, @pc_AU_AUD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AU_AUD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_BD_BDT := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_BD AND pc.`currency` = 'BDT' LIMIT 1);
SET @pc_BD_BDT := IF(@cc_BD IS NULL, NULL, IFNULL(@pc_BD_BDT, 2049300000000200005));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_BD_BDT, @cc_BD, 'BDT', 122.75830600, 104, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_BD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_BD_BDT := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_BD_BDT AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_BD_BDT := IF(@pc_BD_BDT IS NULL, NULL, IFNULL(@rr_BD_BDT, 2049300000000700005));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_BD_BDT, @sys_origin, @region_id, @pc_BD_BDT, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BD_BDT IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_BE_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_BE AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_BE_EUR := IF(@cc_BE IS NULL, NULL, IFNULL(@pc_BE_EUR, 2049300000000200006));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_BE_EUR, @cc_BE, 'EUR', 0.85557900, 105, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_BE IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_BE_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_BE_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_BE_EUR := IF(@pc_BE_EUR IS NULL, NULL, IFNULL(@rr_BE_EUR, 2049300000000700006));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_BE_EUR, @sys_origin, @region_id, @pc_BE_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_BG_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_BG AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_BG_EUR := IF(@cc_BG IS NULL, NULL, IFNULL(@pc_BG_EUR, 2049300000000200007));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_BG_EUR, @cc_BG, 'EUR', 0.85557900, 106, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_BG IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_BG_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_BG_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_BG_EUR := IF(@pc_BG_EUR IS NULL, NULL, IFNULL(@rr_BG_EUR, 2049300000000700007));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_BG_EUR, @sys_origin, @region_id, @pc_BG_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BG_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_BH_BHD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_BH AND pc.`currency` = 'BHD' LIMIT 1);
SET @pc_BH_BHD := IF(@cc_BH IS NULL, NULL, IFNULL(@pc_BH_BHD, 2049300000000200008));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_BH_BHD, @cc_BH, 'BHD', 0.37600000, 107, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_BH IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_BH_BHD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_BH_BHD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_BH_BHD := IF(@pc_BH_BHD IS NULL, NULL, IFNULL(@rr_BH_BHD, 2049300000000700008));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_BH_BHD, @sys_origin, @region_id, @pc_BH_BHD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BH_BHD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_BR_BRL := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_BR AND pc.`currency` = 'BRL' LIMIT 1);
SET @pc_BR_BRL := IF(@cc_BR IS NULL, NULL, IFNULL(@pc_BR_BRL, 2049300000000200009));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_BR_BRL, @cc_BR, 'BRL', 4.98942400, 108, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_BR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_BR_BRL := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_BR_BRL AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_BR_BRL := IF(@pc_BR_BRL IS NULL, NULL, IFNULL(@rr_BR_BRL, 2049300000000700009));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_BR_BRL, @sys_origin, @region_id, @pc_BR_BRL, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BR_BRL IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_CL_CLP := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_CL AND pc.`currency` = 'CLP' LIMIT 1);
SET @pc_CL_CLP := IF(@cc_CL IS NULL, NULL, IFNULL(@pc_CL_CLP, 2049300000000200010));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_CL_CLP, @cc_CL, 'CLP', 889.20868600, 109, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_CL IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_CL_CLP := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_CL_CLP AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_CL_CLP := IF(@pc_CL_CLP IS NULL, NULL, IFNULL(@rr_CL_CLP, 2049300000000700010));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_CL_CLP, @sys_origin, @region_id, @pc_CL_CLP, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_CN_CNY := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_CN AND pc.`currency` = 'CNY' LIMIT 1);
SET @pc_CN_CNY := IF(@cc_CN IS NULL, NULL, IFNULL(@pc_CN_CNY, 2049300000000200011));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_CN_CNY, @cc_CN, 'CNY', 6.84863900, 110, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_CN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_CN_CNY := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_CN_CNY AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_CN_CNY := IF(@pc_CN_CNY IS NULL, NULL, IFNULL(@rr_CN_CNY, 2049300000000700011));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_CN_CNY, @sys_origin, @region_id, @pc_CN_CNY, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CN_CNY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_CO_COP := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_CO AND pc.`currency` = 'COP' LIMIT 1);
SET @pc_CO_COP := IF(@cc_CO IS NULL, NULL, IFNULL(@pc_CO_COP, 2049300000000200012));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_CO_COP, @cc_CO, 'COP', 3610.10645200, 111, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_CO IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_CO_COP := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_CO_COP AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_CO_COP := IF(@pc_CO_COP IS NULL, NULL, IFNULL(@rr_CO_COP, 2049300000000700012));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_CO_COP, @sys_origin, @region_id, @pc_CO_COP, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_CY_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_CY AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_CY_EUR := IF(@cc_CY IS NULL, NULL, IFNULL(@pc_CY_EUR, 2049300000000200013));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_CY_EUR, @cc_CY, 'EUR', 0.85557900, 112, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_CY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_CY_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_CY_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_CY_EUR := IF(@pc_CY_EUR IS NULL, NULL, IFNULL(@rr_CY_EUR, 2049300000000700013));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_CY_EUR, @sys_origin, @region_id, @pc_CY_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CY_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_CZ_CZK := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_CZ AND pc.`currency` = 'CZK' LIMIT 1);
SET @pc_CZ_CZK := IF(@cc_CZ IS NULL, NULL, IFNULL(@pc_CZ_CZK, 2049300000000200014));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_CZ_CZK, @cc_CZ, 'CZK', 20.85852600, 113, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_CZ IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_CZ_CZK := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_CZ_CZK AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_CZ_CZK := IF(@pc_CZ_CZK IS NULL, NULL, IFNULL(@rr_CZ_CZK, 2049300000000700014));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_CZ_CZK, @sys_origin, @region_id, @pc_CZ_CZK, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CZ_CZK IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_DE_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_DE AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_DE_EUR := IF(@cc_DE IS NULL, NULL, IFNULL(@pc_DE_EUR, 2049300000000200015));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_DE_EUR, @cc_DE, 'EUR', 0.85557900, 114, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_DE IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_DE_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_DE_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_DE_EUR := IF(@pc_DE_EUR IS NULL, NULL, IFNULL(@rr_DE_EUR, 2049300000000700015));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_DE_EUR, @sys_origin, @region_id, @pc_DE_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_DK_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_DK AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_DK_EUR := IF(@cc_DK IS NULL, NULL, IFNULL(@pc_DK_EUR, 2049300000000200016));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_DK_EUR, @cc_DK, 'EUR', 0.85557900, 115, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_DK IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_DK_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_DK_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_DK_EUR := IF(@pc_DK_EUR IS NULL, NULL, IFNULL(@rr_DK_EUR, 2049300000000700016));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_DK_EUR, @sys_origin, @region_id, @pc_DK_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DK_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_EC_USD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_EC AND pc.`currency` = 'USD' LIMIT 1);
SET @pc_EC_USD := IF(@cc_EC IS NULL, NULL, IFNULL(@pc_EC_USD, 2049300000000200017));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_EC_USD, @cc_EC, 'USD', 1.00000000, 116, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_EC IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_EC_USD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_EC_USD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_EC_USD := IF(@pc_EC_USD IS NULL, NULL, IFNULL(@rr_EC_USD, 2049300000000700017));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_EC_USD, @sys_origin, @region_id, @pc_EC_USD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EC_USD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_EE_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_EE AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_EE_EUR := IF(@cc_EE IS NULL, NULL, IFNULL(@pc_EE_EUR, 2049300000000200018));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_EE_EUR, @cc_EE, 'EUR', 0.85557900, 117, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_EE IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_EE_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_EE_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_EE_EUR := IF(@pc_EE_EUR IS NULL, NULL, IFNULL(@rr_EE_EUR, 2049300000000700018));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_EE_EUR, @sys_origin, @region_id, @pc_EE_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_EG_EGP := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_EG AND pc.`currency` = 'EGP' LIMIT 1);
SET @pc_EG_EGP := IF(@cc_EG IS NULL, NULL, IFNULL(@pc_EG_EGP, 2049300000000200019));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_EG_EGP, @cc_EG, 'EGP', 53.00909100, 118, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_EG IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_EG_EGP := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_EG_EGP AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_EG_EGP := IF(@pc_EG_EGP IS NULL, NULL, IFNULL(@rr_EG_EGP, 2049300000000700019));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_EG_EGP, @sys_origin, @region_id, @pc_EG_EGP, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EG_EGP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_ES_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_ES AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_ES_EUR := IF(@cc_ES IS NULL, NULL, IFNULL(@pc_ES_EUR, 2049300000000200020));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_ES_EUR, @cc_ES, 'EUR', 0.85557900, 119, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_ES IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_ES_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_ES_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_ES_EUR := IF(@pc_ES_EUR IS NULL, NULL, IFNULL(@rr_ES_EUR, 2049300000000700020));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_ES_EUR, @sys_origin, @region_id, @pc_ES_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ES_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_FI_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_FI AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_FI_EUR := IF(@cc_FI IS NULL, NULL, IFNULL(@pc_FI_EUR, 2049300000000200021));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_FI_EUR, @cc_FI, 'EUR', 0.85557900, 120, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_FI IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_FI_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_FI_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_FI_EUR := IF(@pc_FI_EUR IS NULL, NULL, IFNULL(@rr_FI_EUR, 2049300000000700021));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_FI_EUR, @sys_origin, @region_id, @pc_FI_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_FR_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_FR AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_FR_EUR := IF(@cc_FR IS NULL, NULL, IFNULL(@pc_FR_EUR, 2049300000000200022));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_FR_EUR, @cc_FR, 'EUR', 0.85557900, 121, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_FR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_FR_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_FR_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_FR_EUR := IF(@pc_FR_EUR IS NULL, NULL, IFNULL(@rr_FR_EUR, 2049300000000700022));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_FR_EUR, @sys_origin, @region_id, @pc_FR_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_GB_GBP := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_GB AND pc.`currency` = 'GBP' LIMIT 1);
SET @pc_GB_GBP := IF(@cc_GB IS NULL, NULL, IFNULL(@pc_GB_GBP, 2049300000000200023));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_GB_GBP, @cc_GB, 'GBP', 0.74119100, 122, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_GB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_GB_GBP := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_GB_GBP AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_GB_GBP := IF(@pc_GB_GBP IS NULL, NULL, IFNULL(@rr_GB_GBP, 2049300000000700023));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_GB_GBP, @sys_origin, @region_id, @pc_GB_GBP, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GB_GBP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_GH_GHS := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_GH AND pc.`currency` = 'GHS' LIMIT 1);
SET @pc_GH_GHS := IF(@cc_GH IS NULL, NULL, IFNULL(@pc_GH_GHS, 2049300000000200024));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_GH_GHS, @cc_GH, 'GHS', 11.19212100, 123, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_GH IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_GH_GHS := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_GH_GHS AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_GH_GHS := IF(@pc_GH_GHS IS NULL, NULL, IFNULL(@rr_GH_GHS, 2049300000000700024));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_GH_GHS, @sys_origin, @region_id, @pc_GH_GHS, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GH_GHS IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_GR_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_GR AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_GR_EUR := IF(@cc_GR IS NULL, NULL, IFNULL(@pc_GR_EUR, 2049300000000200025));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_GR_EUR, @cc_GR, 'EUR', 0.85557900, 124, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_GR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_GR_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_GR_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_GR_EUR := IF(@pc_GR_EUR IS NULL, NULL, IFNULL(@rr_GR_EUR, 2049300000000700025));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_GR_EUR, @sys_origin, @region_id, @pc_GR_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_HK_HKD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_HK AND pc.`currency` = 'HKD' LIMIT 1);
SET @pc_HK_HKD := IF(@cc_HK IS NULL, NULL, IFNULL(@pc_HK_HKD, 2049300000000200026));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_HK_HKD, @cc_HK, 'HKD', 7.83732400, 125, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_HK IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_HK_HKD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_HK_HKD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_HK_HKD := IF(@pc_HK_HKD IS NULL, NULL, IFNULL(@rr_HK_HKD, 2049300000000700026));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_HK_HKD, @sys_origin, @region_id, @pc_HK_HKD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HK_HKD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_HR_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_HR AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_HR_EUR := IF(@cc_HR IS NULL, NULL, IFNULL(@pc_HR_EUR, 2049300000000200027));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_HR_EUR, @cc_HR, 'EUR', 0.85557900, 126, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_HR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_HR_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_HR_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_HR_EUR := IF(@pc_HR_EUR IS NULL, NULL, IFNULL(@rr_HR_EUR, 2049300000000700027));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_HR_EUR, @sys_origin, @region_id, @pc_HR_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_HU_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_HU AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_HU_EUR := IF(@cc_HU IS NULL, NULL, IFNULL(@pc_HU_EUR, 2049300000000200028));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_HU_EUR, @cc_HU, 'EUR', 0.85557900, 127, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_HU IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_HU_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_HU_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_HU_EUR := IF(@pc_HU_EUR IS NULL, NULL, IFNULL(@rr_HU_EUR, 2049300000000700028));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_HU_EUR, @sys_origin, @region_id, @pc_HU_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HU_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_ID_IDR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_ID AND pc.`currency` = 'IDR' LIMIT 1);
SET @pc_ID_IDR := IF(@cc_ID IS NULL, NULL, IFNULL(@pc_ID_IDR, 2049300000000200029));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_ID_IDR, @cc_ID, 'IDR', 17332.30168500, 128, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_ID IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_ID_IDR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_ID_IDR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_ID_IDR := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@rr_ID_IDR, 2049300000000700029));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_ID_IDR, @sys_origin, @region_id, @pc_ID_IDR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_IE_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_IE AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_IE_EUR := IF(@cc_IE IS NULL, NULL, IFNULL(@pc_IE_EUR, 2049300000000200030));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_IE_EUR, @cc_IE, 'EUR', 0.85557900, 129, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_IE IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_IE_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_IE_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_IE_EUR := IF(@pc_IE_EUR IS NULL, NULL, IFNULL(@rr_IE_EUR, 2049300000000700030));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_IE_EUR, @sys_origin, @region_id, @pc_IE_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_IN_INR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_IN AND pc.`currency` = 'INR' LIMIT 1);
SET @pc_IN_INR := IF(@cc_IN IS NULL, NULL, IFNULL(@pc_IN_INR, 2049300000000200031));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_IN_INR, @cc_IN, 'INR', 94.94109300, 130, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_IN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_IN_INR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_IN_INR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_IN_INR := IF(@pc_IN_INR IS NULL, NULL, IFNULL(@rr_IN_INR, 2049300000000700031));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_IN_INR, @sys_origin, @region_id, @pc_IN_INR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_IQ_IQD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_IQ AND pc.`currency` = 'IQD' LIMIT 1);
SET @pc_IQ_IQD := IF(@cc_IQ IS NULL, NULL, IFNULL(@pc_IQ_IQD, 2049300000000200032));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_IQ_IQD, @cc_IQ, 'IQD', 1310.11986200, 131, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_IQ IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_IQ_IQD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_IQ_IQD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_IQ_IQD := IF(@pc_IQ_IQD IS NULL, NULL, IFNULL(@rr_IQ_IQD, 2049300000000700032));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_IQ_IQD, @sys_origin, @region_id, @pc_IQ_IQD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IQ_IQD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_IT_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_IT AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_IT_EUR := IF(@cc_IT IS NULL, NULL, IFNULL(@pc_IT_EUR, 2049300000000200033));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_IT_EUR, @cc_IT, 'EUR', 0.85557900, 132, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_IT IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_IT_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_IT_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_IT_EUR := IF(@pc_IT_EUR IS NULL, NULL, IFNULL(@rr_IT_EUR, 2049300000000700033));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_IT_EUR, @sys_origin, @region_id, @pc_IT_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_JO_JOD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_JO AND pc.`currency` = 'JOD' LIMIT 1);
SET @pc_JO_JOD := IF(@cc_JO IS NULL, NULL, IFNULL(@pc_JO_JOD, 2049300000000200034));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_JO_JOD, @cc_JO, 'JOD', 0.70900000, 133, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_JO IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_JO_JOD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_JO_JOD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_JO_JOD := IF(@pc_JO_JOD IS NULL, NULL, IFNULL(@rr_JO_JOD, 2049300000000700034));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_JO_JOD, @sys_origin, @region_id, @pc_JO_JOD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JO_JOD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_JP_JPY := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_JP AND pc.`currency` = 'JPY' LIMIT 1);
SET @pc_JP_JPY := IF(@cc_JP IS NULL, NULL, IFNULL(@pc_JP_JPY, 2049300000000200035));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_JP_JPY, @cc_JP, 'JPY', 160.08453500, 134, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_JP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_JP_JPY := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_JP_JPY AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_JP_JPY := IF(@pc_JP_JPY IS NULL, NULL, IFNULL(@rr_JP_JPY, 2049300000000700035));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_JP_JPY, @sys_origin, @region_id, @pc_JP_JPY, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JP_JPY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_KE_KES := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_KE AND pc.`currency` = 'KES' LIMIT 1);
SET @pc_KE_KES := IF(@cc_KE IS NULL, NULL, IFNULL(@pc_KE_KES, 2049300000000200036));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_KE_KES, @cc_KE, 'KES', 129.07427600, 135, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_KE IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_KE_KES := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_KE_KES AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_KE_KES := IF(@pc_KE_KES IS NULL, NULL, IFNULL(@rr_KE_KES, 2049300000000700036));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_KE_KES, @sys_origin, @region_id, @pc_KE_KES, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KE_KES IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_KR_KRW := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_KR AND pc.`currency` = 'KRW' LIMIT 1);
SET @pc_KR_KRW := IF(@cc_KR IS NULL, NULL, IFNULL(@pc_KR_KRW, 2049300000000200037));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_KR_KRW, @cc_KR, 'KRW', 1483.34495900, 136, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_KR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_KR_KRW := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_KR_KRW AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_KR_KRW := IF(@pc_KR_KRW IS NULL, NULL, IFNULL(@rr_KR_KRW, 2049300000000700037));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_KR_KRW, @sys_origin, @region_id, @pc_KR_KRW, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_KW_KWD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_KW AND pc.`currency` = 'KWD' LIMIT 1);
SET @pc_KW_KWD := IF(@cc_KW IS NULL, NULL, IFNULL(@pc_KW_KWD, 2049300000000200038));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_KW_KWD, @cc_KW, 'KWD', 0.30739600, 137, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_KW IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_KW_KWD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_KW_KWD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_KW_KWD := IF(@pc_KW_KWD IS NULL, NULL, IFNULL(@rr_KW_KWD, 2049300000000700038));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_KW_KWD, @sys_origin, @region_id, @pc_KW_KWD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KW_KWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_LI_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_LI AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_LI_EUR := IF(@cc_LI IS NULL, NULL, IFNULL(@pc_LI_EUR, 2049300000000200039));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_LI_EUR, @cc_LI, 'EUR', 0.85557900, 138, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_LI IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_LI_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_LI_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_LI_EUR := IF(@pc_LI_EUR IS NULL, NULL, IFNULL(@rr_LI_EUR, 2049300000000700039));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_LI_EUR, @sys_origin, @region_id, @pc_LI_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_LT_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_LT AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_LT_EUR := IF(@cc_LT IS NULL, NULL, IFNULL(@pc_LT_EUR, 2049300000000200040));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_LT_EUR, @cc_LT, 'EUR', 0.85557900, 139, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_LT IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_LT_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_LT_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_LT_EUR := IF(@pc_LT_EUR IS NULL, NULL, IFNULL(@rr_LT_EUR, 2049300000000700040));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_LT_EUR, @sys_origin, @region_id, @pc_LT_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_LU_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_LU AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_LU_EUR := IF(@cc_LU IS NULL, NULL, IFNULL(@pc_LU_EUR, 2049300000000200041));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_LU_EUR, @cc_LU, 'EUR', 0.85557900, 140, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_LU IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_LU_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_LU_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_LU_EUR := IF(@pc_LU_EUR IS NULL, NULL, IFNULL(@rr_LU_EUR, 2049300000000700041));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_LU_EUR, @sys_origin, @region_id, @pc_LU_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LU_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_LV_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_LV AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_LV_EUR := IF(@cc_LV IS NULL, NULL, IFNULL(@pc_LV_EUR, 2049300000000200042));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_LV_EUR, @cc_LV, 'EUR', 0.85557900, 141, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_LV IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_LV_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_LV_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_LV_EUR := IF(@pc_LV_EUR IS NULL, NULL, IFNULL(@rr_LV_EUR, 2049300000000700042));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_LV_EUR, @sys_origin, @region_id, @pc_LV_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LV_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_MN_USD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_MN AND pc.`currency` = 'USD' LIMIT 1);
SET @pc_MN_USD := IF(@cc_MN IS NULL, NULL, IFNULL(@pc_MN_USD, 2049300000000200043));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_MN_USD, @cc_MN, 'USD', 1.00000000, 142, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_MN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_MN_USD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_MN_USD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_MN_USD := IF(@pc_MN_USD IS NULL, NULL, IFNULL(@rr_MN_USD, 2049300000000700043));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_MN_USD, @sys_origin, @region_id, @pc_MN_USD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MN_USD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_MT_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_MT AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_MT_EUR := IF(@cc_MT IS NULL, NULL, IFNULL(@pc_MT_EUR, 2049300000000200044));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_MT_EUR, @cc_MT, 'EUR', 0.85557900, 143, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_MT IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_MT_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_MT_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_MT_EUR := IF(@pc_MT_EUR IS NULL, NULL, IFNULL(@rr_MT_EUR, 2049300000000700044));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_MT_EUR, @sys_origin, @region_id, @pc_MT_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_MX_MXN := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_MX AND pc.`currency` = 'MXN' LIMIT 1);
SET @pc_MX_MXN := IF(@cc_MX IS NULL, NULL, IFNULL(@pc_MX_MXN, 2049300000000200045));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_MX_MXN, @cc_MX, 'MXN', 17.49642700, 144, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_MX IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_MX_MXN := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_MX_MXN AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_MX_MXN := IF(@pc_MX_MXN IS NULL, NULL, IFNULL(@rr_MX_MXN, 2049300000000700045));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_MX_MXN, @sys_origin, @region_id, @pc_MX_MXN, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MX_MXN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_MY_MYR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_MY AND pc.`currency` = 'MYR' LIMIT 1);
SET @pc_MY_MYR := IF(@cc_MY IS NULL, NULL, IFNULL(@pc_MY_MYR, 2049300000000200046));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_MY_MYR, @cc_MY, 'MYR', 3.95214200, 145, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_MY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_MY_MYR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_MY_MYR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_MY_MYR := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@rr_MY_MYR, 2049300000000700046));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_MY_MYR, @sys_origin, @region_id, @pc_MY_MYR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_NL_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_NL AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_NL_EUR := IF(@cc_NL IS NULL, NULL, IFNULL(@pc_NL_EUR, 2049300000000200047));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_NL_EUR, @cc_NL, 'EUR', 0.85557900, 146, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_NL IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_NL_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_NL_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_NL_EUR := IF(@pc_NL_EUR IS NULL, NULL, IFNULL(@rr_NL_EUR, 2049300000000700047));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_NL_EUR, @sys_origin, @region_id, @pc_NL_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_NO_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_NO AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_NO_EUR := IF(@cc_NO IS NULL, NULL, IFNULL(@pc_NO_EUR, 2049300000000200048));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_NO_EUR, @cc_NO, 'EUR', 0.85557900, 147, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_NO IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_NO_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_NO_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_NO_EUR := IF(@pc_NO_EUR IS NULL, NULL, IFNULL(@rr_NO_EUR, 2049300000000700048));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_NO_EUR, @sys_origin, @region_id, @pc_NO_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NO_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_NP_NPR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_NP AND pc.`currency` = 'NPR' LIMIT 1);
SET @pc_NP_NPR := IF(@cc_NP IS NULL, NULL, IFNULL(@pc_NP_NPR, 2049300000000200049));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_NP_NPR, @cc_NP, 'NPR', 151.90514400, 148, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_NP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_NP_NPR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_NP_NPR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_NP_NPR := IF(@pc_NP_NPR IS NULL, NULL, IFNULL(@rr_NP_NPR, 2049300000000700049));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_NP_NPR, @sys_origin, @region_id, @pc_NP_NPR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NP_NPR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_OM_OMR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_OM AND pc.`currency` = 'OMR' LIMIT 1);
SET @pc_OM_OMR := IF(@cc_OM IS NULL, NULL, IFNULL(@pc_OM_OMR, 2049300000000200050));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_OM_OMR, @cc_OM, 'OMR', 0.38449700, 149, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_OM IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_OM_OMR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_OM_OMR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_OM_OMR := IF(@pc_OM_OMR IS NULL, NULL, IFNULL(@rr_OM_OMR, 2049300000000700050));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_OM_OMR, @sys_origin, @region_id, @pc_OM_OMR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_OM_OMR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_PE_PEN := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_PE AND pc.`currency` = 'PEN' LIMIT 1);
SET @pc_PE_PEN := IF(@cc_PE IS NULL, NULL, IFNULL(@pc_PE_PEN, 2049300000000200051));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_PE_PEN, @cc_PE, 'PEN', 3.51912500, 150, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_PE IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_PE_PEN := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_PE_PEN AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_PE_PEN := IF(@pc_PE_PEN IS NULL, NULL, IFNULL(@rr_PE_PEN, 2049300000000700051));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_PE_PEN, @sys_origin, @region_id, @pc_PE_PEN, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PE_PEN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_PH_PHP := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_PH AND pc.`currency` = 'PHP' LIMIT 1);
SET @pc_PH_PHP := IF(@cc_PH IS NULL, NULL, IFNULL(@pc_PH_PHP, 2049300000000200052));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_PH_PHP, @cc_PH, 'PHP', 61.68361800, 151, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_PH IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_PH_PHP := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_PH_PHP AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_PH_PHP := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@rr_PH_PHP, 2049300000000700052));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_PH_PHP, @sys_origin, @region_id, @pc_PH_PHP, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_PK_PKR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_PK AND pc.`currency` = 'PKR' LIMIT 1);
SET @pc_PK_PKR := IF(@cc_PK IS NULL, NULL, IFNULL(@pc_PK_PKR, 2049300000000200053));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_PK_PKR, @cc_PK, 'PKR', 278.77001700, 152, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_PK IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_PK_PKR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_PK_PKR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_PK_PKR := IF(@pc_PK_PKR IS NULL, NULL, IFNULL(@rr_PK_PKR, 2049300000000700053));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_PK_PKR, @sys_origin, @region_id, @pc_PK_PKR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PK_PKR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_PL_PLN := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_PL AND pc.`currency` = 'PLN' LIMIT 1);
SET @pc_PL_PLN := IF(@cc_PL IS NULL, NULL, IFNULL(@pc_PL_PLN, 2049300000000200054));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_PL_PLN, @cc_PL, 'PLN', 3.64048200, 153, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_PL IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_PL_PLN := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_PL_PLN AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_PL_PLN := IF(@pc_PL_PLN IS NULL, NULL, IFNULL(@rr_PL_PLN, 2049300000000700054));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_PL_PLN, @sys_origin, @region_id, @pc_PL_PLN, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PL_PLN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_PT_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_PT AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_PT_EUR := IF(@cc_PT IS NULL, NULL, IFNULL(@pc_PT_EUR, 2049300000000200055));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_PT_EUR, @cc_PT, 'EUR', 0.85557900, 154, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_PT IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_PT_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_PT_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_PT_EUR := IF(@pc_PT_EUR IS NULL, NULL, IFNULL(@rr_PT_EUR, 2049300000000700055));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_PT_EUR, @sys_origin, @region_id, @pc_PT_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_QA_QAR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_QA AND pc.`currency` = 'QAR' LIMIT 1);
SET @pc_QA_QAR := IF(@cc_QA IS NULL, NULL, IFNULL(@pc_QA_QAR, 2049300000000200056));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_QA_QAR, @cc_QA, 'QAR', 3.64000000, 155, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_QA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_QA_QAR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_QA_QAR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_QA_QAR := IF(@pc_QA_QAR IS NULL, NULL, IFNULL(@rr_QA_QAR, 2049300000000700056));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_QA_QAR, @sys_origin, @region_id, @pc_QA_QAR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_QA_QAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_RO_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_RO AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_RO_EUR := IF(@cc_RO IS NULL, NULL, IFNULL(@pc_RO_EUR, 2049300000000200057));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_RO_EUR, @cc_RO, 'EUR', 0.85557900, 156, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_RO IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_RO_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_RO_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_RO_EUR := IF(@pc_RO_EUR IS NULL, NULL, IFNULL(@rr_RO_EUR, 2049300000000700057));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_RO_EUR, @sys_origin, @region_id, @pc_RO_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RO_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_RU_RUB := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_RU AND pc.`currency` = 'RUB' LIMIT 1);
SET @pc_RU_RUB := IF(@cc_RU IS NULL, NULL, IFNULL(@pc_RU_RUB, 2049300000000200058));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_RU_RUB, @cc_RU, 'RUB', 75.10951900, 157, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_RU IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_RU_RUB := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_RU_RUB AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_RU_RUB := IF(@pc_RU_RUB IS NULL, NULL, IFNULL(@rr_RU_RUB, 2049300000000700058));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_RU_RUB, @sys_origin, @region_id, @pc_RU_RUB, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_SA_SAR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_SA AND pc.`currency` = 'SAR' LIMIT 1);
SET @pc_SA_SAR := IF(@cc_SA IS NULL, NULL, IFNULL(@pc_SA_SAR, 2049300000000200059));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_SA_SAR, @cc_SA, 'SAR', 3.75000000, 158, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_SA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_SA_SAR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_SA_SAR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_SA_SAR := IF(@pc_SA_SAR IS NULL, NULL, IFNULL(@rr_SA_SAR, 2049300000000700059));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_SA_SAR, @sys_origin, @region_id, @pc_SA_SAR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SA_SAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_SE_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_SE AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_SE_EUR := IF(@cc_SE IS NULL, NULL, IFNULL(@pc_SE_EUR, 2049300000000200060));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_SE_EUR, @cc_SE, 'EUR', 0.85557900, 159, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_SE IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_SE_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_SE_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_SE_EUR := IF(@pc_SE_EUR IS NULL, NULL, IFNULL(@rr_SE_EUR, 2049300000000700060));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_SE_EUR, @sys_origin, @region_id, @pc_SE_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_SG_SGD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_SG AND pc.`currency` = 'SGD' LIMIT 1);
SET @pc_SG_SGD := IF(@cc_SG IS NULL, NULL, IFNULL(@pc_SG_SGD, 2049300000000200061));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_SG_SGD, @cc_SG, 'SGD', 1.27946200, 160, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_SG IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_SG_SGD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_SG_SGD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_SG_SGD := IF(@pc_SG_SGD IS NULL, NULL, IFNULL(@rr_SG_SGD, 2049300000000700061));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_SG_SGD, @sys_origin, @region_id, @pc_SG_SGD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_SI_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_SI AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_SI_EUR := IF(@cc_SI IS NULL, NULL, IFNULL(@pc_SI_EUR, 2049300000000200062));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_SI_EUR, @cc_SI, 'EUR', 0.85557900, 161, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_SI IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_SI_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_SI_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_SI_EUR := IF(@pc_SI_EUR IS NULL, NULL, IFNULL(@rr_SI_EUR, 2049300000000700062));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_SI_EUR, @sys_origin, @region_id, @pc_SI_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_SK_EUR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_SK AND pc.`currency` = 'EUR' LIMIT 1);
SET @pc_SK_EUR := IF(@cc_SK IS NULL, NULL, IFNULL(@pc_SK_EUR, 2049300000000200063));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_SK_EUR, @cc_SK, 'EUR', 0.85557900, 162, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_SK IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_SK_EUR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_SK_EUR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_SK_EUR := IF(@pc_SK_EUR IS NULL, NULL, IFNULL(@rr_SK_EUR, 2049300000000700063));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_SK_EUR, @sys_origin, @region_id, @pc_SK_EUR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SK_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_TH_THB := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_TH AND pc.`currency` = 'THB' LIMIT 1);
SET @pc_TH_THB := IF(@cc_TH IS NULL, NULL, IFNULL(@pc_TH_THB, 2049300000000200064));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_TH_THB, @cc_TH, 'THB', 32.70313500, 163, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_TH IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_TH_THB := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_TH_THB AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_TH_THB := IF(@pc_TH_THB IS NULL, NULL, IFNULL(@rr_TH_THB, 2049300000000700064));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_TH_THB, @sys_origin, @region_id, @pc_TH_THB, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_TR_TRY := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_TR AND pc.`currency` = 'TRY' LIMIT 1);
SET @pc_TR_TRY := IF(@cc_TR IS NULL, NULL, IFNULL(@pc_TR_TRY, 2049300000000200065));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_TR_TRY, @cc_TR, 'TRY', 45.13703500, 164, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_TR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_TR_TRY := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_TR_TRY AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_TR_TRY := IF(@pc_TR_TRY IS NULL, NULL, IFNULL(@rr_TR_TRY, 2049300000000700065));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_TR_TRY, @sys_origin, @region_id, @pc_TR_TRY, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TR_TRY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_TW_TWD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_TW AND pc.`currency` = 'TWD' LIMIT 1);
SET @pc_TW_TWD := IF(@cc_TW IS NULL, NULL, IFNULL(@pc_TW_TWD, 2049300000000200066));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_TW_TWD, @cc_TW, 'TWD', 31.64726700, 165, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_TW IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_TW_TWD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_TW_TWD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_TW_TWD := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@rr_TW_TWD, 2049300000000700066));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_TW_TWD, @sys_origin, @region_id, @pc_TW_TWD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_US_USD := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_US AND pc.`currency` = 'USD' LIMIT 1);
SET @pc_US_USD := IF(@cc_US IS NULL, NULL, IFNULL(@pc_US_USD, 2049300000000200067));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_US_USD, @cc_US, 'USD', 1.00000000, 166, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_US IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_US_USD := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_US_USD AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_US_USD := IF(@pc_US_USD IS NULL, NULL, IFNULL(@rr_US_USD, 2049300000000700067));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_US_USD, @sys_origin, @region_id, @pc_US_USD, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_US_USD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_VN_VND := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_VN AND pc.`currency` = 'VND' LIMIT 1);
SET @pc_VN_VND := IF(@cc_VN IS NULL, NULL, IFNULL(@pc_VN_VND, 2049300000000200068));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_VN_VND, @cc_VN, 'VND', 26235.60758200, 167, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_VN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_VN_VND := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_VN_VND AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_VN_VND := IF(@pc_VN_VND IS NULL, NULL, IFNULL(@rr_VN_VND, 2049300000000700068));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_VN_VND, @sys_origin, @region_id, @pc_VN_VND, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

SET @pc_ZA_ZAR := (SELECT pc.`id` FROM `sys_pay_country` pc WHERE pc.`country_id` = @cc_ZA AND pc.`currency` = 'ZAR' LIMIT 1);
SET @pc_ZA_ZAR := IF(@cc_ZA IS NULL, NULL, IFNULL(@pc_ZA_ZAR, 2049300000000200069));
INSERT INTO `sys_pay_country` (`id`, `country_id`, `currency`, `usd_exchange_rate`, `sort`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @pc_ZA_ZAR, @cc_ZA, 'ZAR', 16.76547400, 168, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @cc_ZA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_id` = VALUES(`country_id`),
  `currency` = VALUES(`currency`),
  `usd_exchange_rate` = VALUES(`usd_exchange_rate`),
  `sort` = VALUES(`sort`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @rr_ZA_ZAR := (SELECT `id` FROM `sys_region_relation` WHERE `sys_origin` = @sys_origin AND `region_id` = @region_id AND `relation_id` = @pc_ZA_ZAR AND `group_type` = @region_relation_group LIMIT 1);
SET @rr_ZA_ZAR := IF(@pc_ZA_ZAR IS NULL, NULL, IFNULL(@rr_ZA_ZAR, 2049300000000700069));
INSERT INTO `sys_region_relation` (`id`, `sys_origin`, `region_id`, `relation_id`, `group_type`, `is_showcase`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @rr_ZA_ZAR, @sys_origin, @region_id, @pc_ZA_ZAR, @region_relation_group, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `sys_origin` = VALUES(`sys_origin`),
  `region_id` = VALUES(`region_id`),
  `relation_id` = VALUES(`relation_id`),
  `group_type` = VALUES(`group_type`),
  `is_showcase` = VALUES(`is_showcase`),
  `update_time` = CURRENT_TIMESTAMP;

-- MiFaPay channels and factory mappings.
SET @ch_BankTransfer_Alfa := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Alfa' LIMIT 1);
SET @ch_BankTransfer_Alfa := IFNULL(@ch_BankTransfer_Alfa, 2049300000000300001);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Alfa, 'BankTransfer_Alfa', 'Alfa', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Alfa := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Alfa' LIMIT 1);
SET @cf_BankTransfer_Alfa := IFNULL(@cf_BankTransfer_Alfa, 2049300000000400001);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Alfa, @factory_code, 'BankTransfer_Alfa', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Bancontact := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Bancontact' LIMIT 1);
SET @ch_BankTransfer_Bancontact := IFNULL(@ch_BankTransfer_Bancontact, 2049300000000300002);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Bancontact, 'BankTransfer_Bancontact', 'Bancontact', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Bancontact := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Bancontact' LIMIT 1);
SET @cf_BankTransfer_Bancontact := IFNULL(@cf_BankTransfer_Bancontact, 2049300000000400002);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Bancontact, @factory_code, 'BankTransfer_Bancontact', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_BankATM := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_BankATM' LIMIT 1);
SET @ch_BankTransfer_BankATM := IFNULL(@ch_BankTransfer_BankATM, 2049300000000300003);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_BankATM, 'BankTransfer_BankATM', 'BankATM', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_BankATM := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_BankATM' LIMIT 1);
SET @cf_BankTransfer_BankATM := IFNULL(@cf_BankTransfer_BankATM, 2049300000000400003);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_BankATM, @factory_code, 'BankTransfer_BankATM', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_BankCard := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_BankCard' LIMIT 1);
SET @ch_BankTransfer_BankCard := IFNULL(@ch_BankTransfer_BankCard, 2049300000000300004);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_BankCard, 'BankTransfer_BankCard', 'BankCard', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_BankCard := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_BankCard' LIMIT 1);
SET @cf_BankTransfer_BankCard := IFNULL(@cf_BankTransfer_BankCard, 2049300000000400004);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_BankCard, @factory_code, 'BankTransfer_BankCard', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_BCA := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_BCA' LIMIT 1);
SET @ch_BankTransfer_BCA := IFNULL(@ch_BankTransfer_BCA, 2049300000000300005);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_BCA, 'BankTransfer_BCA', 'BCA', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_BCA := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_BCA' LIMIT 1);
SET @cf_BankTransfer_BCA := IFNULL(@cf_BankTransfer_BCA, 2049300000000400005);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_BCA, @factory_code, 'BankTransfer_BCA', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Bidvest := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Bidvest' LIMIT 1);
SET @ch_BankTransfer_Bidvest := IFNULL(@ch_BankTransfer_Bidvest, 2049300000000300006);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Bidvest, 'BankTransfer_Bidvest', 'Bidvest', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Bidvest := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Bidvest' LIMIT 1);
SET @cf_BankTransfer_Bidvest := IFNULL(@cf_BankTransfer_Bidvest, 2049300000000400006);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Bidvest, @factory_code, 'BankTransfer_Bidvest', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_BLIK := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_BLIK' LIMIT 1);
SET @ch_BankTransfer_BLIK := IFNULL(@ch_BankTransfer_BLIK, 2049300000000300007);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_BLIK, 'BankTransfer_BLIK', 'BLIK', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_BLIK := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_BLIK' LIMIT 1);
SET @cf_BankTransfer_BLIK := IFNULL(@cf_BankTransfer_BLIK, 2049300000000400007);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_BLIK, @factory_code, 'BankTransfer_BLIK', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_BNC := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_BNC' LIMIT 1);
SET @ch_BankTransfer_BNC := IFNULL(@ch_BankTransfer_BNC, 2049300000000300008);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_BNC, 'BankTransfer_BNC', 'BNC', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_BNC := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_BNC' LIMIT 1);
SET @cf_BankTransfer_BNC := IFNULL(@cf_BankTransfer_BNC, 2049300000000400008);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_BNC, @factory_code, 'BankTransfer_BNC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_BNI := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_BNI' LIMIT 1);
SET @ch_BankTransfer_BNI := IFNULL(@ch_BankTransfer_BNI, 2049300000000300009);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_BNI, 'BankTransfer_BNI', 'BNI', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_BNI := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_BNI' LIMIT 1);
SET @cf_BankTransfer_BNI := IFNULL(@cf_BankTransfer_BNI, 2049300000000400009);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_BNI, @factory_code, 'BankTransfer_BNI', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_BRI := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_BRI' LIMIT 1);
SET @ch_BankTransfer_BRI := IFNULL(@ch_BankTransfer_BRI, 2049300000000300010);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_BRI, 'BankTransfer_BRI', 'BRI', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_BRI := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_BRI' LIMIT 1);
SET @cf_BankTransfer_BRI := IFNULL(@cf_BankTransfer_BRI, 2049300000000400010);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_BRI, @factory_code, 'BankTransfer_BRI', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_CIMB := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_CIMB' LIMIT 1);
SET @ch_BankTransfer_CIMB := IFNULL(@ch_BankTransfer_CIMB, 2049300000000300011);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_CIMB, 'BankTransfer_CIMB', 'CIMB', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_CIMB := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_CIMB' LIMIT 1);
SET @cf_BankTransfer_CIMB := IFNULL(@cf_BankTransfer_CIMB, 2049300000000400011);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_CIMB, @factory_code, 'BankTransfer_CIMB', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_CL_BankTransfer := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_CL_BankTransfer' LIMIT 1);
SET @ch_BankTransfer_CL_BankTransfer := IFNULL(@ch_BankTransfer_CL_BankTransfer, 2049300000000300012);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_CL_BankTransfer, 'BankTransfer_CL_BankTransfer', 'CL_BankTransfer', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_CL_BankTransfer := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_CL_BankTransfer' LIMIT 1);
SET @cf_BankTransfer_CL_BankTransfer := IFNULL(@cf_BankTransfer_CL_BankTransfer, 2049300000000400012);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_CL_BankTransfer, @factory_code, 'BankTransfer_CL_BankTransfer', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_CO_BankTransfer := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_CO_BankTransfer' LIMIT 1);
SET @ch_BankTransfer_CO_BankTransfer := IFNULL(@ch_BankTransfer_CO_BankTransfer, 2049300000000300013);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_CO_BankTransfer, 'BankTransfer_CO_BankTransfer', 'CO_BankTransfer', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_CO_BankTransfer := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_CO_BankTransfer' LIMIT 1);
SET @cf_BankTransfer_CO_BankTransfer := IFNULL(@cf_BankTransfer_CO_BankTransfer, 2049300000000400013);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_CO_BankTransfer, @factory_code, 'BankTransfer_CO_BankTransfer', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Danamon := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Danamon' LIMIT 1);
SET @ch_BankTransfer_Danamon := IFNULL(@ch_BankTransfer_Danamon, 2049300000000300014);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Danamon, 'BankTransfer_Danamon', 'Danamon', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Danamon := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Danamon' LIMIT 1);
SET @cf_BankTransfer_Danamon := IFNULL(@cf_BankTransfer_Danamon, 2049300000000400014);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Danamon, @factory_code, 'BankTransfer_Danamon', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_EC_BankTransfer := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_EC_BankTransfer' LIMIT 1);
SET @ch_BankTransfer_EC_BankTransfer := IFNULL(@ch_BankTransfer_EC_BankTransfer, 2049300000000300015);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_EC_BankTransfer, 'BankTransfer_EC_BankTransfer', 'EC_BankTransfer', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_EC_BankTransfer := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_EC_BankTransfer' LIMIT 1);
SET @cf_BankTransfer_EC_BankTransfer := IFNULL(@cf_BankTransfer_EC_BankTransfer, 2049300000000400015);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_EC_BankTransfer, @factory_code, 'BankTransfer_EC_BankTransfer', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_eps := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_eps' LIMIT 1);
SET @ch_BankTransfer_eps := IFNULL(@ch_BankTransfer_eps, 2049300000000300016);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_eps, 'BankTransfer_eps', 'eps', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_eps := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_eps' LIMIT 1);
SET @cf_BankTransfer_eps := IFNULL(@cf_BankTransfer_eps, 2049300000000400016);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_eps, @factory_code, 'BankTransfer_eps', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_ESumATM := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_ESumATM' LIMIT 1);
SET @ch_BankTransfer_ESumATM := IFNULL(@ch_BankTransfer_ESumATM, 2049300000000300017);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_ESumATM, 'BankTransfer_ESumATM', 'ESumATM', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_ESumATM := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_ESumATM' LIMIT 1);
SET @cf_BankTransfer_ESumATM := IFNULL(@cf_BankTransfer_ESumATM, 2049300000000400017);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_ESumATM, @factory_code, 'BankTransfer_ESumATM', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_FNB := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_FNB' LIMIT 1);
SET @ch_BankTransfer_FNB := IFNULL(@ch_BankTransfer_FNB, 2049300000000300018);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_FNB, 'BankTransfer_FNB', 'FNB', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_FNB := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_FNB' LIMIT 1);
SET @cf_BankTransfer_FNB := IFNULL(@cf_BankTransfer_FNB, 2049300000000400018);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_FNB, @factory_code, 'BankTransfer_FNB', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_HBLKonnect := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_HBLKonnect' LIMIT 1);
SET @ch_BankTransfer_HBLKonnect := IFNULL(@ch_BankTransfer_HBLKonnect, 2049300000000300019);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_HBLKonnect, 'BankTransfer_HBLKonnect', 'HBLKonnect', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_HBLKonnect := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_HBLKonnect' LIMIT 1);
SET @cf_BankTransfer_HBLKonnect := IFNULL(@cf_BankTransfer_HBLKonnect, 2049300000000400019);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_HBLKonnect, @factory_code, 'BankTransfer_HBLKonnect', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_ID_BankTransfer := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_ID_BankTransfer' LIMIT 1);
SET @ch_BankTransfer_ID_BankTransfer := IFNULL(@ch_BankTransfer_ID_BankTransfer, 2049300000000300020);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_ID_BankTransfer, 'BankTransfer_ID_BankTransfer', 'ID_BankTransfer', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_ID_BankTransfer := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_ID_BankTransfer' LIMIT 1);
SET @cf_BankTransfer_ID_BankTransfer := IFNULL(@cf_BankTransfer_ID_BankTransfer, 2049300000000400020);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_ID_BankTransfer, @factory_code, 'BankTransfer_ID_BankTransfer', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_iDEAL := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_iDEAL' LIMIT 1);
SET @ch_BankTransfer_iDEAL := IFNULL(@ch_BankTransfer_iDEAL, 2049300000000300021);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_iDEAL, 'BankTransfer_iDEAL', 'iDEAL', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_iDEAL := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_iDEAL' LIMIT 1);
SET @cf_BankTransfer_iDEAL := IFNULL(@cf_BankTransfer_iDEAL, 2049300000000400021);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_iDEAL, @factory_code, 'BankTransfer_iDEAL', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Investec := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Investec' LIMIT 1);
SET @ch_BankTransfer_Investec := IFNULL(@ch_BankTransfer_Investec, 2049300000000300022);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Investec, 'BankTransfer_Investec', 'Investec', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Investec := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Investec' LIMIT 1);
SET @cf_BankTransfer_Investec := IFNULL(@cf_BankTransfer_Investec, 2049300000000400022);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Investec, @factory_code, 'BankTransfer_Investec', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Khipu := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Khipu' LIMIT 1);
SET @ch_BankTransfer_Khipu := IFNULL(@ch_BankTransfer_Khipu, 2049300000000300023);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Khipu, 'BankTransfer_Khipu', 'Khipu', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Khipu := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Khipu' LIMIT 1);
SET @cf_BankTransfer_Khipu := IFNULL(@cf_BankTransfer_Khipu, 2049300000000400023);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Khipu, @factory_code, 'BankTransfer_Khipu', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Mandiri := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Mandiri' LIMIT 1);
SET @ch_BankTransfer_Mandiri := IFNULL(@ch_BankTransfer_Mandiri, 2049300000000300024);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Mandiri, 'BankTransfer_Mandiri', 'Mandiri', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Mandiri := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Mandiri' LIMIT 1);
SET @cf_BankTransfer_Mandiri := IFNULL(@cf_BankTransfer_Mandiri, 2049300000000400024);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Mandiri, @factory_code, 'BankTransfer_Mandiri', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_MyBank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_MyBank' LIMIT 1);
SET @ch_BankTransfer_MyBank := IFNULL(@ch_BankTransfer_MyBank, 2049300000000300025);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_MyBank, 'BankTransfer_MyBank', 'MyBank', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_MyBank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_MyBank' LIMIT 1);
SET @cf_BankTransfer_MyBank := IFNULL(@cf_BankTransfer_MyBank, 2049300000000400025);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_MyBank, @factory_code, 'BankTransfer_MyBank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Nedbank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Nedbank' LIMIT 1);
SET @ch_BankTransfer_Nedbank := IFNULL(@ch_BankTransfer_Nedbank, 2049300000000300026);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Nedbank, 'BankTransfer_Nedbank', 'Nedbank', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Nedbank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Nedbank' LIMIT 1);
SET @cf_BankTransfer_Nedbank := IFNULL(@cf_BankTransfer_Nedbank, 2049300000000400026);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Nedbank, @factory_code, 'BankTransfer_Nedbank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_PaiID := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_PaiID' LIMIT 1);
SET @ch_BankTransfer_PaiID := IFNULL(@ch_BankTransfer_PaiID, 2049300000000300027);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_PaiID, 'BankTransfer_PaiID', 'PaiID', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_PaiID := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_PaiID' LIMIT 1);
SET @cf_BankTransfer_PaiID := IFNULL(@cf_BankTransfer_PaiID, 2049300000000400027);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_PaiID, @factory_code, 'BankTransfer_PaiID', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_PaybyBankapp := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_PaybyBankapp' LIMIT 1);
SET @ch_BankTransfer_PaybyBankapp := IFNULL(@ch_BankTransfer_PaybyBankapp, 2049300000000300028);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_PaybyBankapp, 'BankTransfer_PaybyBankapp', 'PaybyBankapp', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_PaybyBankapp := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_PaybyBankapp' LIMIT 1);
SET @cf_BankTransfer_PaybyBankapp := IFNULL(@cf_BankTransfer_PaybyBankapp, 2049300000000400028);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_PaybyBankapp, @factory_code, 'BankTransfer_PaybyBankapp', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @ch_BankTransfer_Paysafecard := IFNULL(@ch_BankTransfer_Paysafecard, 2049300000000300029);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', 'Paysafecard', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cf_BankTransfer_Paysafecard := IFNULL(@cf_BankTransfer_Paysafecard, 2049300000000400029);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Paysafecard, @factory_code, 'BankTransfer_Paysafecard', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_PayU := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_PayU' LIMIT 1);
SET @ch_BankTransfer_PayU := IFNULL(@ch_BankTransfer_PayU, 2049300000000300030);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_PayU, 'BankTransfer_PayU', 'PayU', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_PayU := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_PayU' LIMIT 1);
SET @cf_BankTransfer_PayU := IFNULL(@cf_BankTransfer_PayU, 2049300000000400030);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_PayU, @factory_code, 'BankTransfer_PayU', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_PE_BankTransfer := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_PE_BankTransfer' LIMIT 1);
SET @ch_BankTransfer_PE_BankTransfer := IFNULL(@ch_BankTransfer_PE_BankTransfer, 2049300000000300031);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_PE_BankTransfer, 'BankTransfer_PE_BankTransfer', 'PE_BankTransfer', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_PE_BankTransfer := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_PE_BankTransfer' LIMIT 1);
SET @cf_BankTransfer_PE_BankTransfer := IFNULL(@cf_BankTransfer_PE_BankTransfer, 2049300000000400031);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_PE_BankTransfer, @factory_code, 'BankTransfer_PE_BankTransfer', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Permata := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Permata' LIMIT 1);
SET @ch_BankTransfer_Permata := IFNULL(@ch_BankTransfer_Permata, 2049300000000300032);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Permata, 'BankTransfer_Permata', 'Permata', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Permata := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Permata' LIMIT 1);
SET @cf_BankTransfer_Permata := IFNULL(@cf_BankTransfer_Permata, 2049300000000400032);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Permata, @factory_code, 'BankTransfer_Permata', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Przelewy24 := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Przelewy24' LIMIT 1);
SET @ch_BankTransfer_Przelewy24 := IFNULL(@ch_BankTransfer_Przelewy24, 2049300000000300033);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Przelewy24, 'BankTransfer_Przelewy24', 'Przelewy24', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Przelewy24 := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Przelewy24' LIMIT 1);
SET @cf_BankTransfer_Przelewy24 := IFNULL(@cf_BankTransfer_Przelewy24, 2049300000000400033);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Przelewy24, @factory_code, 'BankTransfer_Przelewy24', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_PSE := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_PSE' LIMIT 1);
SET @ch_BankTransfer_PSE := IFNULL(@ch_BankTransfer_PSE, 2049300000000300034);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_PSE, 'BankTransfer_PSE', 'PSE', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_PSE := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_PSE' LIMIT 1);
SET @cf_BankTransfer_PSE := IFNULL(@cf_BankTransfer_PSE, 2049300000000400034);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_PSE, @factory_code, 'BankTransfer_PSE', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_SahabatSampoerna := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_SahabatSampoerna' LIMIT 1);
SET @ch_BankTransfer_SahabatSampoerna := IFNULL(@ch_BankTransfer_SahabatSampoerna, 2049300000000300035);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_SahabatSampoerna, 'BankTransfer_SahabatSampoerna', 'SahabatSampoerna', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_SahabatSampoerna := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_SahabatSampoerna' LIMIT 1);
SET @cf_BankTransfer_SahabatSampoerna := IFNULL(@cf_BankTransfer_SahabatSampoerna, 2049300000000400035);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_SahabatSampoerna, @factory_code, 'BankTransfer_SahabatSampoerna', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @ch_BankTransfer_Satispay := IFNULL(@ch_BankTransfer_Satispay, 2049300000000300036);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Satispay, 'BankTransfer_Satispay', 'Satispay', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cf_BankTransfer_Satispay := IFNULL(@cf_BankTransfer_Satispay, 2049300000000400036);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Satispay, @factory_code, 'BankTransfer_Satispay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @ch_BankTransfer_SEPA := IFNULL(@ch_BankTransfer_SEPA, 2049300000000300037);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_SEPA, 'BankTransfer_SEPA', 'SEPA', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cf_BankTransfer_SEPA := IFNULL(@cf_BankTransfer_SEPA, 2049300000000400037);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_SEPA, @factory_code, 'BankTransfer_SEPA', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_SPEI := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_SPEI' LIMIT 1);
SET @ch_BankTransfer_SPEI := IFNULL(@ch_BankTransfer_SPEI, 2049300000000300038);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_SPEI, 'BankTransfer_SPEI', 'SPEI', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_SPEI := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_SPEI' LIMIT 1);
SET @cf_BankTransfer_SPEI := IFNULL(@cf_BankTransfer_SPEI, 2049300000000400038);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_SPEI, @factory_code, 'BankTransfer_SPEI', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Standard := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Standard' LIMIT 1);
SET @ch_BankTransfer_Standard := IFNULL(@ch_BankTransfer_Standard, 2049300000000300039);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Standard, 'BankTransfer_Standard', 'Standard', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Standard := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Standard' LIMIT 1);
SET @cf_BankTransfer_Standard := IFNULL(@cf_BankTransfer_Standard, 2049300000000400039);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Standard, @factory_code, 'BankTransfer_Standard', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Transfiya := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Transfiya' LIMIT 1);
SET @ch_BankTransfer_Transfiya := IFNULL(@ch_BankTransfer_Transfiya, 2049300000000300040);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Transfiya, 'BankTransfer_Transfiya', 'Transfiya', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Transfiya := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Transfiya' LIMIT 1);
SET @cf_BankTransfer_Transfiya := IFNULL(@cf_BankTransfer_Transfiya, 2049300000000400040);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Transfiya, @factory_code, 'BankTransfer_Transfiya', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @ch_BankTransfer_Trustly := IFNULL(@ch_BankTransfer_Trustly, 2049300000000300041);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Trustly, 'BankTransfer_Trustly', 'Trustly', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cf_BankTransfer_Trustly := IFNULL(@cf_BankTransfer_Trustly, 2049300000000400041);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Trustly, @factory_code, 'BankTransfer_Trustly', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_Tyme := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_Tyme' LIMIT 1);
SET @ch_BankTransfer_Tyme := IFNULL(@ch_BankTransfer_Tyme, 2049300000000300042);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_Tyme, 'BankTransfer_Tyme', 'Tyme', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_Tyme := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_Tyme' LIMIT 1);
SET @cf_BankTransfer_Tyme := IFNULL(@cf_BankTransfer_Tyme, 2049300000000400042);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_Tyme, @factory_code, 'BankTransfer_Tyme', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BankTransfer_VN_BankTransfer := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BankTransfer_VN_BankTransfer' LIMIT 1);
SET @ch_BankTransfer_VN_BankTransfer := IFNULL(@ch_BankTransfer_VN_BankTransfer, 2049300000000300043);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BankTransfer_VN_BankTransfer, 'BankTransfer_VN_BankTransfer', 'VN_BankTransfer', '', 'BANK_TRANSFER', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BankTransfer_VN_BankTransfer := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BankTransfer_VN_BankTransfer' LIMIT 1);
SET @cf_BankTransfer_VN_BankTransfer := IFNULL(@cf_BankTransfer_VN_BankTransfer, 2049300000000400043);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BankTransfer_VN_BankTransfer, @factory_code, 'BankTransfer_VN_BankTransfer', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BNPL_BillEase := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BNPL_BillEase' LIMIT 1);
SET @ch_BNPL_BillEase := IFNULL(@ch_BNPL_BillEase, 2049300000000300044);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BNPL_BillEase, 'BNPL_BillEase', 'BillEase', '', 'BNPL', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BNPL_BillEase := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BNPL_BillEase' LIMIT 1);
SET @cf_BNPL_BillEase := IFNULL(@cf_BNPL_BillEase, 2049300000000400044);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BNPL_BillEase, @factory_code, 'BNPL_BillEase', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_BNPL_Kredivo := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'BNPL_Kredivo' LIMIT 1);
SET @ch_BNPL_Kredivo := IFNULL(@ch_BNPL_Kredivo, 2049300000000300045);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_BNPL_Kredivo, 'BNPL_Kredivo', 'Kredivo', '', 'BNPL', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_BNPL_Kredivo := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'BNPL_Kredivo' LIMIT 1);
SET @cf_BNPL_Kredivo := IFNULL(@cf_BNPL_Kredivo, 2049300000000400045);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_BNPL_Kredivo, @factory_code, 'BNPL_Kredivo', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Card_CreditCard := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Card_CreditCard' LIMIT 1);
SET @ch_Card_CreditCard := IFNULL(@ch_Card_CreditCard, 2049300000000300046);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Card_CreditCard, 'Card_CreditCard', 'CreditCard', '', 'BANK_CARD', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Card_CreditCard := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Card_CreditCard' LIMIT 1);
SET @cf_Card_CreditCard := IFNULL(@cf_Card_CreditCard, 2049300000000400046);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Card_CreditCard, @factory_code, 'Card_CreditCard', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Card_Knet := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Card_Knet' LIMIT 1);
SET @ch_Card_Knet := IFNULL(@ch_Card_Knet, 2049300000000300047);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Card_Knet, 'Card_Knet', 'Knet', '', 'BANK_CARD', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Card_Knet := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Card_Knet' LIMIT 1);
SET @cf_Card_Knet := IFNULL(@cf_Card_Knet, 2049300000000400047);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Card_Knet, @factory_code, 'Card_Knet', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Card_KR_Card := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Card_KR_Card' LIMIT 1);
SET @ch_Card_KR_Card := IFNULL(@ch_Card_KR_Card, 2049300000000300048);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Card_KR_Card, 'Card_KR_Card', 'KR_Card', '', 'BANK_CARD', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Card_KR_Card := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Card_KR_Card' LIMIT 1);
SET @cf_Card_KR_Card := IFNULL(@cf_Card_KR_Card, 2049300000000400048);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Card_KR_Card, @factory_code, 'Card_KR_Card', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Card_MADA := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Card_MADA' LIMIT 1);
SET @ch_Card_MADA := IFNULL(@ch_Card_MADA, 2049300000000300049);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Card_MADA, 'Card_MADA', 'MADA', '', 'BANK_CARD', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Card_MADA := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Card_MADA' LIMIT 1);
SET @cf_Card_MADA := IFNULL(@cf_Card_MADA, 2049300000000400049);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Card_MADA, @factory_code, 'Card_MADA', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_AlipayH5 := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_AlipayH5' LIMIT 1);
SET @ch_Ewallet_AlipayH5 := IFNULL(@ch_Ewallet_AlipayH5, 2049300000000300050);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_AlipayH5, 'Ewallet_AlipayH5', 'AlipayH5', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_AlipayH5 := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_AlipayH5' LIMIT 1);
SET @cf_Ewallet_AlipayH5 := IFNULL(@cf_Ewallet_AlipayH5, 2049300000000400050);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_AlipayH5, @factory_code, 'Ewallet_AlipayH5', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_ApplePay' LIMIT 1);
SET @ch_Ewallet_ApplePay := IFNULL(@ch_Ewallet_ApplePay, 2049300000000300051);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_ApplePay, 'Ewallet_ApplePay', 'ApplePay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_ApplePay' LIMIT 1);
SET @cf_Ewallet_ApplePay := IFNULL(@cf_Ewallet_ApplePay, 2049300000000400051);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_ApplePay, @factory_code, 'Ewallet_ApplePay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_BHIM := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_BHIM' LIMIT 1);
SET @ch_Ewallet_BHIM := IFNULL(@ch_Ewallet_BHIM, 2049300000000300052);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_BHIM, 'Ewallet_BHIM', 'BHIM', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_BHIM := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_BHIM' LIMIT 1);
SET @cf_Ewallet_BHIM := IFNULL(@cf_Ewallet_BHIM, 2049300000000400052);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_BHIM, @factory_code, 'Ewallet_BHIM', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_bKash := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_bKash' LIMIT 1);
SET @ch_Ewallet_bKash := IFNULL(@ch_Ewallet_bKash, 2049300000000300053);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_bKash, 'Ewallet_bKash', 'bKash', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_bKash := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_bKash' LIMIT 1);
SET @cf_Ewallet_bKash := IFNULL(@cf_Ewallet_bKash, 2049300000000400053);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_bKash, @factory_code, 'Ewallet_bKash', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_BKMExpress := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_BKMExpress' LIMIT 1);
SET @ch_Ewallet_BKMExpress := IFNULL(@ch_Ewallet_BKMExpress, 2049300000000300054);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_BKMExpress, 'Ewallet_BKMExpress', 'BKMExpress', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_BKMExpress := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_BKMExpress' LIMIT 1);
SET @cf_Ewallet_BKMExpress := IFNULL(@cf_Ewallet_BKMExpress, 2049300000000400054);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_BKMExpress, @factory_code, 'Ewallet_BKMExpress', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_BOOST := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_BOOST' LIMIT 1);
SET @ch_Ewallet_BOOST := IFNULL(@ch_Ewallet_BOOST, 2049300000000300055);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_BOOST, 'Ewallet_BOOST', 'BOOST', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_BOOST := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_BOOST' LIMIT 1);
SET @cf_Ewallet_BOOST := IFNULL(@cf_Ewallet_BOOST, 2049300000000400055);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_BOOST, @factory_code, 'Ewallet_BOOST', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Clearpay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Clearpay' LIMIT 1);
SET @ch_Ewallet_Clearpay := IFNULL(@ch_Ewallet_Clearpay, 2049300000000300056);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Clearpay, 'Ewallet_Clearpay', 'Clearpay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Clearpay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Clearpay' LIMIT 1);
SET @cf_Ewallet_Clearpay := IFNULL(@cf_Ewallet_Clearpay, 2049300000000400056);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Clearpay, @factory_code, 'Ewallet_Clearpay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_CoDi := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_CoDi' LIMIT 1);
SET @ch_Ewallet_CoDi := IFNULL(@ch_Ewallet_CoDi, 2049300000000300057);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_CoDi, 'Ewallet_CoDi', 'CoDi', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_CoDi := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_CoDi' LIMIT 1);
SET @cf_Ewallet_CoDi := IFNULL(@cf_Ewallet_CoDi, 2049300000000400057);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_CoDi, @factory_code, 'Ewallet_CoDi', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Coins := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Coins' LIMIT 1);
SET @ch_Ewallet_Coins := IFNULL(@ch_Ewallet_Coins, 2049300000000300058);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Coins, 'Ewallet_Coins', 'Coins', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Coins := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Coins' LIMIT 1);
SET @cf_Ewallet_Coins := IFNULL(@cf_Ewallet_Coins, 2049300000000400058);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Coins, @factory_code, 'Ewallet_Coins', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_DANA := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_DANA' LIMIT 1);
SET @ch_Ewallet_DANA := IFNULL(@ch_Ewallet_DANA, 2049300000000300059);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_DANA, 'Ewallet_DANA', 'DANA', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_DANA := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_DANA' LIMIT 1);
SET @cf_Ewallet_DANA := IFNULL(@cf_Ewallet_DANA, 2049300000000400059);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_DANA, @factory_code, 'Ewallet_DANA', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Easypaisa := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Easypaisa' LIMIT 1);
SET @ch_Ewallet_Easypaisa := IFNULL(@ch_Ewallet_Easypaisa, 2049300000000300060);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Easypaisa, 'Ewallet_Easypaisa', 'Easypaisa', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Easypaisa := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Easypaisa' LIMIT 1);
SET @cf_Ewallet_Easypaisa := IFNULL(@cf_Ewallet_Easypaisa, 2049300000000400060);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Easypaisa, @factory_code, 'Ewallet_Easypaisa', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Efawateercom := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Efawateercom' LIMIT 1);
SET @ch_Ewallet_Efawateercom := IFNULL(@ch_Ewallet_Efawateercom, 2049300000000300061);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Efawateercom, 'Ewallet_Efawateercom', 'Efawateercom', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Efawateercom := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Efawateercom' LIMIT 1);
SET @cf_Ewallet_Efawateercom := IFNULL(@cf_Ewallet_Efawateercom, 2049300000000400061);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Efawateercom, @factory_code, 'Ewallet_Efawateercom', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Efecty := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Efecty' LIMIT 1);
SET @ch_Ewallet_Efecty := IFNULL(@ch_Ewallet_Efecty, 2049300000000300062);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Efecty, 'Ewallet_Efecty', 'Efecty', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Efecty := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Efecty' LIMIT 1);
SET @cf_Ewallet_Efecty := IFNULL(@cf_Ewallet_Efecty, 2049300000000400062);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Efecty, @factory_code, 'Ewallet_Efecty', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_FawryPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_FawryPay' LIMIT 1);
SET @ch_Ewallet_FawryPay := IFNULL(@ch_Ewallet_FawryPay, 2049300000000300063);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_FawryPay, 'Ewallet_FawryPay', 'FawryPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_FawryPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_FawryPay' LIMIT 1);
SET @cf_Ewallet_FawryPay := IFNULL(@cf_Ewallet_FawryPay, 2049300000000400063);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_FawryPay, @factory_code, 'Ewallet_FawryPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Gcash := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Gcash' LIMIT 1);
SET @ch_Ewallet_Gcash := IFNULL(@ch_Ewallet_Gcash, 2049300000000300064);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Gcash, 'Ewallet_Gcash', 'Gcash', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Gcash := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Gcash' LIMIT 1);
SET @cf_Ewallet_Gcash := IFNULL(@cf_Ewallet_Gcash, 2049300000000400064);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Gcash, @factory_code, 'Ewallet_Gcash', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_GooglePay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_GooglePay' LIMIT 1);
SET @ch_Ewallet_GooglePay := IFNULL(@ch_Ewallet_GooglePay, 2049300000000300065);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_GooglePay, 'Ewallet_GooglePay', 'GooglePay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_GooglePay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_GooglePay' LIMIT 1);
SET @cf_Ewallet_GooglePay := IFNULL(@cf_Ewallet_GooglePay, 2049300000000400065);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_GooglePay, @factory_code, 'Ewallet_GooglePay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_GoPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_GoPay' LIMIT 1);
SET @ch_Ewallet_GoPay := IFNULL(@ch_Ewallet_GoPay, 2049300000000300066);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_GoPay, 'Ewallet_GoPay', 'GoPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_GoPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_GoPay' LIMIT 1);
SET @cf_Ewallet_GoPay := IFNULL(@cf_Ewallet_GoPay, 2049300000000400066);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_GoPay, @factory_code, 'Ewallet_GoPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Gpay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Gpay' LIMIT 1);
SET @ch_Ewallet_Gpay := IFNULL(@ch_Ewallet_Gpay, 2049300000000300067);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Gpay, 'Ewallet_Gpay', 'Gpay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Gpay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Gpay' LIMIT 1);
SET @cf_Ewallet_Gpay := IFNULL(@cf_Ewallet_Gpay, 2049300000000400067);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Gpay, @factory_code, 'Ewallet_Gpay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_GrabPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_GrabPay' LIMIT 1);
SET @ch_Ewallet_GrabPay := IFNULL(@ch_Ewallet_GrabPay, 2049300000000300068);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_GrabPay, 'Ewallet_GrabPay', 'GrabPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_GrabPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_GrabPay' LIMIT 1);
SET @cf_Ewallet_GrabPay := IFNULL(@cf_Ewallet_GrabPay, 2049300000000400068);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_GrabPay, @factory_code, 'Ewallet_GrabPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_HiPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_HiPay' LIMIT 1);
SET @ch_Ewallet_HiPay := IFNULL(@ch_Ewallet_HiPay, 2049300000000300069);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_HiPay, 'Ewallet_HiPay', 'HiPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_HiPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_HiPay' LIMIT 1);
SET @cf_Ewallet_HiPay := IFNULL(@cf_Ewallet_HiPay, 2049300000000400069);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_HiPay, @factory_code, 'Ewallet_HiPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_JazzCash := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_JazzCash' LIMIT 1);
SET @ch_Ewallet_JazzCash := IFNULL(@ch_Ewallet_JazzCash, 2049300000000300070);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_JazzCash, 'Ewallet_JazzCash', 'JazzCash', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_JazzCash := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_JazzCash' LIMIT 1);
SET @cf_Ewallet_JazzCash := IFNULL(@cf_Ewallet_JazzCash, 2049300000000400070);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_JazzCash, @factory_code, 'Ewallet_JazzCash', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_JkoPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_JkoPay' LIMIT 1);
SET @ch_Ewallet_JkoPay := IFNULL(@ch_Ewallet_JkoPay, 2049300000000300071);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_JkoPay, 'Ewallet_JkoPay', 'JkoPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_JkoPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_JkoPay' LIMIT 1);
SET @cf_Ewallet_JkoPay := IFNULL(@cf_Ewallet_JkoPay, 2049300000000400071);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_JkoPay, @factory_code, 'Ewallet_JkoPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_KaKaoPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_KaKaoPay' LIMIT 1);
SET @ch_Ewallet_KaKaoPay := IFNULL(@ch_Ewallet_KaKaoPay, 2049300000000300072);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_KaKaoPay, 'Ewallet_KaKaoPay', 'KaKaoPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_KaKaoPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_KaKaoPay' LIMIT 1);
SET @cf_Ewallet_KaKaoPay := IFNULL(@cf_Ewallet_KaKaoPay, 2049300000000400072);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_KaKaoPay, @factory_code, 'Ewallet_KaKaoPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Khalti := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Khalti' LIMIT 1);
SET @ch_Ewallet_Khalti := IFNULL(@ch_Ewallet_Khalti, 2049300000000300073);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Khalti, 'Ewallet_Khalti', 'Khalti', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Khalti := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Khalti' LIMIT 1);
SET @cf_Ewallet_Khalti := IFNULL(@cf_Ewallet_Khalti, 2049300000000400073);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Khalti, @factory_code, 'Ewallet_Khalti', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_LinePay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_LinePay' LIMIT 1);
SET @ch_Ewallet_LinePay := IFNULL(@ch_Ewallet_LinePay, 2049300000000300074);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_LinePay, 'Ewallet_LinePay', 'LinePay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_LinePay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_LinePay' LIMIT 1);
SET @cf_Ewallet_LinePay := IFNULL(@cf_Ewallet_LinePay, 2049300000000400074);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_LinePay, @factory_code, 'Ewallet_LinePay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_LinkAja := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_LinkAja' LIMIT 1);
SET @ch_Ewallet_LinkAja := IFNULL(@ch_Ewallet_LinkAja, 2049300000000300075);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_LinkAja, 'Ewallet_LinkAja', 'LinkAja', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_LinkAja := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_LinkAja' LIMIT 1);
SET @cf_Ewallet_LinkAja := IFNULL(@cf_Ewallet_LinkAja, 2049300000000400075);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_LinkAja, @factory_code, 'Ewallet_LinkAja', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Mach := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Mach' LIMIT 1);
SET @ch_Ewallet_Mach := IFNULL(@ch_Ewallet_Mach, 2049300000000300076);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Mach, 'Ewallet_Mach', 'Mach', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Mach := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Mach' LIMIT 1);
SET @cf_Ewallet_Mach := IFNULL(@cf_Ewallet_Mach, 2049300000000400076);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Mach, @factory_code, 'Ewallet_Mach', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_MaybankQRpay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_MaybankQRpay' LIMIT 1);
SET @ch_Ewallet_MaybankQRpay := IFNULL(@ch_Ewallet_MaybankQRpay, 2049300000000300077);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_MaybankQRpay, 'Ewallet_MaybankQRpay', 'MaybankQRpay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_MaybankQRpay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_MaybankQRpay' LIMIT 1);
SET @cf_Ewallet_MaybankQRpay := IFNULL(@cf_Ewallet_MaybankQRpay, 2049300000000400077);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_MaybankQRpay, @factory_code, 'Ewallet_MaybankQRpay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_MBWay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_MBWay' LIMIT 1);
SET @ch_Ewallet_MBWay := IFNULL(@ch_Ewallet_MBWay, 2049300000000300078);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_MBWay, 'Ewallet_MBWay', 'MBWay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_MBWay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_MBWay' LIMIT 1);
SET @cf_Ewallet_MBWay := IFNULL(@cf_Ewallet_MBWay, 2049300000000400078);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_MBWay, @factory_code, 'Ewallet_MBWay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Meeza := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Meeza' LIMIT 1);
SET @ch_Ewallet_Meeza := IFNULL(@ch_Ewallet_Meeza, 2049300000000300079);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Meeza, 'Ewallet_Meeza', 'Meeza', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Meeza := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Meeza' LIMIT 1);
SET @cf_Ewallet_Meeza := IFNULL(@cf_Ewallet_Meeza, 2049300000000400079);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Meeza, @factory_code, 'Ewallet_Meeza', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Mercadopago := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Mercadopago' LIMIT 1);
SET @ch_Ewallet_Mercadopago := IFNULL(@ch_Ewallet_Mercadopago, 2049300000000300080);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Mercadopago, 'Ewallet_Mercadopago', 'Mercadopago', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Mercadopago := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Mercadopago' LIMIT 1);
SET @cf_Ewallet_Mercadopago := IFNULL(@cf_Ewallet_Mercadopago, 2049300000000400080);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Mercadopago, @factory_code, 'Ewallet_Mercadopago', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Mobikwik := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Mobikwik' LIMIT 1);
SET @ch_Ewallet_Mobikwik := IFNULL(@ch_Ewallet_Mobikwik, 2049300000000300081);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Mobikwik, 'Ewallet_Mobikwik', 'Mobikwik', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Mobikwik := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Mobikwik' LIMIT 1);
SET @cf_Ewallet_Mobikwik := IFNULL(@cf_Ewallet_Mobikwik, 2049300000000400081);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Mobikwik, @factory_code, 'Ewallet_Mobikwik', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_MobileMoney := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_MobileMoney' LIMIT 1);
SET @ch_Ewallet_MobileMoney := IFNULL(@ch_Ewallet_MobileMoney, 2049300000000300082);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_MobileMoney, 'Ewallet_MobileMoney', 'MobileMoney', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_MobileMoney := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_MobileMoney' LIMIT 1);
SET @cf_Ewallet_MobileMoney := IFNULL(@cf_Ewallet_MobileMoney, 2049300000000400082);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_MobileMoney, @factory_code, 'Ewallet_MobileMoney', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_MoMo := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_MoMo' LIMIT 1);
SET @ch_Ewallet_MoMo := IFNULL(@ch_Ewallet_MoMo, 2049300000000300083);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_MoMo, 'Ewallet_MoMo', 'MoMo', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_MoMo := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_MoMo' LIMIT 1);
SET @cf_Ewallet_MoMo := IFNULL(@cf_Ewallet_MoMo, 2049300000000400083);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_MoMo, @factory_code, 'Ewallet_MoMo', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Multibanco := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Multibanco' LIMIT 1);
SET @ch_Ewallet_Multibanco := IFNULL(@ch_Ewallet_Multibanco, 2049300000000300084);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Multibanco, 'Ewallet_Multibanco', 'Multibanco', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Multibanco := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Multibanco' LIMIT 1);
SET @cf_Ewallet_Multibanco := IFNULL(@cf_Ewallet_Multibanco, 2049300000000400084);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Multibanco, @factory_code, 'Ewallet_Multibanco', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Nagad := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Nagad' LIMIT 1);
SET @ch_Ewallet_Nagad := IFNULL(@ch_Ewallet_Nagad, 2049300000000300085);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Nagad, 'Ewallet_Nagad', 'Nagad', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Nagad := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Nagad' LIMIT 1);
SET @cf_Ewallet_Nagad := IFNULL(@cf_Ewallet_Nagad, 2049300000000400085);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Nagad, @factory_code, 'Ewallet_Nagad', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_NaverPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_NaverPay' LIMIT 1);
SET @ch_Ewallet_NaverPay := IFNULL(@ch_Ewallet_NaverPay, 2049300000000300086);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_NaverPay, 'Ewallet_NaverPay', 'NaverPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_NaverPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_NaverPay' LIMIT 1);
SET @cf_Ewallet_NaverPay := IFNULL(@cf_Ewallet_NaverPay, 2049300000000400086);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_NaverPay, @factory_code, 'Ewallet_NaverPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Nequi := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Nequi' LIMIT 1);
SET @ch_Ewallet_Nequi := IFNULL(@ch_Ewallet_Nequi, 2049300000000300087);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Nequi, 'Ewallet_Nequi', 'Nequi', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Nequi := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Nequi' LIMIT 1);
SET @cf_Ewallet_Nequi := IFNULL(@cf_Ewallet_Nequi, 2049300000000400087);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Nequi, @factory_code, 'Ewallet_Nequi', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Orange := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Orange' LIMIT 1);
SET @ch_Ewallet_Orange := IFNULL(@ch_Ewallet_Orange, 2049300000000300088);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Orange, 'Ewallet_Orange', 'Orange', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Orange := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Orange' LIMIT 1);
SET @cf_Ewallet_Orange := IFNULL(@cf_Ewallet_Orange, 2049300000000400088);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Orange, @factory_code, 'Ewallet_Orange', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_OVO := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_OVO' LIMIT 1);
SET @ch_Ewallet_OVO := IFNULL(@ch_Ewallet_OVO, 2049300000000300089);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_OVO, 'Ewallet_OVO', 'OVO', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_OVO := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_OVO' LIMIT 1);
SET @cf_Ewallet_OVO := IFNULL(@cf_Ewallet_OVO, 2049300000000400089);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_OVO, @factory_code, 'Ewallet_OVO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Payco := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Payco' LIMIT 1);
SET @ch_Ewallet_Payco := IFNULL(@ch_Ewallet_Payco, 2049300000000300090);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Payco, 'Ewallet_Payco', 'Payco', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Payco := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Payco' LIMIT 1);
SET @cf_Ewallet_Payco := IFNULL(@cf_Ewallet_Payco, 2049300000000400090);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Payco, @factory_code, 'Ewallet_Payco', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Payconiq := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Payconiq' LIMIT 1);
SET @ch_Ewallet_Payconiq := IFNULL(@ch_Ewallet_Payconiq, 2049300000000300091);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Payconiq, 'Ewallet_Payconiq', 'Payconiq', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Payconiq := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Payconiq' LIMIT 1);
SET @cf_Ewallet_Payconiq := IFNULL(@cf_Ewallet_Payconiq, 2049300000000400091);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Payconiq, @factory_code, 'Ewallet_Payconiq', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_PayEasy := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_PayEasy' LIMIT 1);
SET @ch_Ewallet_PayEasy := IFNULL(@ch_Ewallet_PayEasy, 2049300000000300092);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_PayEasy, 'Ewallet_PayEasy', 'PayEasy', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_PayEasy := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_PayEasy' LIMIT 1);
SET @cf_Ewallet_PayEasy := IFNULL(@cf_Ewallet_PayEasy, 2049300000000400092);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_PayEasy, @factory_code, 'Ewallet_PayEasy', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_PayMaya := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_PayMaya' LIMIT 1);
SET @ch_Ewallet_PayMaya := IFNULL(@ch_Ewallet_PayMaya, 2049300000000300093);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_PayMaya, 'Ewallet_PayMaya', 'PayMaya', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_PayMaya := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_PayMaya' LIMIT 1);
SET @cf_Ewallet_PayMaya := IFNULL(@cf_Ewallet_PayMaya, 2049300000000400093);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_PayMaya, @factory_code, 'Ewallet_PayMaya', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_PayNow := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_PayNow' LIMIT 1);
SET @ch_Ewallet_PayNow := IFNULL(@ch_Ewallet_PayNow, 2049300000000300094);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_PayNow, 'Ewallet_PayNow', 'PayNow', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_PayNow := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_PayNow' LIMIT 1);
SET @cf_Ewallet_PayNow := IFNULL(@cf_Ewallet_PayNow, 2049300000000400094);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_PayNow, @factory_code, 'Ewallet_PayNow', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_PayPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_PayPay' LIMIT 1);
SET @ch_Ewallet_PayPay := IFNULL(@ch_Ewallet_PayPay, 2049300000000300095);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_PayPay, 'Ewallet_PayPay', 'PayPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_PayPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_PayPay' LIMIT 1);
SET @cf_Ewallet_PayPay := IFNULL(@cf_Ewallet_PayPay, 2049300000000400095);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_PayPay, @factory_code, 'Ewallet_PayPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Paytm := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Paytm' LIMIT 1);
SET @ch_Ewallet_Paytm := IFNULL(@ch_Ewallet_Paytm, 2049300000000300096);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Paytm, 'Ewallet_Paytm', 'Paytm', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Paytm := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Paytm' LIMIT 1);
SET @cf_Ewallet_Paytm := IFNULL(@cf_Ewallet_Paytm, 2049300000000400096);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Paytm, @factory_code, 'Ewallet_Paytm', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_PhonePe := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_PhonePe' LIMIT 1);
SET @ch_Ewallet_PhonePe := IFNULL(@ch_Ewallet_PhonePe, 2049300000000300097);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_PhonePe, 'Ewallet_PhonePe', 'PhonePe', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_PhonePe := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_PhonePe' LIMIT 1);
SET @cf_Ewallet_PhonePe := IFNULL(@cf_Ewallet_PhonePe, 2049300000000400097);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_PhonePe, @factory_code, 'Ewallet_PhonePe', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_PicPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_PicPay' LIMIT 1);
SET @ch_Ewallet_PicPay := IFNULL(@ch_Ewallet_PicPay, 2049300000000300098);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_PicPay, 'Ewallet_PicPay', 'PicPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_PicPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_PicPay' LIMIT 1);
SET @cf_Ewallet_PicPay := IFNULL(@cf_Ewallet_PicPay, 2049300000000400098);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_PicPay, @factory_code, 'Ewallet_PicPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_PromptPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_PromptPay' LIMIT 1);
SET @ch_Ewallet_PromptPay := IFNULL(@ch_Ewallet_PromptPay, 2049300000000300099);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_PromptPay, 'Ewallet_PromptPay', 'PromptPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_PromptPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_PromptPay' LIMIT 1);
SET @cf_Ewallet_PromptPay := IFNULL(@cf_Ewallet_PromptPay, 2049300000000400099);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_PromptPay, @factory_code, 'Ewallet_PromptPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_RocketPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_RocketPay' LIMIT 1);
SET @ch_Ewallet_RocketPay := IFNULL(@ch_Ewallet_RocketPay, 2049300000000300100);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_RocketPay, 'Ewallet_RocketPay', 'RocketPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_RocketPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_RocketPay' LIMIT 1);
SET @cf_Ewallet_RocketPay := IFNULL(@cf_Ewallet_RocketPay, 2049300000000400100);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_RocketPay, @factory_code, 'Ewallet_RocketPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_SamsungPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_SamsungPay' LIMIT 1);
SET @ch_Ewallet_SamsungPay := IFNULL(@ch_Ewallet_SamsungPay, 2049300000000300101);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_SamsungPay, 'Ewallet_SamsungPay', 'SamsungPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_SamsungPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_SamsungPay' LIMIT 1);
SET @cf_Ewallet_SamsungPay := IFNULL(@cf_Ewallet_SamsungPay, 2049300000000400101);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_SamsungPay, @factory_code, 'Ewallet_SamsungPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_SberPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_SberPay' LIMIT 1);
SET @ch_Ewallet_SberPay := IFNULL(@ch_Ewallet_SberPay, 2049300000000300102);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_SberPay, 'Ewallet_SberPay', 'SberPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_SberPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_SberPay' LIMIT 1);
SET @cf_Ewallet_SberPay := IFNULL(@cf_Ewallet_SberPay, 2049300000000400102);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_SberPay, @factory_code, 'Ewallet_SberPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_SBP := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_SBP' LIMIT 1);
SET @ch_Ewallet_SBP := IFNULL(@ch_Ewallet_SBP, 2049300000000300103);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_SBP, 'Ewallet_SBP', 'SBP', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_SBP := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_SBP' LIMIT 1);
SET @cf_Ewallet_SBP := IFNULL(@cf_Ewallet_SBP, 2049300000000400103);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_SBP, @factory_code, 'Ewallet_SBP', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_ShopeePay' LIMIT 1);
SET @ch_Ewallet_ShopeePay := IFNULL(@ch_Ewallet_ShopeePay, 2049300000000300104);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_ShopeePay, 'Ewallet_ShopeePay', 'ShopeePay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_ShopeePay' LIMIT 1);
SET @cf_Ewallet_ShopeePay := IFNULL(@cf_Ewallet_ShopeePay, 2049300000000400104);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_ShopeePay, @factory_code, 'Ewallet_ShopeePay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_SSGPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_SSGPay' LIMIT 1);
SET @ch_Ewallet_SSGPay := IFNULL(@ch_Ewallet_SSGPay, 2049300000000300105);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_SSGPay, 'Ewallet_SSGPay', 'SSGPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_SSGPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_SSGPay' LIMIT 1);
SET @cf_Ewallet_SSGPay := IFNULL(@cf_Ewallet_SSGPay, 2049300000000400105);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_SSGPay, @factory_code, 'Ewallet_SSGPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_STCPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_STCPay' LIMIT 1);
SET @ch_Ewallet_STCPay := IFNULL(@ch_Ewallet_STCPay, 2049300000000300106);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_STCPay, 'Ewallet_STCPay', 'STCPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_STCPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_STCPay' LIMIT 1);
SET @cf_Ewallet_STCPay := IFNULL(@cf_Ewallet_STCPay, 2049300000000400106);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_STCPay, @factory_code, 'Ewallet_STCPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Swish := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Swish' LIMIT 1);
SET @ch_Ewallet_Swish := IFNULL(@ch_Ewallet_Swish, 2049300000000300107);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Swish, 'Ewallet_Swish', 'Swish', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Swish := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Swish' LIMIT 1);
SET @cf_Ewallet_Swish := IFNULL(@cf_Ewallet_Swish, 2049300000000400107);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Swish, @factory_code, 'Ewallet_Swish', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Tinaba := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Tinaba' LIMIT 1);
SET @ch_Ewallet_Tinaba := IFNULL(@ch_Ewallet_Tinaba, 2049300000000300108);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Tinaba, 'Ewallet_Tinaba', 'Tinaba', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Tinaba := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Tinaba' LIMIT 1);
SET @cf_Ewallet_Tinaba := IFNULL(@cf_Ewallet_Tinaba, 2049300000000400108);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Tinaba, @factory_code, 'Ewallet_Tinaba', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_TinkoffPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_TinkoffPay' LIMIT 1);
SET @ch_Ewallet_TinkoffPay := IFNULL(@ch_Ewallet_TinkoffPay, 2049300000000300109);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_TinkoffPay, 'Ewallet_TinkoffPay', 'TinkoffPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_TinkoffPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_TinkoffPay' LIMIT 1);
SET @cf_Ewallet_TinkoffPay := IFNULL(@cf_Ewallet_TinkoffPay, 2049300000000400109);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_TinkoffPay, @factory_code, 'Ewallet_TinkoffPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_TNG := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_TNG' LIMIT 1);
SET @ch_Ewallet_TNG := IFNULL(@ch_Ewallet_TNG, 2049300000000300110);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_TNG, 'Ewallet_TNG', 'TNG', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_TNG := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_TNG' LIMIT 1);
SET @cf_Ewallet_TNG := IFNULL(@cf_Ewallet_TNG, 2049300000000400110);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_TNG, @factory_code, 'Ewallet_TNG', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Todito := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Todito' LIMIT 1);
SET @ch_Ewallet_Todito := IFNULL(@ch_Ewallet_Todito, 2049300000000300111);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Todito, 'Ewallet_Todito', 'Todito', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Todito := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Todito' LIMIT 1);
SET @cf_Ewallet_Todito := IFNULL(@cf_Ewallet_Todito, 2049300000000400111);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Todito, @factory_code, 'Ewallet_Todito', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_TOSS := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_TOSS' LIMIT 1);
SET @ch_Ewallet_TOSS := IFNULL(@ch_Ewallet_TOSS, 2049300000000300112);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_TOSS, 'Ewallet_TOSS', 'TOSS', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_TOSS := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_TOSS' LIMIT 1);
SET @cf_Ewallet_TOSS := IFNULL(@cf_Ewallet_TOSS, 2049300000000400112);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_TOSS, @factory_code, 'Ewallet_TOSS', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_TPaga := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_TPaga' LIMIT 1);
SET @ch_Ewallet_TPaga := IFNULL(@ch_Ewallet_TPaga, 2049300000000300113);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_TPaga, 'Ewallet_TPaga', 'TPaga', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_TPaga := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_TPaga' LIMIT 1);
SET @cf_Ewallet_TPaga := IFNULL(@cf_Ewallet_TPaga, 2049300000000400113);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_TPaga, @factory_code, 'Ewallet_TPaga', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_TrueMoney := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_TrueMoney' LIMIT 1);
SET @ch_Ewallet_TrueMoney := IFNULL(@ch_Ewallet_TrueMoney, 2049300000000300114);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_TrueMoney, 'Ewallet_TrueMoney', 'TrueMoney', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_TrueMoney := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_TrueMoney' LIMIT 1);
SET @cf_Ewallet_TrueMoney := IFNULL(@cf_Ewallet_TrueMoney, 2049300000000400114);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_TrueMoney, @factory_code, 'Ewallet_TrueMoney', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_UPI := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_UPI' LIMIT 1);
SET @ch_Ewallet_UPI := IFNULL(@ch_Ewallet_UPI, 2049300000000300115);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_UPI, 'Ewallet_UPI', 'UPI', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_UPI := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_UPI' LIMIT 1);
SET @cf_Ewallet_UPI := IFNULL(@cf_Ewallet_UPI, 2049300000000400115);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_UPI, @factory_code, 'Ewallet_UPI', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_VNPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_VNPay' LIMIT 1);
SET @ch_Ewallet_VNPay := IFNULL(@ch_Ewallet_VNPay, 2049300000000300116);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_VNPay, 'Ewallet_VNPay', 'VNPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_VNPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_VNPay' LIMIT 1);
SET @cf_Ewallet_VNPay := IFNULL(@cf_Ewallet_VNPay, 2049300000000400116);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_VNPay, @factory_code, 'Ewallet_VNPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Vodafone := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Vodafone' LIMIT 1);
SET @ch_Ewallet_Vodafone := IFNULL(@ch_Ewallet_Vodafone, 2049300000000300117);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Vodafone, 'Ewallet_Vodafone', 'Vodafone', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Vodafone := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Vodafone' LIMIT 1);
SET @cf_Ewallet_Vodafone := IFNULL(@cf_Ewallet_Vodafone, 2049300000000400117);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Vodafone, @factory_code, 'Ewallet_Vodafone', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_VTCPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_VTCPay' LIMIT 1);
SET @ch_Ewallet_VTCPay := IFNULL(@ch_Ewallet_VTCPay, 2049300000000300118);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_VTCPay, 'Ewallet_VTCPay', 'VTCPay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_VTCPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_VTCPay' LIMIT 1);
SET @cf_Ewallet_VTCPay := IFNULL(@cf_Ewallet_VTCPay, 2049300000000400118);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_VTCPay, @factory_code, 'Ewallet_VTCPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Webpay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Webpay' LIMIT 1);
SET @ch_Ewallet_Webpay := IFNULL(@ch_Ewallet_Webpay, 2049300000000300119);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Webpay, 'Ewallet_Webpay', 'Webpay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Webpay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Webpay' LIMIT 1);
SET @cf_Ewallet_Webpay := IFNULL(@cf_Ewallet_Webpay, 2049300000000400119);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Webpay, @factory_code, 'Ewallet_Webpay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_WeChatH5 := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_WeChatH5' LIMIT 1);
SET @ch_Ewallet_WeChatH5 := IFNULL(@ch_Ewallet_WeChatH5, 2049300000000300120);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_WeChatH5, 'Ewallet_WeChatH5', 'WeChatH5', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_WeChatH5 := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_WeChatH5' LIMIT 1);
SET @cf_Ewallet_WeChatH5 := IFNULL(@cf_Ewallet_WeChatH5, 2049300000000400120);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_WeChatH5, @factory_code, 'Ewallet_WeChatH5', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_YooMoney := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_YooMoney' LIMIT 1);
SET @ch_Ewallet_YooMoney := IFNULL(@ch_Ewallet_YooMoney, 2049300000000300121);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_YooMoney, 'Ewallet_YooMoney', 'YooMoney', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_YooMoney := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_YooMoney' LIMIT 1);
SET @cf_Ewallet_YooMoney := IFNULL(@cf_Ewallet_YooMoney, 2049300000000400121);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_YooMoney, @factory_code, 'Ewallet_YooMoney', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_ZainCash := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_ZainCash' LIMIT 1);
SET @ch_Ewallet_ZainCash := IFNULL(@ch_Ewallet_ZainCash, 2049300000000300122);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_ZainCash, 'Ewallet_ZainCash', 'ZainCash', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_ZainCash := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_ZainCash' LIMIT 1);
SET @cf_Ewallet_ZainCash := IFNULL(@cf_Ewallet_ZainCash, 2049300000000400122);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_ZainCash, @factory_code, 'Ewallet_ZainCash', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_Ewallet_Zalopay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'Ewallet_Zalopay' LIMIT 1);
SET @ch_Ewallet_Zalopay := IFNULL(@ch_Ewallet_Zalopay, 2049300000000300123);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_Ewallet_Zalopay, 'Ewallet_Zalopay', 'Zalopay', '', 'ELECTRONIC_WALLET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_Ewallet_Zalopay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'Ewallet_Zalopay' LIMIT 1);
SET @cf_Ewallet_Zalopay := IFNULL(@cf_Ewallet_Zalopay, 2049300000000400123);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_Ewallet_Zalopay, @factory_code, 'Ewallet_Zalopay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_BangkokBank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_BangkokBank' LIMIT 1);
SET @ch_OnlineBanking_BangkokBank := IFNULL(@ch_OnlineBanking_BangkokBank, 2049300000000300124);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_BangkokBank, 'OnlineBanking_BangkokBank', 'BangkokBank', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_BangkokBank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_BangkokBank' LIMIT 1);
SET @cf_OnlineBanking_BangkokBank := IFNULL(@cf_OnlineBanking_BangkokBank, 2049300000000400124);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_BangkokBank, @factory_code, 'OnlineBanking_BangkokBank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_BDO := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_BDO' LIMIT 1);
SET @ch_OnlineBanking_BDO := IFNULL(@ch_OnlineBanking_BDO, 2049300000000300125);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_BDO, 'OnlineBanking_BDO', 'BDO', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_BDO := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_BDO' LIMIT 1);
SET @cf_OnlineBanking_BDO := IFNULL(@cf_OnlineBanking_BDO, 2049300000000400125);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_BDO, @factory_code, 'OnlineBanking_BDO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_BPI := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_BPI' LIMIT 1);
SET @ch_OnlineBanking_BPI := IFNULL(@ch_OnlineBanking_BPI, 2049300000000300126);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_BPI, 'OnlineBanking_BPI', 'BPI', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_BPI := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_BPI' LIMIT 1);
SET @cf_OnlineBanking_BPI := IFNULL(@cf_OnlineBanking_BPI, 2049300000000400126);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_BPI, @factory_code, 'OnlineBanking_BPI', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_ChinaBank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_ChinaBank' LIMIT 1);
SET @ch_OnlineBanking_ChinaBank := IFNULL(@ch_OnlineBanking_ChinaBank, 2049300000000300127);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_ChinaBank, 'OnlineBanking_ChinaBank', 'ChinaBank', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_ChinaBank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_ChinaBank' LIMIT 1);
SET @cf_OnlineBanking_ChinaBank := IFNULL(@cf_OnlineBanking_ChinaBank, 2049300000000400127);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_ChinaBank, @factory_code, 'OnlineBanking_ChinaBank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_CL_eBank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_CL_eBank' LIMIT 1);
SET @ch_OnlineBanking_CL_eBank := IFNULL(@ch_OnlineBanking_CL_eBank, 2049300000000300128);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_CL_eBank, 'OnlineBanking_CL_eBank', 'CL_eBank', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_CL_eBank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_CL_eBank' LIMIT 1);
SET @cf_OnlineBanking_CL_eBank := IFNULL(@cf_OnlineBanking_CL_eBank, 2049300000000400128);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_CL_eBank, @factory_code, 'OnlineBanking_CL_eBank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_CO_eBank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_CO_eBank' LIMIT 1);
SET @ch_OnlineBanking_CO_eBank := IFNULL(@ch_OnlineBanking_CO_eBank, 2049300000000300129);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_CO_eBank, 'OnlineBanking_CO_eBank', 'CO_eBank', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_CO_eBank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_CO_eBank' LIMIT 1);
SET @cf_OnlineBanking_CO_eBank := IFNULL(@cf_OnlineBanking_CO_eBank, 2049300000000400129);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_CO_eBank, @factory_code, 'OnlineBanking_CO_eBank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_EC_eBank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_EC_eBank' LIMIT 1);
SET @ch_OnlineBanking_EC_eBank := IFNULL(@ch_OnlineBanking_EC_eBank, 2049300000000300130);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_EC_eBank, 'OnlineBanking_EC_eBank', 'EC_eBank', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_EC_eBank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_EC_eBank' LIMIT 1);
SET @cf_OnlineBanking_EC_eBank := IFNULL(@cf_OnlineBanking_EC_eBank, 2049300000000400130);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_EC_eBank, @factory_code, 'OnlineBanking_EC_eBank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX' LIMIT 1);
SET @ch_OnlineBanking_FPX := IFNULL(@ch_OnlineBanking_FPX, 2049300000000300131);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX, 'OnlineBanking_FPX', 'FPX', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX' LIMIT 1);
SET @cf_OnlineBanking_FPX := IFNULL(@cf_OnlineBanking_FPX, 2049300000000400131);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX, @factory_code, 'OnlineBanking_FPX', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_ABB := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_ABB' LIMIT 1);
SET @ch_OnlineBanking_FPX_ABB := IFNULL(@ch_OnlineBanking_FPX_ABB, 2049300000000300132);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_ABB, 'OnlineBanking_FPX_ABB', 'FPX_ABB', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_ABB := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_ABB' LIMIT 1);
SET @cf_OnlineBanking_FPX_ABB := IFNULL(@cf_OnlineBanking_FPX_ABB, 2049300000000400132);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_ABB, @factory_code, 'OnlineBanking_FPX_ABB', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_AGRO := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_AGRO' LIMIT 1);
SET @ch_OnlineBanking_FPX_AGRO := IFNULL(@ch_OnlineBanking_FPX_AGRO, 2049300000000300133);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_AGRO, 'OnlineBanking_FPX_AGRO', 'FPX_AGRO', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_AGRO := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_AGRO' LIMIT 1);
SET @cf_OnlineBanking_FPX_AGRO := IFNULL(@cf_OnlineBanking_FPX_AGRO, 2049300000000400133);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_AGRO, @factory_code, 'OnlineBanking_FPX_AGRO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_BIMB := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_BIMB' LIMIT 1);
SET @ch_OnlineBanking_FPX_BIMB := IFNULL(@ch_OnlineBanking_FPX_BIMB, 2049300000000300134);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_BIMB, 'OnlineBanking_FPX_BIMB', 'FPX_BIMB', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_BIMB := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_BIMB' LIMIT 1);
SET @cf_OnlineBanking_FPX_BIMB := IFNULL(@cf_OnlineBanking_FPX_BIMB, 2049300000000400134);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_BIMB, @factory_code, 'OnlineBanking_FPX_BIMB', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_BKRM := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_BKRM' LIMIT 1);
SET @ch_OnlineBanking_FPX_BKRM := IFNULL(@ch_OnlineBanking_FPX_BKRM, 2049300000000300135);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_BKRM, 'OnlineBanking_FPX_BKRM', 'FPX_BKRM', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_BKRM := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_BKRM' LIMIT 1);
SET @cf_OnlineBanking_FPX_BKRM := IFNULL(@cf_OnlineBanking_FPX_BKRM, 2049300000000400135);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_BKRM, @factory_code, 'OnlineBanking_FPX_BKRM', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_BMMB := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_BMMB' LIMIT 1);
SET @ch_OnlineBanking_FPX_BMMB := IFNULL(@ch_OnlineBanking_FPX_BMMB, 2049300000000300136);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_BMMB, 'OnlineBanking_FPX_BMMB', 'FPX_BMMB', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_BMMB := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_BMMB' LIMIT 1);
SET @cf_OnlineBanking_FPX_BMMB := IFNULL(@cf_OnlineBanking_FPX_BMMB, 2049300000000400136);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_BMMB, @factory_code, 'OnlineBanking_FPX_BMMB', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_BOC := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_BOC' LIMIT 1);
SET @ch_OnlineBanking_FPX_BOC := IFNULL(@ch_OnlineBanking_FPX_BOC, 2049300000000300137);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_BOC, 'OnlineBanking_FPX_BOC', 'FPX_BOC', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_BOC := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_BOC' LIMIT 1);
SET @cf_OnlineBanking_FPX_BOC := IFNULL(@cf_OnlineBanking_FPX_BOC, 2049300000000400137);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_BOC, @factory_code, 'OnlineBanking_FPX_BOC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_BSN := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_BSN' LIMIT 1);
SET @ch_OnlineBanking_FPX_BSN := IFNULL(@ch_OnlineBanking_FPX_BSN, 2049300000000300138);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_BSN, 'OnlineBanking_FPX_BSN', 'FPX_BSN', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_BSN := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_BSN' LIMIT 1);
SET @cf_OnlineBanking_FPX_BSN := IFNULL(@cf_OnlineBanking_FPX_BSN, 2049300000000400138);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_BSN, @factory_code, 'OnlineBanking_FPX_BSN', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_HongLeong := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_HongLeong' LIMIT 1);
SET @ch_OnlineBanking_FPX_HongLeong := IFNULL(@ch_OnlineBanking_FPX_HongLeong, 2049300000000300139);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_HongLeong, 'OnlineBanking_FPX_HongLeong', 'FPX_HongLeong', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_HongLeong := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_HongLeong' LIMIT 1);
SET @cf_OnlineBanking_FPX_HongLeong := IFNULL(@cf_OnlineBanking_FPX_HongLeong, 2049300000000400139);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_HongLeong, @factory_code, 'OnlineBanking_FPX_HongLeong', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_HSBC := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_HSBC' LIMIT 1);
SET @ch_OnlineBanking_FPX_HSBC := IFNULL(@ch_OnlineBanking_FPX_HSBC, 2049300000000300140);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_HSBC, 'OnlineBanking_FPX_HSBC', 'FPX_HSBC', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_HSBC := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_HSBC' LIMIT 1);
SET @cf_OnlineBanking_FPX_HSBC := IFNULL(@cf_OnlineBanking_FPX_HSBC, 2049300000000400140);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_HSBC, @factory_code, 'OnlineBanking_FPX_HSBC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_KFH := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_KFH' LIMIT 1);
SET @ch_OnlineBanking_FPX_KFH := IFNULL(@ch_OnlineBanking_FPX_KFH, 2049300000000300141);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_KFH, 'OnlineBanking_FPX_KFH', 'FPX_KFH', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_KFH := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_KFH' LIMIT 1);
SET @cf_OnlineBanking_FPX_KFH := IFNULL(@cf_OnlineBanking_FPX_KFH, 2049300000000400141);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_KFH, @factory_code, 'OnlineBanking_FPX_KFH', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_Maybank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_Maybank' LIMIT 1);
SET @ch_OnlineBanking_FPX_Maybank := IFNULL(@ch_OnlineBanking_FPX_Maybank, 2049300000000300142);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_Maybank, 'OnlineBanking_FPX_Maybank', 'FPX_Maybank', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_Maybank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_Maybank' LIMIT 1);
SET @cf_OnlineBanking_FPX_Maybank := IFNULL(@cf_OnlineBanking_FPX_Maybank, 2049300000000400142);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_Maybank, @factory_code, 'OnlineBanking_FPX_Maybank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_OCBC := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_OCBC' LIMIT 1);
SET @ch_OnlineBanking_FPX_OCBC := IFNULL(@ch_OnlineBanking_FPX_OCBC, 2049300000000300143);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_OCBC, 'OnlineBanking_FPX_OCBC', 'FPX_OCBC', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_OCBC := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_OCBC' LIMIT 1);
SET @cf_OnlineBanking_FPX_OCBC := IFNULL(@cf_OnlineBanking_FPX_OCBC, 2049300000000400143);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_OCBC, @factory_code, 'OnlineBanking_FPX_OCBC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_PBB := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_PBB' LIMIT 1);
SET @ch_OnlineBanking_FPX_PBB := IFNULL(@ch_OnlineBanking_FPX_PBB, 2049300000000300144);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_PBB, 'OnlineBanking_FPX_PBB', 'FPX_PBB', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_PBB := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_PBB' LIMIT 1);
SET @cf_OnlineBanking_FPX_PBB := IFNULL(@cf_OnlineBanking_FPX_PBB, 2049300000000400144);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_PBB, @factory_code, 'OnlineBanking_FPX_PBB', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_RHB := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_RHB' LIMIT 1);
SET @ch_OnlineBanking_FPX_RHB := IFNULL(@ch_OnlineBanking_FPX_RHB, 2049300000000300145);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_RHB, 'OnlineBanking_FPX_RHB', 'FPX_RHB', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_RHB := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_RHB' LIMIT 1);
SET @cf_OnlineBanking_FPX_RHB := IFNULL(@cf_OnlineBanking_FPX_RHB, 2049300000000400145);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_RHB, @factory_code, 'OnlineBanking_FPX_RHB', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_SCB := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_SCB' LIMIT 1);
SET @ch_OnlineBanking_FPX_SCB := IFNULL(@ch_OnlineBanking_FPX_SCB, 2049300000000300146);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_SCB, 'OnlineBanking_FPX_SCB', 'FPX_SCB', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_SCB := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_SCB' LIMIT 1);
SET @cf_OnlineBanking_FPX_SCB := IFNULL(@cf_OnlineBanking_FPX_SCB, 2049300000000400146);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_SCB, @factory_code, 'OnlineBanking_FPX_SCB', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_FPX_UOB := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_FPX_UOB' LIMIT 1);
SET @ch_OnlineBanking_FPX_UOB := IFNULL(@ch_OnlineBanking_FPX_UOB, 2049300000000300147);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_FPX_UOB, 'OnlineBanking_FPX_UOB', 'FPX_UOB', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_FPX_UOB := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_FPX_UOB' LIMIT 1);
SET @cf_OnlineBanking_FPX_UOB := IFNULL(@cf_OnlineBanking_FPX_UOB, 2049300000000400147);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_FPX_UOB, @factory_code, 'OnlineBanking_FPX_UOB', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_Kasikornbank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_Kasikornbank' LIMIT 1);
SET @ch_OnlineBanking_Kasikornbank := IFNULL(@ch_OnlineBanking_Kasikornbank, 2049300000000300148);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_Kasikornbank, 'OnlineBanking_Kasikornbank', 'Kasikornbank', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_Kasikornbank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_Kasikornbank' LIMIT 1);
SET @cf_OnlineBanking_Kasikornbank := IFNULL(@cf_OnlineBanking_Kasikornbank, 2049300000000400148);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_Kasikornbank, @factory_code, 'OnlineBanking_Kasikornbank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_Krungsri := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_Krungsri' LIMIT 1);
SET @ch_OnlineBanking_Krungsri := IFNULL(@ch_OnlineBanking_Krungsri, 2049300000000300149);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_Krungsri, 'OnlineBanking_Krungsri', 'Krungsri', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_Krungsri := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_Krungsri' LIMIT 1);
SET @cf_OnlineBanking_Krungsri := IFNULL(@cf_OnlineBanking_Krungsri, 2049300000000400149);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_Krungsri, @factory_code, 'OnlineBanking_Krungsri', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_PE_eBank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_PE_eBank' LIMIT 1);
SET @ch_OnlineBanking_PE_eBank := IFNULL(@ch_OnlineBanking_PE_eBank, 2049300000000300150);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_PE_eBank, 'OnlineBanking_PE_eBank', 'PE_eBank', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_PE_eBank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_PE_eBank' LIMIT 1);
SET @cf_OnlineBanking_PE_eBank := IFNULL(@cf_OnlineBanking_PE_eBank, 2049300000000400150);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_PE_eBank, @factory_code, 'OnlineBanking_PE_eBank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_RCBC := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_RCBC' LIMIT 1);
SET @ch_OnlineBanking_RCBC := IFNULL(@ch_OnlineBanking_RCBC, 2049300000000300151);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_RCBC, 'OnlineBanking_RCBC', 'RCBC', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_RCBC := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_RCBC' LIMIT 1);
SET @cf_OnlineBanking_RCBC := IFNULL(@cf_OnlineBanking_RCBC, 2049300000000400151);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_RCBC, @factory_code, 'OnlineBanking_RCBC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_SCBBank := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_SCBBank' LIMIT 1);
SET @ch_OnlineBanking_SCBBank := IFNULL(@ch_OnlineBanking_SCBBank, 2049300000000300152);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_SCBBank, 'OnlineBanking_SCBBank', 'SCBBank', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_SCBBank := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_SCBBank' LIMIT 1);
SET @cf_OnlineBanking_SCBBank := IFNULL(@cf_OnlineBanking_SCBBank, 2049300000000400152);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_SCBBank, @factory_code, 'OnlineBanking_SCBBank', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OnlineBanking_UBP := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OnlineBanking_UBP' LIMIT 1);
SET @ch_OnlineBanking_UBP := IFNULL(@ch_OnlineBanking_UBP, 2049300000000300153);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OnlineBanking_UBP, 'OnlineBanking_UBP', 'UBP', '', 'ONLINE_BANKING', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OnlineBanking_UBP := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OnlineBanking_UBP' LIMIT 1);
SET @cf_OnlineBanking_UBP := IFNULL(@cf_OnlineBanking_UBP, 2049300000000400153);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OnlineBanking_UBP, @factory_code, 'OnlineBanking_UBP', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_BOLETO := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_BOLETO' LIMIT 1);
SET @ch_OTC_BOLETO := IFNULL(@ch_OTC_BOLETO, 2049300000000300154);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_BOLETO, 'OTC_BOLETO', 'BOLETO', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_BOLETO := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_BOLETO' LIMIT 1);
SET @cf_OTC_BOLETO := IFNULL(@cf_OTC_BOLETO, 2049300000000400154);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_BOLETO, @factory_code, 'OTC_BOLETO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_Cash := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_Cash' LIMIT 1);
SET @ch_OTC_Cash := IFNULL(@ch_OTC_Cash, 2049300000000300155);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_Cash, 'OTC_Cash', 'Cash', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_Cash := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_Cash' LIMIT 1);
SET @cf_OTC_Cash := IFNULL(@cf_OTC_Cash, 2049300000000400155);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_Cash, @factory_code, 'OTC_Cash', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_ESum711 := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_ESum711' LIMIT 1);
SET @ch_OTC_ESum711 := IFNULL(@ch_OTC_ESum711, 2049300000000300156);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_ESum711, 'OTC_ESum711', 'ESum711', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_ESum711 := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_ESum711' LIMIT 1);
SET @cf_OTC_ESum711 := IFNULL(@cf_OTC_ESum711, 2049300000000400156);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_ESum711, @factory_code, 'OTC_ESum711', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_ESumFamilyMart := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_ESumFamilyMart' LIMIT 1);
SET @ch_OTC_ESumFamilyMart := IFNULL(@ch_OTC_ESumFamilyMart, 2049300000000300157);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_ESumFamilyMart, 'OTC_ESumFamilyMart', 'ESumFamilyMart', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_ESumFamilyMart := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_ESumFamilyMart' LIMIT 1);
SET @cf_OTC_ESumFamilyMart := IFNULL(@cf_OTC_ESumFamilyMart, 2049300000000400157);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_ESumFamilyMart, @factory_code, 'OTC_ESumFamilyMart', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_ESumLifeET := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_ESumLifeET' LIMIT 1);
SET @ch_OTC_ESumLifeET := IFNULL(@ch_OTC_ESumLifeET, 2049300000000300158);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_ESumLifeET, 'OTC_ESumLifeET', 'ESumLifeET', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_ESumLifeET := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_ESumLifeET' LIMIT 1);
SET @cf_OTC_ESumLifeET := IFNULL(@cf_OTC_ESumLifeET, 2049300000000400158);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_ESumLifeET, @factory_code, 'OTC_ESumLifeET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_FamilyMart := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_FamilyMart' LIMIT 1);
SET @ch_OTC_FamilyMart := IFNULL(@ch_OTC_FamilyMart, 2049300000000300159);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_FamilyMart, 'OTC_FamilyMart', 'FamilyMart', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_FamilyMart := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_FamilyMart' LIMIT 1);
SET @cf_OTC_FamilyMart := IFNULL(@cf_OTC_FamilyMart, 2049300000000400159);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_FamilyMart, @factory_code, 'OTC_FamilyMart', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_iBon := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_iBon' LIMIT 1);
SET @ch_OTC_iBon := IFNULL(@ch_OTC_iBon, 2049300000000300160);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_iBon, 'OTC_iBon', 'iBon', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_iBon := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_iBon' LIMIT 1);
SET @cf_OTC_iBon := IFNULL(@cf_OTC_iBon, 2049300000000400160);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_iBon, @factory_code, 'OTC_iBon', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_Konbini := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_Konbini' LIMIT 1);
SET @ch_OTC_Konbini := IFNULL(@ch_OTC_Konbini, 2049300000000300161);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_Konbini, 'OTC_Konbini', 'Konbini', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_Konbini := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_Konbini' LIMIT 1);
SET @cf_OTC_Konbini := IFNULL(@cf_OTC_Konbini, 2049300000000400161);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_Konbini, @factory_code, 'OTC_Konbini', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_LifeET := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_LifeET' LIMIT 1);
SET @ch_OTC_LifeET := IFNULL(@ch_OTC_LifeET, 2049300000000300162);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_LifeET, 'OTC_LifeET', 'LifeET', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_LifeET := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_LifeET' LIMIT 1);
SET @cf_OTC_LifeET := IFNULL(@cf_OTC_LifeET, 2049300000000400162);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_LifeET, @factory_code, 'OTC_LifeET', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_OK_GO := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_OK_GO' LIMIT 1);
SET @ch_OTC_OK_GO := IFNULL(@ch_OTC_OK_GO, 2049300000000300163);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_OK_GO, 'OTC_OK_GO', 'OK_GO', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_OK_GO := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_OK_GO' LIMIT 1);
SET @cf_OTC_OK_GO := IFNULL(@cf_OTC_OK_GO, 2049300000000400163);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_OK_GO, @factory_code, 'OTC_OK_GO', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_OXXOPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_OXXOPay' LIMIT 1);
SET @ch_OTC_OXXOPay := IFNULL(@ch_OTC_OXXOPay, 2049300000000300164);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_OXXOPay, 'OTC_OXXOPay', 'OXXOPay', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_OXXOPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_OXXOPay' LIMIT 1);
SET @cf_OTC_OXXOPay := IFNULL(@cf_OTC_OXXOPay, 2049300000000400164);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_OXXOPay, @factory_code, 'OTC_OXXOPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_Rapipago := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_Rapipago' LIMIT 1);
SET @ch_OTC_Rapipago := IFNULL(@ch_OTC_Rapipago, 2049300000000300165);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_Rapipago, 'OTC_Rapipago', 'Rapipago', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_Rapipago := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_Rapipago' LIMIT 1);
SET @cf_OTC_Rapipago := IFNULL(@cf_OTC_Rapipago, 2049300000000400165);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_Rapipago, @factory_code, 'OTC_Rapipago', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_SevenEleven := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_SevenEleven' LIMIT 1);
SET @ch_OTC_SevenEleven := IFNULL(@ch_OTC_SevenEleven, 2049300000000300166);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_SevenEleven, 'OTC_SevenEleven', 'SevenEleven', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_SevenEleven := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_SevenEleven' LIMIT 1);
SET @cf_OTC_SevenEleven := IFNULL(@cf_OTC_SevenEleven, 2049300000000400166);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_SevenEleven, @factory_code, 'OTC_SevenEleven', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_OTC_StorePay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'OTC_StorePay' LIMIT 1);
SET @ch_OTC_StorePay := IFNULL(@ch_OTC_StorePay, 2049300000000300167);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_OTC_StorePay, 'OTC_StorePay', 'StorePay', '', 'OTC', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_OTC_StorePay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'OTC_StorePay' LIMIT 1);
SET @cf_OTC_StorePay := IFNULL(@cf_OTC_StorePay, 2049300000000400167);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_OTC_StorePay, @factory_code, 'OTC_StorePay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_QR_AlipayScanPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'QR_AlipayScanPay' LIMIT 1);
SET @ch_QR_AlipayScanPay := IFNULL(@ch_QR_AlipayScanPay, 2049300000000300168);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_QR_AlipayScanPay, 'QR_AlipayScanPay', 'AlipayScanPay', '', 'QR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_QR_AlipayScanPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'QR_AlipayScanPay' LIMIT 1);
SET @cf_QR_AlipayScanPay := IFNULL(@cf_QR_AlipayScanPay, 2049300000000400168);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_QR_AlipayScanPay, @factory_code, 'QR_AlipayScanPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_QR_DuitNowQR := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'QR_DuitNowQR' LIMIT 1);
SET @ch_QR_DuitNowQR := IFNULL(@ch_QR_DuitNowQR, 2049300000000300169);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_QR_DuitNowQR, 'QR_DuitNowQR', 'DuitNowQR', '', 'QR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_QR_DuitNowQR := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'QR_DuitNowQR' LIMIT 1);
SET @cf_QR_DuitNowQR := IFNULL(@cf_QR_DuitNowQR, 2049300000000400169);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_QR_DuitNowQR, @factory_code, 'QR_DuitNowQR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_QR_PEQR := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'QR_PEQR' LIMIT 1);
SET @ch_QR_PEQR := IFNULL(@ch_QR_PEQR, 2049300000000300170);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_QR_PEQR, 'QR_PEQR', 'PEQR', '', 'QR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_QR_PEQR := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'QR_PEQR' LIMIT 1);
SET @cf_QR_PEQR := IFNULL(@cf_QR_PEQR, 2049300000000400170);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_QR_PEQR, @factory_code, 'QR_PEQR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_QR_PIX := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'QR_PIX' LIMIT 1);
SET @ch_QR_PIX := IFNULL(@ch_QR_PIX, 2049300000000300171);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_QR_PIX, 'QR_PIX', 'PIX', '', 'QR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_QR_PIX := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'QR_PIX' LIMIT 1);
SET @cf_QR_PIX := IFNULL(@cf_QR_PIX, 2049300000000400171);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_QR_PIX, @factory_code, 'QR_PIX', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_QR_PromptpayQR := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'QR_PromptpayQR' LIMIT 1);
SET @ch_QR_PromptpayQR := IFNULL(@ch_QR_PromptpayQR, 2049300000000300172);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_QR_PromptpayQR, 'QR_PromptpayQR', 'PromptpayQR', '', 'QR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_QR_PromptpayQR := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'QR_PromptpayQR' LIMIT 1);
SET @cf_QR_PromptpayQR := IFNULL(@cf_QR_PromptpayQR, 2049300000000400172);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_QR_PromptpayQR, @factory_code, 'QR_PromptpayQR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_QR_QRIS := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'QR_QRIS' LIMIT 1);
SET @ch_QR_QRIS := IFNULL(@ch_QR_QRIS, 2049300000000300173);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_QR_QRIS, 'QR_QRIS', 'QRIS', '', 'QR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_QR_QRIS := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'QR_QRIS' LIMIT 1);
SET @cf_QR_QRIS := IFNULL(@cf_QR_QRIS, 2049300000000400173);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_QR_QRIS, @factory_code, 'QR_QRIS', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_QR_QRPH := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'QR_QRPH' LIMIT 1);
SET @ch_QR_QRPH := IFNULL(@ch_QR_QRPH, 2049300000000300174);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_QR_QRPH, 'QR_QRPH', 'QRPH', '', 'QR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_QR_QRPH := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'QR_QRPH' LIMIT 1);
SET @cf_QR_QRPH := IFNULL(@cf_QR_QRPH, 2049300000000400174);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_QR_QRPH, @factory_code, 'QR_QRPH', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_QR_VietQR := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'QR_VietQR' LIMIT 1);
SET @ch_QR_VietQR := IFNULL(@ch_QR_VietQR, 2049300000000300175);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_QR_VietQR, 'QR_VietQR', 'VietQR', '', 'QR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_QR_VietQR := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'QR_VietQR' LIMIT 1);
SET @cf_QR_VietQR := IFNULL(@cf_QR_VietQR, 2049300000000400175);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_QR_VietQR, @factory_code, 'QR_VietQR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

SET @ch_QR_WeChatScanPay := (SELECT `id` FROM `sys_pay_channel` WHERE `channel_code` = 'QR_WeChatScanPay' LIMIT 1);
SET @ch_QR_WeChatScanPay := IFNULL(@ch_QR_WeChatScanPay, 2049300000000300176);
INSERT INTO `sys_pay_channel` (`id`, `channel_code`, `channel_name`, `channel_icon`, `channel_type`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@ch_QR_WeChatScanPay, 'QR_WeChatScanPay', 'WeChatScanPay', '', 'QR', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `channel_name` = VALUES(`channel_name`),
  `channel_type` = VALUES(`channel_type`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cf_QR_WeChatScanPay := (SELECT `id` FROM `sys_pay_channel_factory` WHERE `factory_code` = @factory_code AND `channel_code` = 'QR_WeChatScanPay' LIMIT 1);
SET @cf_QR_WeChatScanPay := IFNULL(@cf_QR_WeChatScanPay, 2049300000000400176);
INSERT INTO `sys_pay_channel_factory` (`id`, `factory_code`, `channel_code`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (@cf_QR_WeChatScanPay, @factory_code, 'QR_WeChatScanPay', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `factory_code` = VALUES(`factory_code`),
  `channel_code` = VALUES(`channel_code`),
  `update_time` = CURRENT_TIMESTAMP;

-- Country channel details.
SET @cch_AE_AED_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_AE_AED AND `channel_code` = 'Card_CreditCard' LIMIT 1);
SET @cch_AE_AED_Card_CreditCard := IF(@pc_AE_AED IS NULL, NULL, IFNULL(@cch_AE_AED_Card_CreditCard, 2049300000000500001));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_AE_AED_Card_CreditCard, @pc_AE_AED, 'Card_CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AE_AED IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_AE_AED_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_AE_AED AND `channel_code` = 'Card_CreditCard' AND `factory_code` = @factory_code AND `factory_channel` = 'CreditCard' LIMIT 1);
SET @dt_AE_AED_Card_CreditCard := IF(@pc_AE_AED IS NULL OR @cch_AE_AED_Card_CreditCard IS NULL, NULL, IFNULL(@dt_AE_AED_Card_CreditCard, 2049300000000600001));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_AE_AED_Card_CreditCard, @pc_AE_AED, @cch_AE_AED_Card_CreditCard, 'Card_CreditCard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AE_AED IS NOT NULL AND @cch_AE_AED_Card_CreditCard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_AE_AED_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_AE_AED AND `channel_code` = 'Ewallet_ApplePay' LIMIT 1);
SET @cch_AE_AED_Ewallet_ApplePay := IF(@pc_AE_AED IS NULL, NULL, IFNULL(@cch_AE_AED_Ewallet_ApplePay, 2049300000000500002));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_AE_AED_Ewallet_ApplePay, @pc_AE_AED, 'Ewallet_ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AE_AED IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_AE_AED_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_AE_AED AND `channel_code` = 'Ewallet_ApplePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ApplePay' LIMIT 1);
SET @dt_AE_AED_Ewallet_ApplePay := IF(@pc_AE_AED IS NULL OR @cch_AE_AED_Ewallet_ApplePay IS NULL, NULL, IFNULL(@dt_AE_AED_Ewallet_ApplePay, 2049300000000600002));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_AE_AED_Ewallet_ApplePay, @pc_AE_AED, @cch_AE_AED_Ewallet_ApplePay, 'Ewallet_ApplePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AE_AED IS NOT NULL AND @cch_AE_AED_Ewallet_ApplePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_AR_ARS_BankTransfer_Khipu := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_AR_ARS AND `channel_code` = 'BankTransfer_Khipu' LIMIT 1);
SET @cch_AR_ARS_BankTransfer_Khipu := IF(@pc_AR_ARS IS NULL, NULL, IFNULL(@cch_AR_ARS_BankTransfer_Khipu, 2049300000000500003));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_AR_ARS_BankTransfer_Khipu, @pc_AR_ARS, 'BankTransfer_Khipu', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AR_ARS IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_AR_ARS_BankTransfer_Khipu := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_AR_ARS AND `channel_code` = 'BankTransfer_Khipu' AND `factory_code` = @factory_code AND `factory_channel` = 'Khipu' LIMIT 1);
SET @dt_AR_ARS_BankTransfer_Khipu := IF(@pc_AR_ARS IS NULL OR @cch_AR_ARS_BankTransfer_Khipu IS NULL, NULL, IFNULL(@dt_AR_ARS_BankTransfer_Khipu, 2049300000000600003));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_AR_ARS_BankTransfer_Khipu, @pc_AR_ARS, @cch_AR_ARS_BankTransfer_Khipu, 'BankTransfer_Khipu', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Khipu', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AR_ARS IS NOT NULL AND @cch_AR_ARS_BankTransfer_Khipu IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_AR_ARS_OTC_Rapipago := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_AR_ARS AND `channel_code` = 'OTC_Rapipago' LIMIT 1);
SET @cch_AR_ARS_OTC_Rapipago := IF(@pc_AR_ARS IS NULL, NULL, IFNULL(@cch_AR_ARS_OTC_Rapipago, 2049300000000500004));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_AR_ARS_OTC_Rapipago, @pc_AR_ARS, 'OTC_Rapipago', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AR_ARS IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_AR_ARS_OTC_Rapipago := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_AR_ARS AND `channel_code` = 'OTC_Rapipago' AND `factory_code` = @factory_code AND `factory_channel` = 'Rapipago' LIMIT 1);
SET @dt_AR_ARS_OTC_Rapipago := IF(@pc_AR_ARS IS NULL OR @cch_AR_ARS_OTC_Rapipago IS NULL, NULL, IFNULL(@dt_AR_ARS_OTC_Rapipago, 2049300000000600004));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_AR_ARS_OTC_Rapipago, @pc_AR_ARS, @cch_AR_ARS_OTC_Rapipago, 'OTC_Rapipago', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Rapipago', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AR_ARS IS NOT NULL AND @cch_AR_ARS_OTC_Rapipago IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_AT_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_AT_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_AT_EUR_BankTransfer_Trustly := IF(@pc_AT_EUR IS NULL, NULL, IFNULL(@cch_AT_EUR_BankTransfer_Trustly, 2049300000000500005));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_AT_EUR_BankTransfer_Trustly, @pc_AT_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_AT_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_AT_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_AT_EUR_BankTransfer_Trustly := IF(@pc_AT_EUR IS NULL OR @cch_AT_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_AT_EUR_BankTransfer_Trustly, 2049300000000600005));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_AT_EUR_BankTransfer_Trustly, @pc_AT_EUR, @cch_AT_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL AND @cch_AT_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_AT_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_AT_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_AT_EUR_BankTransfer_Satispay := IF(@pc_AT_EUR IS NULL, NULL, IFNULL(@cch_AT_EUR_BankTransfer_Satispay, 2049300000000500006));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_AT_EUR_BankTransfer_Satispay, @pc_AT_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_AT_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_AT_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_AT_EUR_BankTransfer_Satispay := IF(@pc_AT_EUR IS NULL OR @cch_AT_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_AT_EUR_BankTransfer_Satispay, 2049300000000600006));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_AT_EUR_BankTransfer_Satispay, @pc_AT_EUR, @cch_AT_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL AND @cch_AT_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_AT_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_AT_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_AT_EUR_BankTransfer_SEPA := IF(@pc_AT_EUR IS NULL, NULL, IFNULL(@cch_AT_EUR_BankTransfer_SEPA, 2049300000000500007));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_AT_EUR_BankTransfer_SEPA, @pc_AT_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_AT_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_AT_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_AT_EUR_BankTransfer_SEPA := IF(@pc_AT_EUR IS NULL OR @cch_AT_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_AT_EUR_BankTransfer_SEPA, 2049300000000600007));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_AT_EUR_BankTransfer_SEPA, @pc_AT_EUR, @cch_AT_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL AND @cch_AT_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_AT_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_AT_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_AT_EUR_BankTransfer_Paysafecard := IF(@pc_AT_EUR IS NULL, NULL, IFNULL(@cch_AT_EUR_BankTransfer_Paysafecard, 2049300000000500008));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_AT_EUR_BankTransfer_Paysafecard, @pc_AT_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_AT_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_AT_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_AT_EUR_BankTransfer_Paysafecard := IF(@pc_AT_EUR IS NULL OR @cch_AT_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_AT_EUR_BankTransfer_Paysafecard, 2049300000000600008));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_AT_EUR_BankTransfer_Paysafecard, @pc_AT_EUR, @cch_AT_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL AND @cch_AT_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_AT_EUR_BankTransfer_eps := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_AT_EUR AND `channel_code` = 'BankTransfer_eps' LIMIT 1);
SET @cch_AT_EUR_BankTransfer_eps := IF(@pc_AT_EUR IS NULL, NULL, IFNULL(@cch_AT_EUR_BankTransfer_eps, 2049300000000500009));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_AT_EUR_BankTransfer_eps, @pc_AT_EUR, 'BankTransfer_eps', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_AT_EUR_BankTransfer_eps := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_AT_EUR AND `channel_code` = 'BankTransfer_eps' AND `factory_code` = @factory_code AND `factory_channel` = 'eps' LIMIT 1);
SET @dt_AT_EUR_BankTransfer_eps := IF(@pc_AT_EUR IS NULL OR @cch_AT_EUR_BankTransfer_eps IS NULL, NULL, IFNULL(@dt_AT_EUR_BankTransfer_eps, 2049300000000600009));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_AT_EUR_BankTransfer_eps, @pc_AT_EUR, @cch_AT_EUR_BankTransfer_eps, 'BankTransfer_eps', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'eps', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AT_EUR IS NOT NULL AND @cch_AT_EUR_BankTransfer_eps IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_AU_AUD_BankTransfer_PaiID := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_AU_AUD AND `channel_code` = 'BankTransfer_PaiID' LIMIT 1);
SET @cch_AU_AUD_BankTransfer_PaiID := IF(@pc_AU_AUD IS NULL, NULL, IFNULL(@cch_AU_AUD_BankTransfer_PaiID, 2049300000000500010));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_AU_AUD_BankTransfer_PaiID, @pc_AU_AUD, 'BankTransfer_PaiID', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AU_AUD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_AU_AUD_BankTransfer_PaiID := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_AU_AUD AND `channel_code` = 'BankTransfer_PaiID' AND `factory_code` = @factory_code AND `factory_channel` = 'PaiID' LIMIT 1);
SET @dt_AU_AUD_BankTransfer_PaiID := IF(@pc_AU_AUD IS NULL OR @cch_AU_AUD_BankTransfer_PaiID IS NULL, NULL, IFNULL(@dt_AU_AUD_BankTransfer_PaiID, 2049300000000600010));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_AU_AUD_BankTransfer_PaiID, @pc_AU_AUD, @cch_AU_AUD_BankTransfer_PaiID, 'BankTransfer_PaiID', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'PaiID', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_AU_AUD IS NOT NULL AND @cch_AU_AUD_BankTransfer_PaiID IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BD_BDT_Ewallet_Nagad := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BD_BDT AND `channel_code` = 'Ewallet_Nagad' LIMIT 1);
SET @cch_BD_BDT_Ewallet_Nagad := IF(@pc_BD_BDT IS NULL, NULL, IFNULL(@cch_BD_BDT_Ewallet_Nagad, 2049300000000500011));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BD_BDT_Ewallet_Nagad, @pc_BD_BDT, 'Ewallet_Nagad', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BD_BDT IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BD_BDT_Ewallet_Nagad := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BD_BDT AND `channel_code` = 'Ewallet_Nagad' AND `factory_code` = @factory_code AND `factory_channel` = 'Nagad' LIMIT 1);
SET @dt_BD_BDT_Ewallet_Nagad := IF(@pc_BD_BDT IS NULL OR @cch_BD_BDT_Ewallet_Nagad IS NULL, NULL, IFNULL(@dt_BD_BDT_Ewallet_Nagad, 2049300000000600011));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BD_BDT_Ewallet_Nagad, @pc_BD_BDT, @cch_BD_BDT_Ewallet_Nagad, 'Ewallet_Nagad', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Nagad', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BD_BDT IS NOT NULL AND @cch_BD_BDT_Ewallet_Nagad IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BD_BDT_Ewallet_bKash := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BD_BDT AND `channel_code` = 'Ewallet_bKash' LIMIT 1);
SET @cch_BD_BDT_Ewallet_bKash := IF(@pc_BD_BDT IS NULL, NULL, IFNULL(@cch_BD_BDT_Ewallet_bKash, 2049300000000500012));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BD_BDT_Ewallet_bKash, @pc_BD_BDT, 'Ewallet_bKash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BD_BDT IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BD_BDT_Ewallet_bKash := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BD_BDT AND `channel_code` = 'Ewallet_bKash' AND `factory_code` = @factory_code AND `factory_channel` = 'bKash' LIMIT 1);
SET @dt_BD_BDT_Ewallet_bKash := IF(@pc_BD_BDT IS NULL OR @cch_BD_BDT_Ewallet_bKash IS NULL, NULL, IFNULL(@dt_BD_BDT_Ewallet_bKash, 2049300000000600012));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BD_BDT_Ewallet_bKash, @pc_BD_BDT, @cch_BD_BDT_Ewallet_bKash, 'Ewallet_bKash', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'bKash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BD_BDT IS NOT NULL AND @cch_BD_BDT_Ewallet_bKash IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BD_BDT_Ewallet_RocketPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BD_BDT AND `channel_code` = 'Ewallet_RocketPay' LIMIT 1);
SET @cch_BD_BDT_Ewallet_RocketPay := IF(@pc_BD_BDT IS NULL, NULL, IFNULL(@cch_BD_BDT_Ewallet_RocketPay, 2049300000000500013));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BD_BDT_Ewallet_RocketPay, @pc_BD_BDT, 'Ewallet_RocketPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BD_BDT IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BD_BDT_Ewallet_RocketPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BD_BDT AND `channel_code` = 'Ewallet_RocketPay' AND `factory_code` = @factory_code AND `factory_channel` = 'RocketPay' LIMIT 1);
SET @dt_BD_BDT_Ewallet_RocketPay := IF(@pc_BD_BDT IS NULL OR @cch_BD_BDT_Ewallet_RocketPay IS NULL, NULL, IFNULL(@dt_BD_BDT_Ewallet_RocketPay, 2049300000000600013));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BD_BDT_Ewallet_RocketPay, @pc_BD_BDT, @cch_BD_BDT_Ewallet_RocketPay, 'Ewallet_RocketPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'RocketPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BD_BDT IS NOT NULL AND @cch_BD_BDT_Ewallet_RocketPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BE_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BE_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_BE_EUR_BankTransfer_Satispay := IF(@pc_BE_EUR IS NULL, NULL, IFNULL(@cch_BE_EUR_BankTransfer_Satispay, 2049300000000500014));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BE_EUR_BankTransfer_Satispay, @pc_BE_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BE_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BE_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_BE_EUR_BankTransfer_Satispay := IF(@pc_BE_EUR IS NULL OR @cch_BE_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_BE_EUR_BankTransfer_Satispay, 2049300000000600014));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BE_EUR_BankTransfer_Satispay, @pc_BE_EUR, @cch_BE_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL AND @cch_BE_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BE_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BE_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_BE_EUR_BankTransfer_SEPA := IF(@pc_BE_EUR IS NULL, NULL, IFNULL(@cch_BE_EUR_BankTransfer_SEPA, 2049300000000500015));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BE_EUR_BankTransfer_SEPA, @pc_BE_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BE_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BE_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_BE_EUR_BankTransfer_SEPA := IF(@pc_BE_EUR IS NULL OR @cch_BE_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_BE_EUR_BankTransfer_SEPA, 2049300000000600015));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BE_EUR_BankTransfer_SEPA, @pc_BE_EUR, @cch_BE_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL AND @cch_BE_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BE_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BE_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_BE_EUR_BankTransfer_Paysafecard := IF(@pc_BE_EUR IS NULL, NULL, IFNULL(@cch_BE_EUR_BankTransfer_Paysafecard, 2049300000000500016));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BE_EUR_BankTransfer_Paysafecard, @pc_BE_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BE_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BE_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_BE_EUR_BankTransfer_Paysafecard := IF(@pc_BE_EUR IS NULL OR @cch_BE_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_BE_EUR_BankTransfer_Paysafecard, 2049300000000600016));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BE_EUR_BankTransfer_Paysafecard, @pc_BE_EUR, @cch_BE_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL AND @cch_BE_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BE_EUR_BankTransfer_Bancontact := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BE_EUR AND `channel_code` = 'BankTransfer_Bancontact' LIMIT 1);
SET @cch_BE_EUR_BankTransfer_Bancontact := IF(@pc_BE_EUR IS NULL, NULL, IFNULL(@cch_BE_EUR_BankTransfer_Bancontact, 2049300000000500017));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BE_EUR_BankTransfer_Bancontact, @pc_BE_EUR, 'BankTransfer_Bancontact', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BE_EUR_BankTransfer_Bancontact := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BE_EUR AND `channel_code` = 'BankTransfer_Bancontact' AND `factory_code` = @factory_code AND `factory_channel` = 'Bancontact' LIMIT 1);
SET @dt_BE_EUR_BankTransfer_Bancontact := IF(@pc_BE_EUR IS NULL OR @cch_BE_EUR_BankTransfer_Bancontact IS NULL, NULL, IFNULL(@dt_BE_EUR_BankTransfer_Bancontact, 2049300000000600017));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BE_EUR_BankTransfer_Bancontact, @pc_BE_EUR, @cch_BE_EUR_BankTransfer_Bancontact, 'BankTransfer_Bancontact', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Bancontact', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL AND @cch_BE_EUR_BankTransfer_Bancontact IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BE_EUR_Ewallet_Payconiq := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BE_EUR AND `channel_code` = 'Ewallet_Payconiq' LIMIT 1);
SET @cch_BE_EUR_Ewallet_Payconiq := IF(@pc_BE_EUR IS NULL, NULL, IFNULL(@cch_BE_EUR_Ewallet_Payconiq, 2049300000000500018));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BE_EUR_Ewallet_Payconiq, @pc_BE_EUR, 'Ewallet_Payconiq', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BE_EUR_Ewallet_Payconiq := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BE_EUR AND `channel_code` = 'Ewallet_Payconiq' AND `factory_code` = @factory_code AND `factory_channel` = 'Payconiq' LIMIT 1);
SET @dt_BE_EUR_Ewallet_Payconiq := IF(@pc_BE_EUR IS NULL OR @cch_BE_EUR_Ewallet_Payconiq IS NULL, NULL, IFNULL(@dt_BE_EUR_Ewallet_Payconiq, 2049300000000600018));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BE_EUR_Ewallet_Payconiq, @pc_BE_EUR, @cch_BE_EUR_Ewallet_Payconiq, 'Ewallet_Payconiq', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'Payconiq', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BE_EUR IS NOT NULL AND @cch_BE_EUR_Ewallet_Payconiq IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BG_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BG_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_BG_EUR_BankTransfer_Satispay := IF(@pc_BG_EUR IS NULL, NULL, IFNULL(@cch_BG_EUR_BankTransfer_Satispay, 2049300000000500019));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BG_EUR_BankTransfer_Satispay, @pc_BG_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BG_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BG_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BG_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_BG_EUR_BankTransfer_Satispay := IF(@pc_BG_EUR IS NULL OR @cch_BG_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_BG_EUR_BankTransfer_Satispay, 2049300000000600019));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BG_EUR_BankTransfer_Satispay, @pc_BG_EUR, @cch_BG_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BG_EUR IS NOT NULL AND @cch_BG_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BG_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BG_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_BG_EUR_BankTransfer_SEPA := IF(@pc_BG_EUR IS NULL, NULL, IFNULL(@cch_BG_EUR_BankTransfer_SEPA, 2049300000000500020));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BG_EUR_BankTransfer_SEPA, @pc_BG_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BG_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BG_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BG_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_BG_EUR_BankTransfer_SEPA := IF(@pc_BG_EUR IS NULL OR @cch_BG_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_BG_EUR_BankTransfer_SEPA, 2049300000000600020));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BG_EUR_BankTransfer_SEPA, @pc_BG_EUR, @cch_BG_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BG_EUR IS NOT NULL AND @cch_BG_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BG_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BG_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_BG_EUR_BankTransfer_Paysafecard := IF(@pc_BG_EUR IS NULL, NULL, IFNULL(@cch_BG_EUR_BankTransfer_Paysafecard, 2049300000000500021));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BG_EUR_BankTransfer_Paysafecard, @pc_BG_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BG_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BG_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BG_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_BG_EUR_BankTransfer_Paysafecard := IF(@pc_BG_EUR IS NULL OR @cch_BG_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_BG_EUR_BankTransfer_Paysafecard, 2049300000000600021));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BG_EUR_BankTransfer_Paysafecard, @pc_BG_EUR, @cch_BG_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BG_EUR IS NOT NULL AND @cch_BG_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BH_BHD_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BH_BHD AND `channel_code` = 'Card_CreditCard' LIMIT 1);
SET @cch_BH_BHD_Card_CreditCard := IF(@pc_BH_BHD IS NULL, NULL, IFNULL(@cch_BH_BHD_Card_CreditCard, 2049300000000500022));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BH_BHD_Card_CreditCard, @pc_BH_BHD, 'Card_CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BH_BHD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BH_BHD_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BH_BHD AND `channel_code` = 'Card_CreditCard' AND `factory_code` = @factory_code AND `factory_channel` = 'CreditCard' LIMIT 1);
SET @dt_BH_BHD_Card_CreditCard := IF(@pc_BH_BHD IS NULL OR @cch_BH_BHD_Card_CreditCard IS NULL, NULL, IFNULL(@dt_BH_BHD_Card_CreditCard, 2049300000000600022));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BH_BHD_Card_CreditCard, @pc_BH_BHD, @cch_BH_BHD_Card_CreditCard, 'Card_CreditCard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BH_BHD IS NOT NULL AND @cch_BH_BHD_Card_CreditCard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BH_BHD_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BH_BHD AND `channel_code` = 'Ewallet_ApplePay' LIMIT 1);
SET @cch_BH_BHD_Ewallet_ApplePay := IF(@pc_BH_BHD IS NULL, NULL, IFNULL(@cch_BH_BHD_Ewallet_ApplePay, 2049300000000500023));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BH_BHD_Ewallet_ApplePay, @pc_BH_BHD, 'Ewallet_ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BH_BHD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BH_BHD_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BH_BHD AND `channel_code` = 'Ewallet_ApplePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ApplePay' LIMIT 1);
SET @dt_BH_BHD_Ewallet_ApplePay := IF(@pc_BH_BHD IS NULL OR @cch_BH_BHD_Ewallet_ApplePay IS NULL, NULL, IFNULL(@dt_BH_BHD_Ewallet_ApplePay, 2049300000000600023));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BH_BHD_Ewallet_ApplePay, @pc_BH_BHD, @cch_BH_BHD_Ewallet_ApplePay, 'Ewallet_ApplePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BH_BHD IS NOT NULL AND @cch_BH_BHD_Ewallet_ApplePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BR_BRL_QR_PIX := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BR_BRL AND `channel_code` = 'QR_PIX' LIMIT 1);
SET @cch_BR_BRL_QR_PIX := IF(@pc_BR_BRL IS NULL, NULL, IFNULL(@cch_BR_BRL_QR_PIX, 2049300000000500024));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BR_BRL_QR_PIX, @pc_BR_BRL, 'QR_PIX', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BR_BRL IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BR_BRL_QR_PIX := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BR_BRL AND `channel_code` = 'QR_PIX' AND `factory_code` = @factory_code AND `factory_channel` = 'PIX' LIMIT 1);
SET @dt_BR_BRL_QR_PIX := IF(@pc_BR_BRL IS NULL OR @cch_BR_BRL_QR_PIX IS NULL, NULL, IFNULL(@dt_BR_BRL_QR_PIX, 2049300000000600024));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BR_BRL_QR_PIX, @pc_BR_BRL, @cch_BR_BRL_QR_PIX, 'QR_PIX', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'PIX', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BR_BRL IS NOT NULL AND @cch_BR_BRL_QR_PIX IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BR_BRL_OTC_BOLETO := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BR_BRL AND `channel_code` = 'OTC_BOLETO' LIMIT 1);
SET @cch_BR_BRL_OTC_BOLETO := IF(@pc_BR_BRL IS NULL, NULL, IFNULL(@cch_BR_BRL_OTC_BOLETO, 2049300000000500025));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BR_BRL_OTC_BOLETO, @pc_BR_BRL, 'OTC_BOLETO', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BR_BRL IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BR_BRL_OTC_BOLETO := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BR_BRL AND `channel_code` = 'OTC_BOLETO' AND `factory_code` = @factory_code AND `factory_channel` = 'BOLETO' LIMIT 1);
SET @dt_BR_BRL_OTC_BOLETO := IF(@pc_BR_BRL IS NULL OR @cch_BR_BRL_OTC_BOLETO IS NULL, NULL, IFNULL(@dt_BR_BRL_OTC_BOLETO, 2049300000000600025));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BR_BRL_OTC_BOLETO, @pc_BR_BRL, @cch_BR_BRL_OTC_BOLETO, 'OTC_BOLETO', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'BOLETO', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BR_BRL IS NOT NULL AND @cch_BR_BRL_OTC_BOLETO IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BR_BRL_Ewallet_PicPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BR_BRL AND `channel_code` = 'Ewallet_PicPay' LIMIT 1);
SET @cch_BR_BRL_Ewallet_PicPay := IF(@pc_BR_BRL IS NULL, NULL, IFNULL(@cch_BR_BRL_Ewallet_PicPay, 2049300000000500026));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BR_BRL_Ewallet_PicPay, @pc_BR_BRL, 'Ewallet_PicPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BR_BRL IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BR_BRL_Ewallet_PicPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BR_BRL AND `channel_code` = 'Ewallet_PicPay' AND `factory_code` = @factory_code AND `factory_channel` = 'PicPay' LIMIT 1);
SET @dt_BR_BRL_Ewallet_PicPay := IF(@pc_BR_BRL IS NULL OR @cch_BR_BRL_Ewallet_PicPay IS NULL, NULL, IFNULL(@dt_BR_BRL_Ewallet_PicPay, 2049300000000600026));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BR_BRL_Ewallet_PicPay, @pc_BR_BRL, @cch_BR_BRL_Ewallet_PicPay, 'Ewallet_PicPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'PicPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BR_BRL IS NOT NULL AND @cch_BR_BRL_Ewallet_PicPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_BR_BRL_Ewallet_Mercadopago := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_BR_BRL AND `channel_code` = 'Ewallet_Mercadopago' LIMIT 1);
SET @cch_BR_BRL_Ewallet_Mercadopago := IF(@pc_BR_BRL IS NULL, NULL, IFNULL(@cch_BR_BRL_Ewallet_Mercadopago, 2049300000000500027));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_BR_BRL_Ewallet_Mercadopago, @pc_BR_BRL, 'Ewallet_Mercadopago', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BR_BRL IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_BR_BRL_Ewallet_Mercadopago := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_BR_BRL AND `channel_code` = 'Ewallet_Mercadopago' AND `factory_code` = @factory_code AND `factory_channel` = 'Mercadopago' LIMIT 1);
SET @dt_BR_BRL_Ewallet_Mercadopago := IF(@pc_BR_BRL IS NULL OR @cch_BR_BRL_Ewallet_Mercadopago IS NULL, NULL, IFNULL(@dt_BR_BRL_Ewallet_Mercadopago, 2049300000000600027));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_BR_BRL_Ewallet_Mercadopago, @pc_BR_BRL, @cch_BR_BRL_Ewallet_Mercadopago, 'Ewallet_Mercadopago', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Mercadopago', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_BR_BRL IS NOT NULL AND @cch_BR_BRL_Ewallet_Mercadopago IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CL_CLP_Ewallet_Webpay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CL_CLP AND `channel_code` = 'Ewallet_Webpay' LIMIT 1);
SET @cch_CL_CLP_Ewallet_Webpay := IF(@pc_CL_CLP IS NULL, NULL, IFNULL(@cch_CL_CLP_Ewallet_Webpay, 2049300000000500028));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CL_CLP_Ewallet_Webpay, @pc_CL_CLP, 'Ewallet_Webpay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CL_CLP_Ewallet_Webpay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CL_CLP AND `channel_code` = 'Ewallet_Webpay' AND `factory_code` = @factory_code AND `factory_channel` = 'Webpay' LIMIT 1);
SET @dt_CL_CLP_Ewallet_Webpay := IF(@pc_CL_CLP IS NULL OR @cch_CL_CLP_Ewallet_Webpay IS NULL, NULL, IFNULL(@dt_CL_CLP_Ewallet_Webpay, 2049300000000600028));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CL_CLP_Ewallet_Webpay, @pc_CL_CLP, @cch_CL_CLP_Ewallet_Webpay, 'Ewallet_Webpay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Webpay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL AND @cch_CL_CLP_Ewallet_Webpay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CL_CLP_BankTransfer_Khipu := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CL_CLP AND `channel_code` = 'BankTransfer_Khipu' LIMIT 1);
SET @cch_CL_CLP_BankTransfer_Khipu := IF(@pc_CL_CLP IS NULL, NULL, IFNULL(@cch_CL_CLP_BankTransfer_Khipu, 2049300000000500029));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CL_CLP_BankTransfer_Khipu, @pc_CL_CLP, 'BankTransfer_Khipu', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CL_CLP_BankTransfer_Khipu := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CL_CLP AND `channel_code` = 'BankTransfer_Khipu' AND `factory_code` = @factory_code AND `factory_channel` = 'Khipu' LIMIT 1);
SET @dt_CL_CLP_BankTransfer_Khipu := IF(@pc_CL_CLP IS NULL OR @cch_CL_CLP_BankTransfer_Khipu IS NULL, NULL, IFNULL(@dt_CL_CLP_BankTransfer_Khipu, 2049300000000600029));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CL_CLP_BankTransfer_Khipu, @pc_CL_CLP, @cch_CL_CLP_BankTransfer_Khipu, 'BankTransfer_Khipu', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Khipu', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL AND @cch_CL_CLP_BankTransfer_Khipu IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CL_CLP_BankTransfer_CL_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CL_CLP AND `channel_code` = 'BankTransfer_CL_BankTransfer' LIMIT 1);
SET @cch_CL_CLP_BankTransfer_CL_BankTransfer := IF(@pc_CL_CLP IS NULL, NULL, IFNULL(@cch_CL_CLP_BankTransfer_CL_BankTransfer, 2049300000000500030));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CL_CLP_BankTransfer_CL_BankTransfer, @pc_CL_CLP, 'BankTransfer_CL_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CL_CLP_BankTransfer_CL_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CL_CLP AND `channel_code` = 'BankTransfer_CL_BankTransfer' AND `factory_code` = @factory_code AND `factory_channel` = 'CL_BankTransfer' LIMIT 1);
SET @dt_CL_CLP_BankTransfer_CL_BankTransfer := IF(@pc_CL_CLP IS NULL OR @cch_CL_CLP_BankTransfer_CL_BankTransfer IS NULL, NULL, IFNULL(@dt_CL_CLP_BankTransfer_CL_BankTransfer, 2049300000000600030));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CL_CLP_BankTransfer_CL_BankTransfer, @pc_CL_CLP, @cch_CL_CLP_BankTransfer_CL_BankTransfer, 'BankTransfer_CL_BankTransfer', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'CL_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL AND @cch_CL_CLP_BankTransfer_CL_BankTransfer IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CL_CLP_Ewallet_Mach := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CL_CLP AND `channel_code` = 'Ewallet_Mach' LIMIT 1);
SET @cch_CL_CLP_Ewallet_Mach := IF(@pc_CL_CLP IS NULL, NULL, IFNULL(@cch_CL_CLP_Ewallet_Mach, 2049300000000500031));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CL_CLP_Ewallet_Mach, @pc_CL_CLP, 'Ewallet_Mach', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CL_CLP_Ewallet_Mach := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CL_CLP AND `channel_code` = 'Ewallet_Mach' AND `factory_code` = @factory_code AND `factory_channel` = 'Mach' LIMIT 1);
SET @dt_CL_CLP_Ewallet_Mach := IF(@pc_CL_CLP IS NULL OR @cch_CL_CLP_Ewallet_Mach IS NULL, NULL, IFNULL(@dt_CL_CLP_Ewallet_Mach, 2049300000000600031));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CL_CLP_Ewallet_Mach, @pc_CL_CLP, @cch_CL_CLP_Ewallet_Mach, 'Ewallet_Mach', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Mach', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL AND @cch_CL_CLP_Ewallet_Mach IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CL_CLP_OnlineBanking_CL_eBank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CL_CLP AND `channel_code` = 'OnlineBanking_CL_eBank' LIMIT 1);
SET @cch_CL_CLP_OnlineBanking_CL_eBank := IF(@pc_CL_CLP IS NULL, NULL, IFNULL(@cch_CL_CLP_OnlineBanking_CL_eBank, 2049300000000500032));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CL_CLP_OnlineBanking_CL_eBank, @pc_CL_CLP, 'OnlineBanking_CL_eBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CL_CLP_OnlineBanking_CL_eBank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CL_CLP AND `channel_code` = 'OnlineBanking_CL_eBank' AND `factory_code` = @factory_code AND `factory_channel` = 'CL_eBank' LIMIT 1);
SET @dt_CL_CLP_OnlineBanking_CL_eBank := IF(@pc_CL_CLP IS NULL OR @cch_CL_CLP_OnlineBanking_CL_eBank IS NULL, NULL, IFNULL(@dt_CL_CLP_OnlineBanking_CL_eBank, 2049300000000600032));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CL_CLP_OnlineBanking_CL_eBank, @pc_CL_CLP, @cch_CL_CLP_OnlineBanking_CL_eBank, 'OnlineBanking_CL_eBank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'CL_eBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CL_CLP IS NOT NULL AND @cch_CL_CLP_OnlineBanking_CL_eBank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CN_CNY_QR_AlipayScanPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CN_CNY AND `channel_code` = 'QR_AlipayScanPay' LIMIT 1);
SET @cch_CN_CNY_QR_AlipayScanPay := IF(@pc_CN_CNY IS NULL, NULL, IFNULL(@cch_CN_CNY_QR_AlipayScanPay, 2049300000000500033));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CN_CNY_QR_AlipayScanPay, @pc_CN_CNY, 'QR_AlipayScanPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CN_CNY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CN_CNY_QR_AlipayScanPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CN_CNY AND `channel_code` = 'QR_AlipayScanPay' AND `factory_code` = @factory_code AND `factory_channel` = 'AlipayScanPay' LIMIT 1);
SET @dt_CN_CNY_QR_AlipayScanPay := IF(@pc_CN_CNY IS NULL OR @cch_CN_CNY_QR_AlipayScanPay IS NULL, NULL, IFNULL(@dt_CN_CNY_QR_AlipayScanPay, 2049300000000600033));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CN_CNY_QR_AlipayScanPay, @pc_CN_CNY, @cch_CN_CNY_QR_AlipayScanPay, 'QR_AlipayScanPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'AlipayScanPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CN_CNY IS NOT NULL AND @cch_CN_CNY_QR_AlipayScanPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CN_CNY_QR_WeChatScanPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CN_CNY AND `channel_code` = 'QR_WeChatScanPay' LIMIT 1);
SET @cch_CN_CNY_QR_WeChatScanPay := IF(@pc_CN_CNY IS NULL, NULL, IFNULL(@cch_CN_CNY_QR_WeChatScanPay, 2049300000000500034));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CN_CNY_QR_WeChatScanPay, @pc_CN_CNY, 'QR_WeChatScanPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CN_CNY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CN_CNY_QR_WeChatScanPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CN_CNY AND `channel_code` = 'QR_WeChatScanPay' AND `factory_code` = @factory_code AND `factory_channel` = 'WeChatScanPay' LIMIT 1);
SET @dt_CN_CNY_QR_WeChatScanPay := IF(@pc_CN_CNY IS NULL OR @cch_CN_CNY_QR_WeChatScanPay IS NULL, NULL, IFNULL(@dt_CN_CNY_QR_WeChatScanPay, 2049300000000600034));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CN_CNY_QR_WeChatScanPay, @pc_CN_CNY, @cch_CN_CNY_QR_WeChatScanPay, 'QR_WeChatScanPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'WeChatScanPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CN_CNY IS NOT NULL AND @cch_CN_CNY_QR_WeChatScanPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CN_CNY_Ewallet_AlipayH5 := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CN_CNY AND `channel_code` = 'Ewallet_AlipayH5' LIMIT 1);
SET @cch_CN_CNY_Ewallet_AlipayH5 := IF(@pc_CN_CNY IS NULL, NULL, IFNULL(@cch_CN_CNY_Ewallet_AlipayH5, 2049300000000500035));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CN_CNY_Ewallet_AlipayH5, @pc_CN_CNY, 'Ewallet_AlipayH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CN_CNY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CN_CNY_Ewallet_AlipayH5 := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CN_CNY AND `channel_code` = 'Ewallet_AlipayH5' AND `factory_code` = @factory_code AND `factory_channel` = 'AlipayH5' LIMIT 1);
SET @dt_CN_CNY_Ewallet_AlipayH5 := IF(@pc_CN_CNY IS NULL OR @cch_CN_CNY_Ewallet_AlipayH5 IS NULL, NULL, IFNULL(@dt_CN_CNY_Ewallet_AlipayH5, 2049300000000600035));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CN_CNY_Ewallet_AlipayH5, @pc_CN_CNY, @cch_CN_CNY_Ewallet_AlipayH5, 'Ewallet_AlipayH5', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'AlipayH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CN_CNY IS NOT NULL AND @cch_CN_CNY_Ewallet_AlipayH5 IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CN_CNY_Ewallet_WeChatH5 := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CN_CNY AND `channel_code` = 'Ewallet_WeChatH5' LIMIT 1);
SET @cch_CN_CNY_Ewallet_WeChatH5 := IF(@pc_CN_CNY IS NULL, NULL, IFNULL(@cch_CN_CNY_Ewallet_WeChatH5, 2049300000000500036));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CN_CNY_Ewallet_WeChatH5, @pc_CN_CNY, 'Ewallet_WeChatH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CN_CNY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CN_CNY_Ewallet_WeChatH5 := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CN_CNY AND `channel_code` = 'Ewallet_WeChatH5' AND `factory_code` = @factory_code AND `factory_channel` = 'WeChatH5' LIMIT 1);
SET @dt_CN_CNY_Ewallet_WeChatH5 := IF(@pc_CN_CNY IS NULL OR @cch_CN_CNY_Ewallet_WeChatH5 IS NULL, NULL, IFNULL(@dt_CN_CNY_Ewallet_WeChatH5, 2049300000000600036));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CN_CNY_Ewallet_WeChatH5, @pc_CN_CNY, @cch_CN_CNY_Ewallet_WeChatH5, 'Ewallet_WeChatH5', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'WeChatH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CN_CNY IS NOT NULL AND @cch_CN_CNY_Ewallet_WeChatH5 IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CO_COP_BankTransfer_PSE := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'BankTransfer_PSE' LIMIT 1);
SET @cch_CO_COP_BankTransfer_PSE := IF(@pc_CO_COP IS NULL, NULL, IFNULL(@cch_CO_COP_BankTransfer_PSE, 2049300000000500037));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CO_COP_BankTransfer_PSE, @pc_CO_COP, 'BankTransfer_PSE', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CO_COP_BankTransfer_PSE := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'BankTransfer_PSE' AND `factory_code` = @factory_code AND `factory_channel` = 'PSE' LIMIT 1);
SET @dt_CO_COP_BankTransfer_PSE := IF(@pc_CO_COP IS NULL OR @cch_CO_COP_BankTransfer_PSE IS NULL, NULL, IFNULL(@dt_CO_COP_BankTransfer_PSE, 2049300000000600037));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CO_COP_BankTransfer_PSE, @pc_CO_COP, @cch_CO_COP_BankTransfer_PSE, 'BankTransfer_PSE', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'PSE', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL AND @cch_CO_COP_BankTransfer_PSE IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CO_COP_BankTransfer_Transfiya := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'BankTransfer_Transfiya' LIMIT 1);
SET @cch_CO_COP_BankTransfer_Transfiya := IF(@pc_CO_COP IS NULL, NULL, IFNULL(@cch_CO_COP_BankTransfer_Transfiya, 2049300000000500038));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CO_COP_BankTransfer_Transfiya, @pc_CO_COP, 'BankTransfer_Transfiya', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CO_COP_BankTransfer_Transfiya := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'BankTransfer_Transfiya' AND `factory_code` = @factory_code AND `factory_channel` = 'Transfiya' LIMIT 1);
SET @dt_CO_COP_BankTransfer_Transfiya := IF(@pc_CO_COP IS NULL OR @cch_CO_COP_BankTransfer_Transfiya IS NULL, NULL, IFNULL(@dt_CO_COP_BankTransfer_Transfiya, 2049300000000600038));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CO_COP_BankTransfer_Transfiya, @pc_CO_COP, @cch_CO_COP_BankTransfer_Transfiya, 'BankTransfer_Transfiya', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Transfiya', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL AND @cch_CO_COP_BankTransfer_Transfiya IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CO_COP_Ewallet_Efecty := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'Ewallet_Efecty' LIMIT 1);
SET @cch_CO_COP_Ewallet_Efecty := IF(@pc_CO_COP IS NULL, NULL, IFNULL(@cch_CO_COP_Ewallet_Efecty, 2049300000000500039));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CO_COP_Ewallet_Efecty, @pc_CO_COP, 'Ewallet_Efecty', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CO_COP_Ewallet_Efecty := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'Ewallet_Efecty' AND `factory_code` = @factory_code AND `factory_channel` = 'Efecty' LIMIT 1);
SET @dt_CO_COP_Ewallet_Efecty := IF(@pc_CO_COP IS NULL OR @cch_CO_COP_Ewallet_Efecty IS NULL, NULL, IFNULL(@dt_CO_COP_Ewallet_Efecty, 2049300000000600039));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CO_COP_Ewallet_Efecty, @pc_CO_COP, @cch_CO_COP_Ewallet_Efecty, 'Ewallet_Efecty', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Efecty', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL AND @cch_CO_COP_Ewallet_Efecty IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CO_COP_Ewallet_TPaga := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'Ewallet_TPaga' LIMIT 1);
SET @cch_CO_COP_Ewallet_TPaga := IF(@pc_CO_COP IS NULL, NULL, IFNULL(@cch_CO_COP_Ewallet_TPaga, 2049300000000500040));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CO_COP_Ewallet_TPaga, @pc_CO_COP, 'Ewallet_TPaga', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CO_COP_Ewallet_TPaga := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'Ewallet_TPaga' AND `factory_code` = @factory_code AND `factory_channel` = 'TPaga' LIMIT 1);
SET @dt_CO_COP_Ewallet_TPaga := IF(@pc_CO_COP IS NULL OR @cch_CO_COP_Ewallet_TPaga IS NULL, NULL, IFNULL(@dt_CO_COP_Ewallet_TPaga, 2049300000000600040));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CO_COP_Ewallet_TPaga, @pc_CO_COP, @cch_CO_COP_Ewallet_TPaga, 'Ewallet_TPaga', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'TPaga', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL AND @cch_CO_COP_Ewallet_TPaga IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CO_COP_Ewallet_Nequi := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'Ewallet_Nequi' LIMIT 1);
SET @cch_CO_COP_Ewallet_Nequi := IF(@pc_CO_COP IS NULL, NULL, IFNULL(@cch_CO_COP_Ewallet_Nequi, 2049300000000500041));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CO_COP_Ewallet_Nequi, @pc_CO_COP, 'Ewallet_Nequi', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CO_COP_Ewallet_Nequi := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'Ewallet_Nequi' AND `factory_code` = @factory_code AND `factory_channel` = 'Nequi' LIMIT 1);
SET @dt_CO_COP_Ewallet_Nequi := IF(@pc_CO_COP IS NULL OR @cch_CO_COP_Ewallet_Nequi IS NULL, NULL, IFNULL(@dt_CO_COP_Ewallet_Nequi, 2049300000000600041));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CO_COP_Ewallet_Nequi, @pc_CO_COP, @cch_CO_COP_Ewallet_Nequi, 'Ewallet_Nequi', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'Nequi', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL AND @cch_CO_COP_Ewallet_Nequi IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CO_COP_BankTransfer_CO_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'BankTransfer_CO_BankTransfer' LIMIT 1);
SET @cch_CO_COP_BankTransfer_CO_BankTransfer := IF(@pc_CO_COP IS NULL, NULL, IFNULL(@cch_CO_COP_BankTransfer_CO_BankTransfer, 2049300000000500042));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CO_COP_BankTransfer_CO_BankTransfer, @pc_CO_COP, 'BankTransfer_CO_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CO_COP_BankTransfer_CO_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'BankTransfer_CO_BankTransfer' AND `factory_code` = @factory_code AND `factory_channel` = 'CO_BankTransfer' LIMIT 1);
SET @dt_CO_COP_BankTransfer_CO_BankTransfer := IF(@pc_CO_COP IS NULL OR @cch_CO_COP_BankTransfer_CO_BankTransfer IS NULL, NULL, IFNULL(@dt_CO_COP_BankTransfer_CO_BankTransfer, 2049300000000600042));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CO_COP_BankTransfer_CO_BankTransfer, @pc_CO_COP, @cch_CO_COP_BankTransfer_CO_BankTransfer, 'BankTransfer_CO_BankTransfer', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'CO_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL AND @cch_CO_COP_BankTransfer_CO_BankTransfer IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CO_COP_OnlineBanking_CO_eBank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'OnlineBanking_CO_eBank' LIMIT 1);
SET @cch_CO_COP_OnlineBanking_CO_eBank := IF(@pc_CO_COP IS NULL, NULL, IFNULL(@cch_CO_COP_OnlineBanking_CO_eBank, 2049300000000500043));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CO_COP_OnlineBanking_CO_eBank, @pc_CO_COP, 'OnlineBanking_CO_eBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CO_COP_OnlineBanking_CO_eBank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CO_COP AND `channel_code` = 'OnlineBanking_CO_eBank' AND `factory_code` = @factory_code AND `factory_channel` = 'CO_eBank' LIMIT 1);
SET @dt_CO_COP_OnlineBanking_CO_eBank := IF(@pc_CO_COP IS NULL OR @cch_CO_COP_OnlineBanking_CO_eBank IS NULL, NULL, IFNULL(@dt_CO_COP_OnlineBanking_CO_eBank, 2049300000000600043));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CO_COP_OnlineBanking_CO_eBank, @pc_CO_COP, @cch_CO_COP_OnlineBanking_CO_eBank, 'OnlineBanking_CO_eBank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 70, 'CO_eBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CO_COP IS NOT NULL AND @cch_CO_COP_OnlineBanking_CO_eBank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CY_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CY_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_CY_EUR_BankTransfer_Satispay := IF(@pc_CY_EUR IS NULL, NULL, IFNULL(@cch_CY_EUR_BankTransfer_Satispay, 2049300000000500044));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CY_EUR_BankTransfer_Satispay, @pc_CY_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CY_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CY_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CY_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_CY_EUR_BankTransfer_Satispay := IF(@pc_CY_EUR IS NULL OR @cch_CY_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_CY_EUR_BankTransfer_Satispay, 2049300000000600044));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CY_EUR_BankTransfer_Satispay, @pc_CY_EUR, @cch_CY_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CY_EUR IS NOT NULL AND @cch_CY_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CY_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CY_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_CY_EUR_BankTransfer_SEPA := IF(@pc_CY_EUR IS NULL, NULL, IFNULL(@cch_CY_EUR_BankTransfer_SEPA, 2049300000000500045));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CY_EUR_BankTransfer_SEPA, @pc_CY_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CY_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CY_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CY_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_CY_EUR_BankTransfer_SEPA := IF(@pc_CY_EUR IS NULL OR @cch_CY_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_CY_EUR_BankTransfer_SEPA, 2049300000000600045));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CY_EUR_BankTransfer_SEPA, @pc_CY_EUR, @cch_CY_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CY_EUR IS NOT NULL AND @cch_CY_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CY_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CY_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_CY_EUR_BankTransfer_Paysafecard := IF(@pc_CY_EUR IS NULL, NULL, IFNULL(@cch_CY_EUR_BankTransfer_Paysafecard, 2049300000000500046));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CY_EUR_BankTransfer_Paysafecard, @pc_CY_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CY_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CY_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CY_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_CY_EUR_BankTransfer_Paysafecard := IF(@pc_CY_EUR IS NULL OR @cch_CY_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_CY_EUR_BankTransfer_Paysafecard, 2049300000000600046));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CY_EUR_BankTransfer_Paysafecard, @pc_CY_EUR, @cch_CY_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CY_EUR IS NOT NULL AND @cch_CY_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_CZ_CZK_BankTransfer_PayU := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_CZ_CZK AND `channel_code` = 'BankTransfer_PayU' LIMIT 1);
SET @cch_CZ_CZK_BankTransfer_PayU := IF(@pc_CZ_CZK IS NULL, NULL, IFNULL(@cch_CZ_CZK_BankTransfer_PayU, 2049300000000500047));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_CZ_CZK_BankTransfer_PayU, @pc_CZ_CZK, 'BankTransfer_PayU', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CZ_CZK IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_CZ_CZK_BankTransfer_PayU := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_CZ_CZK AND `channel_code` = 'BankTransfer_PayU' AND `factory_code` = @factory_code AND `factory_channel` = 'PayU' LIMIT 1);
SET @dt_CZ_CZK_BankTransfer_PayU := IF(@pc_CZ_CZK IS NULL OR @cch_CZ_CZK_BankTransfer_PayU IS NULL, NULL, IFNULL(@dt_CZ_CZK_BankTransfer_PayU, 2049300000000600047));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_CZ_CZK_BankTransfer_PayU, @pc_CZ_CZK, @cch_CZ_CZK_BankTransfer_PayU, 'BankTransfer_PayU', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'PayU', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_CZ_CZK IS NOT NULL AND @cch_CZ_CZK_BankTransfer_PayU IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_DE_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_DE_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_DE_EUR_BankTransfer_Trustly := IF(@pc_DE_EUR IS NULL, NULL, IFNULL(@cch_DE_EUR_BankTransfer_Trustly, 2049300000000500048));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_DE_EUR_BankTransfer_Trustly, @pc_DE_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_DE_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_DE_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_DE_EUR_BankTransfer_Trustly := IF(@pc_DE_EUR IS NULL OR @cch_DE_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_DE_EUR_BankTransfer_Trustly, 2049300000000600048));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_DE_EUR_BankTransfer_Trustly, @pc_DE_EUR, @cch_DE_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DE_EUR IS NOT NULL AND @cch_DE_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_DE_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_DE_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_DE_EUR_BankTransfer_Satispay := IF(@pc_DE_EUR IS NULL, NULL, IFNULL(@cch_DE_EUR_BankTransfer_Satispay, 2049300000000500049));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_DE_EUR_BankTransfer_Satispay, @pc_DE_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_DE_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_DE_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_DE_EUR_BankTransfer_Satispay := IF(@pc_DE_EUR IS NULL OR @cch_DE_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_DE_EUR_BankTransfer_Satispay, 2049300000000600049));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_DE_EUR_BankTransfer_Satispay, @pc_DE_EUR, @cch_DE_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DE_EUR IS NOT NULL AND @cch_DE_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_DE_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_DE_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_DE_EUR_BankTransfer_SEPA := IF(@pc_DE_EUR IS NULL, NULL, IFNULL(@cch_DE_EUR_BankTransfer_SEPA, 2049300000000500050));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_DE_EUR_BankTransfer_SEPA, @pc_DE_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_DE_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_DE_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_DE_EUR_BankTransfer_SEPA := IF(@pc_DE_EUR IS NULL OR @cch_DE_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_DE_EUR_BankTransfer_SEPA, 2049300000000600050));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_DE_EUR_BankTransfer_SEPA, @pc_DE_EUR, @cch_DE_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DE_EUR IS NOT NULL AND @cch_DE_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_DE_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_DE_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_DE_EUR_BankTransfer_Paysafecard := IF(@pc_DE_EUR IS NULL, NULL, IFNULL(@cch_DE_EUR_BankTransfer_Paysafecard, 2049300000000500051));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_DE_EUR_BankTransfer_Paysafecard, @pc_DE_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_DE_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_DE_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_DE_EUR_BankTransfer_Paysafecard := IF(@pc_DE_EUR IS NULL OR @cch_DE_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_DE_EUR_BankTransfer_Paysafecard, 2049300000000600051));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_DE_EUR_BankTransfer_Paysafecard, @pc_DE_EUR, @cch_DE_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DE_EUR IS NOT NULL AND @cch_DE_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_DK_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_DK_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_DK_EUR_BankTransfer_Trustly := IF(@pc_DK_EUR IS NULL, NULL, IFNULL(@cch_DK_EUR_BankTransfer_Trustly, 2049300000000500052));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_DK_EUR_BankTransfer_Trustly, @pc_DK_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DK_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_DK_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_DK_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_DK_EUR_BankTransfer_Trustly := IF(@pc_DK_EUR IS NULL OR @cch_DK_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_DK_EUR_BankTransfer_Trustly, 2049300000000600052));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_DK_EUR_BankTransfer_Trustly, @pc_DK_EUR, @cch_DK_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DK_EUR IS NOT NULL AND @cch_DK_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_DK_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_DK_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_DK_EUR_BankTransfer_Satispay := IF(@pc_DK_EUR IS NULL, NULL, IFNULL(@cch_DK_EUR_BankTransfer_Satispay, 2049300000000500053));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_DK_EUR_BankTransfer_Satispay, @pc_DK_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DK_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_DK_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_DK_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_DK_EUR_BankTransfer_Satispay := IF(@pc_DK_EUR IS NULL OR @cch_DK_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_DK_EUR_BankTransfer_Satispay, 2049300000000600053));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_DK_EUR_BankTransfer_Satispay, @pc_DK_EUR, @cch_DK_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DK_EUR IS NOT NULL AND @cch_DK_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_DK_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_DK_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_DK_EUR_BankTransfer_SEPA := IF(@pc_DK_EUR IS NULL, NULL, IFNULL(@cch_DK_EUR_BankTransfer_SEPA, 2049300000000500054));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_DK_EUR_BankTransfer_SEPA, @pc_DK_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DK_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_DK_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_DK_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_DK_EUR_BankTransfer_SEPA := IF(@pc_DK_EUR IS NULL OR @cch_DK_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_DK_EUR_BankTransfer_SEPA, 2049300000000600054));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_DK_EUR_BankTransfer_SEPA, @pc_DK_EUR, @cch_DK_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DK_EUR IS NOT NULL AND @cch_DK_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_DK_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_DK_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_DK_EUR_BankTransfer_Paysafecard := IF(@pc_DK_EUR IS NULL, NULL, IFNULL(@cch_DK_EUR_BankTransfer_Paysafecard, 2049300000000500055));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_DK_EUR_BankTransfer_Paysafecard, @pc_DK_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DK_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_DK_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_DK_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_DK_EUR_BankTransfer_Paysafecard := IF(@pc_DK_EUR IS NULL OR @cch_DK_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_DK_EUR_BankTransfer_Paysafecard, 2049300000000600055));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_DK_EUR_BankTransfer_Paysafecard, @pc_DK_EUR, @cch_DK_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_DK_EUR IS NOT NULL AND @cch_DK_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EC_USD_BankTransfer_EC_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EC_USD AND `channel_code` = 'BankTransfer_EC_BankTransfer' LIMIT 1);
SET @cch_EC_USD_BankTransfer_EC_BankTransfer := IF(@pc_EC_USD IS NULL, NULL, IFNULL(@cch_EC_USD_BankTransfer_EC_BankTransfer, 2049300000000500056));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EC_USD_BankTransfer_EC_BankTransfer, @pc_EC_USD, 'BankTransfer_EC_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EC_USD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EC_USD_BankTransfer_EC_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EC_USD AND `channel_code` = 'BankTransfer_EC_BankTransfer' AND `factory_code` = @factory_code AND `factory_channel` = 'EC_BankTransfer' LIMIT 1);
SET @dt_EC_USD_BankTransfer_EC_BankTransfer := IF(@pc_EC_USD IS NULL OR @cch_EC_USD_BankTransfer_EC_BankTransfer IS NULL, NULL, IFNULL(@dt_EC_USD_BankTransfer_EC_BankTransfer, 2049300000000600056));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EC_USD_BankTransfer_EC_BankTransfer, @pc_EC_USD, @cch_EC_USD_BankTransfer_EC_BankTransfer, 'BankTransfer_EC_BankTransfer', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'EC_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EC_USD IS NOT NULL AND @cch_EC_USD_BankTransfer_EC_BankTransfer IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EC_USD_OTC_Cash := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EC_USD AND `channel_code` = 'OTC_Cash' LIMIT 1);
SET @cch_EC_USD_OTC_Cash := IF(@pc_EC_USD IS NULL, NULL, IFNULL(@cch_EC_USD_OTC_Cash, 2049300000000500057));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EC_USD_OTC_Cash, @pc_EC_USD, 'OTC_Cash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EC_USD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EC_USD_OTC_Cash := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EC_USD AND `channel_code` = 'OTC_Cash' AND `factory_code` = @factory_code AND `factory_channel` = 'Cash' LIMIT 1);
SET @dt_EC_USD_OTC_Cash := IF(@pc_EC_USD IS NULL OR @cch_EC_USD_OTC_Cash IS NULL, NULL, IFNULL(@dt_EC_USD_OTC_Cash, 2049300000000600057));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EC_USD_OTC_Cash, @pc_EC_USD, @cch_EC_USD_OTC_Cash, 'OTC_Cash', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Cash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EC_USD IS NOT NULL AND @cch_EC_USD_OTC_Cash IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EC_USD_OnlineBanking_EC_eBank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EC_USD AND `channel_code` = 'OnlineBanking_EC_eBank' LIMIT 1);
SET @cch_EC_USD_OnlineBanking_EC_eBank := IF(@pc_EC_USD IS NULL, NULL, IFNULL(@cch_EC_USD_OnlineBanking_EC_eBank, 2049300000000500058));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EC_USD_OnlineBanking_EC_eBank, @pc_EC_USD, 'OnlineBanking_EC_eBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EC_USD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EC_USD_OnlineBanking_EC_eBank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EC_USD AND `channel_code` = 'OnlineBanking_EC_eBank' AND `factory_code` = @factory_code AND `factory_channel` = 'EC_eBank' LIMIT 1);
SET @dt_EC_USD_OnlineBanking_EC_eBank := IF(@pc_EC_USD IS NULL OR @cch_EC_USD_OnlineBanking_EC_eBank IS NULL, NULL, IFNULL(@dt_EC_USD_OnlineBanking_EC_eBank, 2049300000000600058));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EC_USD_OnlineBanking_EC_eBank, @pc_EC_USD, @cch_EC_USD_OnlineBanking_EC_eBank, 'OnlineBanking_EC_eBank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'EC_eBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EC_USD IS NOT NULL AND @cch_EC_USD_OnlineBanking_EC_eBank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EE_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EE_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_EE_EUR_BankTransfer_Trustly := IF(@pc_EE_EUR IS NULL, NULL, IFNULL(@cch_EE_EUR_BankTransfer_Trustly, 2049300000000500059));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EE_EUR_BankTransfer_Trustly, @pc_EE_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EE_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EE_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_EE_EUR_BankTransfer_Trustly := IF(@pc_EE_EUR IS NULL OR @cch_EE_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_EE_EUR_BankTransfer_Trustly, 2049300000000600059));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EE_EUR_BankTransfer_Trustly, @pc_EE_EUR, @cch_EE_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EE_EUR IS NOT NULL AND @cch_EE_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EE_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EE_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_EE_EUR_BankTransfer_Satispay := IF(@pc_EE_EUR IS NULL, NULL, IFNULL(@cch_EE_EUR_BankTransfer_Satispay, 2049300000000500060));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EE_EUR_BankTransfer_Satispay, @pc_EE_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EE_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EE_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_EE_EUR_BankTransfer_Satispay := IF(@pc_EE_EUR IS NULL OR @cch_EE_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_EE_EUR_BankTransfer_Satispay, 2049300000000600060));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EE_EUR_BankTransfer_Satispay, @pc_EE_EUR, @cch_EE_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EE_EUR IS NOT NULL AND @cch_EE_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EE_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EE_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_EE_EUR_BankTransfer_SEPA := IF(@pc_EE_EUR IS NULL, NULL, IFNULL(@cch_EE_EUR_BankTransfer_SEPA, 2049300000000500061));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EE_EUR_BankTransfer_SEPA, @pc_EE_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EE_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EE_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_EE_EUR_BankTransfer_SEPA := IF(@pc_EE_EUR IS NULL OR @cch_EE_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_EE_EUR_BankTransfer_SEPA, 2049300000000600061));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EE_EUR_BankTransfer_SEPA, @pc_EE_EUR, @cch_EE_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EE_EUR IS NOT NULL AND @cch_EE_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EE_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EE_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_EE_EUR_BankTransfer_Paysafecard := IF(@pc_EE_EUR IS NULL, NULL, IFNULL(@cch_EE_EUR_BankTransfer_Paysafecard, 2049300000000500062));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EE_EUR_BankTransfer_Paysafecard, @pc_EE_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EE_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EE_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_EE_EUR_BankTransfer_Paysafecard := IF(@pc_EE_EUR IS NULL OR @cch_EE_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_EE_EUR_BankTransfer_Paysafecard, 2049300000000600062));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EE_EUR_BankTransfer_Paysafecard, @pc_EE_EUR, @cch_EE_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EE_EUR IS NOT NULL AND @cch_EE_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EG_EGP_Ewallet_FawryPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EG_EGP AND `channel_code` = 'Ewallet_FawryPay' LIMIT 1);
SET @cch_EG_EGP_Ewallet_FawryPay := IF(@pc_EG_EGP IS NULL, NULL, IFNULL(@cch_EG_EGP_Ewallet_FawryPay, 2049300000000500063));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EG_EGP_Ewallet_FawryPay, @pc_EG_EGP, 'Ewallet_FawryPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EG_EGP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EG_EGP_Ewallet_FawryPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EG_EGP AND `channel_code` = 'Ewallet_FawryPay' AND `factory_code` = @factory_code AND `factory_channel` = 'FawryPay' LIMIT 1);
SET @dt_EG_EGP_Ewallet_FawryPay := IF(@pc_EG_EGP IS NULL OR @cch_EG_EGP_Ewallet_FawryPay IS NULL, NULL, IFNULL(@dt_EG_EGP_Ewallet_FawryPay, 2049300000000600063));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EG_EGP_Ewallet_FawryPay, @pc_EG_EGP, @cch_EG_EGP_Ewallet_FawryPay, 'Ewallet_FawryPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'FawryPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EG_EGP IS NOT NULL AND @cch_EG_EGP_Ewallet_FawryPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EG_EGP_Ewallet_Vodafone := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EG_EGP AND `channel_code` = 'Ewallet_Vodafone' LIMIT 1);
SET @cch_EG_EGP_Ewallet_Vodafone := IF(@pc_EG_EGP IS NULL, NULL, IFNULL(@cch_EG_EGP_Ewallet_Vodafone, 2049300000000500064));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EG_EGP_Ewallet_Vodafone, @pc_EG_EGP, 'Ewallet_Vodafone', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EG_EGP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EG_EGP_Ewallet_Vodafone := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EG_EGP AND `channel_code` = 'Ewallet_Vodafone' AND `factory_code` = @factory_code AND `factory_channel` = 'Vodafone' LIMIT 1);
SET @dt_EG_EGP_Ewallet_Vodafone := IF(@pc_EG_EGP IS NULL OR @cch_EG_EGP_Ewallet_Vodafone IS NULL, NULL, IFNULL(@dt_EG_EGP_Ewallet_Vodafone, 2049300000000600064));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EG_EGP_Ewallet_Vodafone, @pc_EG_EGP, @cch_EG_EGP_Ewallet_Vodafone, 'Ewallet_Vodafone', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Vodafone', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EG_EGP IS NOT NULL AND @cch_EG_EGP_Ewallet_Vodafone IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EG_EGP_Ewallet_Orange := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EG_EGP AND `channel_code` = 'Ewallet_Orange' LIMIT 1);
SET @cch_EG_EGP_Ewallet_Orange := IF(@pc_EG_EGP IS NULL, NULL, IFNULL(@cch_EG_EGP_Ewallet_Orange, 2049300000000500065));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EG_EGP_Ewallet_Orange, @pc_EG_EGP, 'Ewallet_Orange', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EG_EGP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EG_EGP_Ewallet_Orange := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EG_EGP AND `channel_code` = 'Ewallet_Orange' AND `factory_code` = @factory_code AND `factory_channel` = 'Orange' LIMIT 1);
SET @dt_EG_EGP_Ewallet_Orange := IF(@pc_EG_EGP IS NULL OR @cch_EG_EGP_Ewallet_Orange IS NULL, NULL, IFNULL(@dt_EG_EGP_Ewallet_Orange, 2049300000000600065));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EG_EGP_Ewallet_Orange, @pc_EG_EGP, @cch_EG_EGP_Ewallet_Orange, 'Ewallet_Orange', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Orange', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EG_EGP IS NOT NULL AND @cch_EG_EGP_Ewallet_Orange IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_EG_EGP_Ewallet_Meeza := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_EG_EGP AND `channel_code` = 'Ewallet_Meeza' LIMIT 1);
SET @cch_EG_EGP_Ewallet_Meeza := IF(@pc_EG_EGP IS NULL, NULL, IFNULL(@cch_EG_EGP_Ewallet_Meeza, 2049300000000500066));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_EG_EGP_Ewallet_Meeza, @pc_EG_EGP, 'Ewallet_Meeza', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EG_EGP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_EG_EGP_Ewallet_Meeza := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_EG_EGP AND `channel_code` = 'Ewallet_Meeza' AND `factory_code` = @factory_code AND `factory_channel` = 'Meeza' LIMIT 1);
SET @dt_EG_EGP_Ewallet_Meeza := IF(@pc_EG_EGP IS NULL OR @cch_EG_EGP_Ewallet_Meeza IS NULL, NULL, IFNULL(@dt_EG_EGP_Ewallet_Meeza, 2049300000000600066));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_EG_EGP_Ewallet_Meeza, @pc_EG_EGP, @cch_EG_EGP_Ewallet_Meeza, 'Ewallet_Meeza', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Meeza', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_EG_EGP IS NOT NULL AND @cch_EG_EGP_Ewallet_Meeza IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ES_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ES_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_ES_EUR_BankTransfer_Trustly := IF(@pc_ES_EUR IS NULL, NULL, IFNULL(@cch_ES_EUR_BankTransfer_Trustly, 2049300000000500067));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ES_EUR_BankTransfer_Trustly, @pc_ES_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ES_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ES_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ES_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_ES_EUR_BankTransfer_Trustly := IF(@pc_ES_EUR IS NULL OR @cch_ES_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_ES_EUR_BankTransfer_Trustly, 2049300000000600067));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ES_EUR_BankTransfer_Trustly, @pc_ES_EUR, @cch_ES_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ES_EUR IS NOT NULL AND @cch_ES_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ES_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ES_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_ES_EUR_BankTransfer_Satispay := IF(@pc_ES_EUR IS NULL, NULL, IFNULL(@cch_ES_EUR_BankTransfer_Satispay, 2049300000000500068));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ES_EUR_BankTransfer_Satispay, @pc_ES_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ES_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ES_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ES_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_ES_EUR_BankTransfer_Satispay := IF(@pc_ES_EUR IS NULL OR @cch_ES_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_ES_EUR_BankTransfer_Satispay, 2049300000000600068));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ES_EUR_BankTransfer_Satispay, @pc_ES_EUR, @cch_ES_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ES_EUR IS NOT NULL AND @cch_ES_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ES_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ES_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_ES_EUR_BankTransfer_SEPA := IF(@pc_ES_EUR IS NULL, NULL, IFNULL(@cch_ES_EUR_BankTransfer_SEPA, 2049300000000500069));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ES_EUR_BankTransfer_SEPA, @pc_ES_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ES_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ES_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ES_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_ES_EUR_BankTransfer_SEPA := IF(@pc_ES_EUR IS NULL OR @cch_ES_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_ES_EUR_BankTransfer_SEPA, 2049300000000600069));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ES_EUR_BankTransfer_SEPA, @pc_ES_EUR, @cch_ES_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ES_EUR IS NOT NULL AND @cch_ES_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ES_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ES_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_ES_EUR_BankTransfer_Paysafecard := IF(@pc_ES_EUR IS NULL, NULL, IFNULL(@cch_ES_EUR_BankTransfer_Paysafecard, 2049300000000500070));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ES_EUR_BankTransfer_Paysafecard, @pc_ES_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ES_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ES_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ES_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_ES_EUR_BankTransfer_Paysafecard := IF(@pc_ES_EUR IS NULL OR @cch_ES_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_ES_EUR_BankTransfer_Paysafecard, 2049300000000600070));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ES_EUR_BankTransfer_Paysafecard, @pc_ES_EUR, @cch_ES_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ES_EUR IS NOT NULL AND @cch_ES_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_FI_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_FI_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_FI_EUR_BankTransfer_Trustly := IF(@pc_FI_EUR IS NULL, NULL, IFNULL(@cch_FI_EUR_BankTransfer_Trustly, 2049300000000500071));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_FI_EUR_BankTransfer_Trustly, @pc_FI_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_FI_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_FI_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_FI_EUR_BankTransfer_Trustly := IF(@pc_FI_EUR IS NULL OR @cch_FI_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_FI_EUR_BankTransfer_Trustly, 2049300000000600071));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_FI_EUR_BankTransfer_Trustly, @pc_FI_EUR, @cch_FI_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FI_EUR IS NOT NULL AND @cch_FI_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_FI_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_FI_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_FI_EUR_BankTransfer_Satispay := IF(@pc_FI_EUR IS NULL, NULL, IFNULL(@cch_FI_EUR_BankTransfer_Satispay, 2049300000000500072));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_FI_EUR_BankTransfer_Satispay, @pc_FI_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_FI_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_FI_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_FI_EUR_BankTransfer_Satispay := IF(@pc_FI_EUR IS NULL OR @cch_FI_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_FI_EUR_BankTransfer_Satispay, 2049300000000600072));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_FI_EUR_BankTransfer_Satispay, @pc_FI_EUR, @cch_FI_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FI_EUR IS NOT NULL AND @cch_FI_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_FI_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_FI_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_FI_EUR_BankTransfer_SEPA := IF(@pc_FI_EUR IS NULL, NULL, IFNULL(@cch_FI_EUR_BankTransfer_SEPA, 2049300000000500073));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_FI_EUR_BankTransfer_SEPA, @pc_FI_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_FI_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_FI_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_FI_EUR_BankTransfer_SEPA := IF(@pc_FI_EUR IS NULL OR @cch_FI_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_FI_EUR_BankTransfer_SEPA, 2049300000000600073));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_FI_EUR_BankTransfer_SEPA, @pc_FI_EUR, @cch_FI_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FI_EUR IS NOT NULL AND @cch_FI_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_FI_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_FI_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_FI_EUR_BankTransfer_Paysafecard := IF(@pc_FI_EUR IS NULL, NULL, IFNULL(@cch_FI_EUR_BankTransfer_Paysafecard, 2049300000000500074));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_FI_EUR_BankTransfer_Paysafecard, @pc_FI_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_FI_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_FI_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_FI_EUR_BankTransfer_Paysafecard := IF(@pc_FI_EUR IS NULL OR @cch_FI_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_FI_EUR_BankTransfer_Paysafecard, 2049300000000600074));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_FI_EUR_BankTransfer_Paysafecard, @pc_FI_EUR, @cch_FI_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FI_EUR IS NOT NULL AND @cch_FI_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_FR_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_FR_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_FR_EUR_BankTransfer_Satispay := IF(@pc_FR_EUR IS NULL, NULL, IFNULL(@cch_FR_EUR_BankTransfer_Satispay, 2049300000000500075));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_FR_EUR_BankTransfer_Satispay, @pc_FR_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_FR_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_FR_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_FR_EUR_BankTransfer_Satispay := IF(@pc_FR_EUR IS NULL OR @cch_FR_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_FR_EUR_BankTransfer_Satispay, 2049300000000600075));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_FR_EUR_BankTransfer_Satispay, @pc_FR_EUR, @cch_FR_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FR_EUR IS NOT NULL AND @cch_FR_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_FR_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_FR_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_FR_EUR_BankTransfer_SEPA := IF(@pc_FR_EUR IS NULL, NULL, IFNULL(@cch_FR_EUR_BankTransfer_SEPA, 2049300000000500076));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_FR_EUR_BankTransfer_SEPA, @pc_FR_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_FR_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_FR_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_FR_EUR_BankTransfer_SEPA := IF(@pc_FR_EUR IS NULL OR @cch_FR_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_FR_EUR_BankTransfer_SEPA, 2049300000000600076));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_FR_EUR_BankTransfer_SEPA, @pc_FR_EUR, @cch_FR_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FR_EUR IS NOT NULL AND @cch_FR_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_FR_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_FR_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_FR_EUR_BankTransfer_Paysafecard := IF(@pc_FR_EUR IS NULL, NULL, IFNULL(@cch_FR_EUR_BankTransfer_Paysafecard, 2049300000000500077));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_FR_EUR_BankTransfer_Paysafecard, @pc_FR_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_FR_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_FR_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_FR_EUR_BankTransfer_Paysafecard := IF(@pc_FR_EUR IS NULL OR @cch_FR_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_FR_EUR_BankTransfer_Paysafecard, 2049300000000600077));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_FR_EUR_BankTransfer_Paysafecard, @pc_FR_EUR, @cch_FR_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_FR_EUR IS NOT NULL AND @cch_FR_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_GB_GBP_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_GB_GBP AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_GB_GBP_BankTransfer_Trustly := IF(@pc_GB_GBP IS NULL, NULL, IFNULL(@cch_GB_GBP_BankTransfer_Trustly, 2049300000000500078));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_GB_GBP_BankTransfer_Trustly, @pc_GB_GBP, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GB_GBP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_GB_GBP_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_GB_GBP AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_GB_GBP_BankTransfer_Trustly := IF(@pc_GB_GBP IS NULL OR @cch_GB_GBP_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_GB_GBP_BankTransfer_Trustly, 2049300000000600078));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_GB_GBP_BankTransfer_Trustly, @pc_GB_GBP, @cch_GB_GBP_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GB_GBP IS NOT NULL AND @cch_GB_GBP_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_GB_GBP_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_GB_GBP AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_GB_GBP_BankTransfer_Paysafecard := IF(@pc_GB_GBP IS NULL, NULL, IFNULL(@cch_GB_GBP_BankTransfer_Paysafecard, 2049300000000500079));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_GB_GBP_BankTransfer_Paysafecard, @pc_GB_GBP, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GB_GBP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_GB_GBP_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_GB_GBP AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_GB_GBP_BankTransfer_Paysafecard := IF(@pc_GB_GBP IS NULL OR @cch_GB_GBP_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_GB_GBP_BankTransfer_Paysafecard, 2049300000000600079));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_GB_GBP_BankTransfer_Paysafecard, @pc_GB_GBP, @cch_GB_GBP_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GB_GBP IS NOT NULL AND @cch_GB_GBP_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_GB_GBP_BankTransfer_PaybyBankapp := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_GB_GBP AND `channel_code` = 'BankTransfer_PaybyBankapp' LIMIT 1);
SET @cch_GB_GBP_BankTransfer_PaybyBankapp := IF(@pc_GB_GBP IS NULL, NULL, IFNULL(@cch_GB_GBP_BankTransfer_PaybyBankapp, 2049300000000500080));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_GB_GBP_BankTransfer_PaybyBankapp, @pc_GB_GBP, 'BankTransfer_PaybyBankapp', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GB_GBP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_GB_GBP_BankTransfer_PaybyBankapp := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_GB_GBP AND `channel_code` = 'BankTransfer_PaybyBankapp' AND `factory_code` = @factory_code AND `factory_channel` = 'PaybyBankapp' LIMIT 1);
SET @dt_GB_GBP_BankTransfer_PaybyBankapp := IF(@pc_GB_GBP IS NULL OR @cch_GB_GBP_BankTransfer_PaybyBankapp IS NULL, NULL, IFNULL(@dt_GB_GBP_BankTransfer_PaybyBankapp, 2049300000000600080));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_GB_GBP_BankTransfer_PaybyBankapp, @pc_GB_GBP, @cch_GB_GBP_BankTransfer_PaybyBankapp, 'BankTransfer_PaybyBankapp', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'PaybyBankapp', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GB_GBP IS NOT NULL AND @cch_GB_GBP_BankTransfer_PaybyBankapp IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_GB_GBP_Ewallet_Clearpay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_GB_GBP AND `channel_code` = 'Ewallet_Clearpay' LIMIT 1);
SET @cch_GB_GBP_Ewallet_Clearpay := IF(@pc_GB_GBP IS NULL, NULL, IFNULL(@cch_GB_GBP_Ewallet_Clearpay, 2049300000000500081));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_GB_GBP_Ewallet_Clearpay, @pc_GB_GBP, 'Ewallet_Clearpay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GB_GBP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_GB_GBP_Ewallet_Clearpay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_GB_GBP AND `channel_code` = 'Ewallet_Clearpay' AND `factory_code` = @factory_code AND `factory_channel` = 'Clearpay' LIMIT 1);
SET @dt_GB_GBP_Ewallet_Clearpay := IF(@pc_GB_GBP IS NULL OR @cch_GB_GBP_Ewallet_Clearpay IS NULL, NULL, IFNULL(@dt_GB_GBP_Ewallet_Clearpay, 2049300000000600081));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_GB_GBP_Ewallet_Clearpay, @pc_GB_GBP, @cch_GB_GBP_Ewallet_Clearpay, 'Ewallet_Clearpay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Clearpay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GB_GBP IS NOT NULL AND @cch_GB_GBP_Ewallet_Clearpay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_GH_GHS_Ewallet_MobileMoney := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_GH_GHS AND `channel_code` = 'Ewallet_MobileMoney' LIMIT 1);
SET @cch_GH_GHS_Ewallet_MobileMoney := IF(@pc_GH_GHS IS NULL, NULL, IFNULL(@cch_GH_GHS_Ewallet_MobileMoney, 2049300000000500082));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_GH_GHS_Ewallet_MobileMoney, @pc_GH_GHS, 'Ewallet_MobileMoney', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GH_GHS IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_GH_GHS_Ewallet_MobileMoney := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_GH_GHS AND `channel_code` = 'Ewallet_MobileMoney' AND `factory_code` = @factory_code AND `factory_channel` = 'MobileMoney' LIMIT 1);
SET @dt_GH_GHS_Ewallet_MobileMoney := IF(@pc_GH_GHS IS NULL OR @cch_GH_GHS_Ewallet_MobileMoney IS NULL, NULL, IFNULL(@dt_GH_GHS_Ewallet_MobileMoney, 2049300000000600082));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_GH_GHS_Ewallet_MobileMoney, @pc_GH_GHS, @cch_GH_GHS_Ewallet_MobileMoney, 'Ewallet_MobileMoney', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'MobileMoney', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GH_GHS IS NOT NULL AND @cch_GH_GHS_Ewallet_MobileMoney IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_GR_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_GR_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_GR_EUR_BankTransfer_Satispay := IF(@pc_GR_EUR IS NULL, NULL, IFNULL(@cch_GR_EUR_BankTransfer_Satispay, 2049300000000500083));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_GR_EUR_BankTransfer_Satispay, @pc_GR_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_GR_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_GR_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_GR_EUR_BankTransfer_Satispay := IF(@pc_GR_EUR IS NULL OR @cch_GR_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_GR_EUR_BankTransfer_Satispay, 2049300000000600083));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_GR_EUR_BankTransfer_Satispay, @pc_GR_EUR, @cch_GR_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GR_EUR IS NOT NULL AND @cch_GR_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_GR_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_GR_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_GR_EUR_BankTransfer_SEPA := IF(@pc_GR_EUR IS NULL, NULL, IFNULL(@cch_GR_EUR_BankTransfer_SEPA, 2049300000000500084));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_GR_EUR_BankTransfer_SEPA, @pc_GR_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_GR_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_GR_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_GR_EUR_BankTransfer_SEPA := IF(@pc_GR_EUR IS NULL OR @cch_GR_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_GR_EUR_BankTransfer_SEPA, 2049300000000600084));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_GR_EUR_BankTransfer_SEPA, @pc_GR_EUR, @cch_GR_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GR_EUR IS NOT NULL AND @cch_GR_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_GR_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_GR_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_GR_EUR_BankTransfer_Paysafecard := IF(@pc_GR_EUR IS NULL, NULL, IFNULL(@cch_GR_EUR_BankTransfer_Paysafecard, 2049300000000500085));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_GR_EUR_BankTransfer_Paysafecard, @pc_GR_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_GR_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_GR_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_GR_EUR_BankTransfer_Paysafecard := IF(@pc_GR_EUR IS NULL OR @cch_GR_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_GR_EUR_BankTransfer_Paysafecard, 2049300000000600085));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_GR_EUR_BankTransfer_Paysafecard, @pc_GR_EUR, @cch_GR_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_GR_EUR IS NOT NULL AND @cch_GR_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_HK_HKD_QR_AlipayScanPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_HK_HKD AND `channel_code` = 'QR_AlipayScanPay' LIMIT 1);
SET @cch_HK_HKD_QR_AlipayScanPay := IF(@pc_HK_HKD IS NULL, NULL, IFNULL(@cch_HK_HKD_QR_AlipayScanPay, 2049300000000500086));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_HK_HKD_QR_AlipayScanPay, @pc_HK_HKD, 'QR_AlipayScanPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HK_HKD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_HK_HKD_QR_AlipayScanPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_HK_HKD AND `channel_code` = 'QR_AlipayScanPay' AND `factory_code` = @factory_code AND `factory_channel` = 'AlipayScanPay' LIMIT 1);
SET @dt_HK_HKD_QR_AlipayScanPay := IF(@pc_HK_HKD IS NULL OR @cch_HK_HKD_QR_AlipayScanPay IS NULL, NULL, IFNULL(@dt_HK_HKD_QR_AlipayScanPay, 2049300000000600086));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_HK_HKD_QR_AlipayScanPay, @pc_HK_HKD, @cch_HK_HKD_QR_AlipayScanPay, 'QR_AlipayScanPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'AlipayScanPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HK_HKD IS NOT NULL AND @cch_HK_HKD_QR_AlipayScanPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_HK_HKD_Ewallet_AlipayH5 := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_HK_HKD AND `channel_code` = 'Ewallet_AlipayH5' LIMIT 1);
SET @cch_HK_HKD_Ewallet_AlipayH5 := IF(@pc_HK_HKD IS NULL, NULL, IFNULL(@cch_HK_HKD_Ewallet_AlipayH5, 2049300000000500087));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_HK_HKD_Ewallet_AlipayH5, @pc_HK_HKD, 'Ewallet_AlipayH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HK_HKD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_HK_HKD_Ewallet_AlipayH5 := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_HK_HKD AND `channel_code` = 'Ewallet_AlipayH5' AND `factory_code` = @factory_code AND `factory_channel` = 'AlipayH5' LIMIT 1);
SET @dt_HK_HKD_Ewallet_AlipayH5 := IF(@pc_HK_HKD IS NULL OR @cch_HK_HKD_Ewallet_AlipayH5 IS NULL, NULL, IFNULL(@dt_HK_HKD_Ewallet_AlipayH5, 2049300000000600087));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_HK_HKD_Ewallet_AlipayH5, @pc_HK_HKD, @cch_HK_HKD_Ewallet_AlipayH5, 'Ewallet_AlipayH5', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'AlipayH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HK_HKD IS NOT NULL AND @cch_HK_HKD_Ewallet_AlipayH5 IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_HK_HKD_QR_WeChatScanPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_HK_HKD AND `channel_code` = 'QR_WeChatScanPay' LIMIT 1);
SET @cch_HK_HKD_QR_WeChatScanPay := IF(@pc_HK_HKD IS NULL, NULL, IFNULL(@cch_HK_HKD_QR_WeChatScanPay, 2049300000000500088));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_HK_HKD_QR_WeChatScanPay, @pc_HK_HKD, 'QR_WeChatScanPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HK_HKD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_HK_HKD_QR_WeChatScanPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_HK_HKD AND `channel_code` = 'QR_WeChatScanPay' AND `factory_code` = @factory_code AND `factory_channel` = 'WeChatScanPay' LIMIT 1);
SET @dt_HK_HKD_QR_WeChatScanPay := IF(@pc_HK_HKD IS NULL OR @cch_HK_HKD_QR_WeChatScanPay IS NULL, NULL, IFNULL(@dt_HK_HKD_QR_WeChatScanPay, 2049300000000600088));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_HK_HKD_QR_WeChatScanPay, @pc_HK_HKD, @cch_HK_HKD_QR_WeChatScanPay, 'QR_WeChatScanPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'WeChatScanPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HK_HKD IS NOT NULL AND @cch_HK_HKD_QR_WeChatScanPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_HK_HKD_Ewallet_WeChatH5 := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_HK_HKD AND `channel_code` = 'Ewallet_WeChatH5' LIMIT 1);
SET @cch_HK_HKD_Ewallet_WeChatH5 := IF(@pc_HK_HKD IS NULL, NULL, IFNULL(@cch_HK_HKD_Ewallet_WeChatH5, 2049300000000500089));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_HK_HKD_Ewallet_WeChatH5, @pc_HK_HKD, 'Ewallet_WeChatH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HK_HKD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_HK_HKD_Ewallet_WeChatH5 := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_HK_HKD AND `channel_code` = 'Ewallet_WeChatH5' AND `factory_code` = @factory_code AND `factory_channel` = 'WeChatH5' LIMIT 1);
SET @dt_HK_HKD_Ewallet_WeChatH5 := IF(@pc_HK_HKD IS NULL OR @cch_HK_HKD_Ewallet_WeChatH5 IS NULL, NULL, IFNULL(@dt_HK_HKD_Ewallet_WeChatH5, 2049300000000600089));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_HK_HKD_Ewallet_WeChatH5, @pc_HK_HKD, @cch_HK_HKD_Ewallet_WeChatH5, 'Ewallet_WeChatH5', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'WeChatH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HK_HKD IS NOT NULL AND @cch_HK_HKD_Ewallet_WeChatH5 IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_HR_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_HR_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_HR_EUR_BankTransfer_Satispay := IF(@pc_HR_EUR IS NULL, NULL, IFNULL(@cch_HR_EUR_BankTransfer_Satispay, 2049300000000500090));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_HR_EUR_BankTransfer_Satispay, @pc_HR_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_HR_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_HR_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_HR_EUR_BankTransfer_Satispay := IF(@pc_HR_EUR IS NULL OR @cch_HR_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_HR_EUR_BankTransfer_Satispay, 2049300000000600090));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_HR_EUR_BankTransfer_Satispay, @pc_HR_EUR, @cch_HR_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HR_EUR IS NOT NULL AND @cch_HR_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_HR_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_HR_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_HR_EUR_BankTransfer_SEPA := IF(@pc_HR_EUR IS NULL, NULL, IFNULL(@cch_HR_EUR_BankTransfer_SEPA, 2049300000000500091));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_HR_EUR_BankTransfer_SEPA, @pc_HR_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HR_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_HR_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_HR_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_HR_EUR_BankTransfer_SEPA := IF(@pc_HR_EUR IS NULL OR @cch_HR_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_HR_EUR_BankTransfer_SEPA, 2049300000000600091));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_HR_EUR_BankTransfer_SEPA, @pc_HR_EUR, @cch_HR_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HR_EUR IS NOT NULL AND @cch_HR_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_HU_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_HU_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_HU_EUR_BankTransfer_Satispay := IF(@pc_HU_EUR IS NULL, NULL, IFNULL(@cch_HU_EUR_BankTransfer_Satispay, 2049300000000500092));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_HU_EUR_BankTransfer_Satispay, @pc_HU_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HU_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_HU_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_HU_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_HU_EUR_BankTransfer_Satispay := IF(@pc_HU_EUR IS NULL OR @cch_HU_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_HU_EUR_BankTransfer_Satispay, 2049300000000600092));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_HU_EUR_BankTransfer_Satispay, @pc_HU_EUR, @cch_HU_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HU_EUR IS NOT NULL AND @cch_HU_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_HU_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_HU_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_HU_EUR_BankTransfer_SEPA := IF(@pc_HU_EUR IS NULL, NULL, IFNULL(@cch_HU_EUR_BankTransfer_SEPA, 2049300000000500093));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_HU_EUR_BankTransfer_SEPA, @pc_HU_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HU_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_HU_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_HU_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_HU_EUR_BankTransfer_SEPA := IF(@pc_HU_EUR IS NULL OR @cch_HU_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_HU_EUR_BankTransfer_SEPA, 2049300000000600093));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_HU_EUR_BankTransfer_SEPA, @pc_HU_EUR, @cch_HU_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HU_EUR IS NOT NULL AND @cch_HU_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_HU_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_HU_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_HU_EUR_BankTransfer_Paysafecard := IF(@pc_HU_EUR IS NULL, NULL, IFNULL(@cch_HU_EUR_BankTransfer_Paysafecard, 2049300000000500094));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_HU_EUR_BankTransfer_Paysafecard, @pc_HU_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HU_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_HU_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_HU_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_HU_EUR_BankTransfer_Paysafecard := IF(@pc_HU_EUR IS NULL OR @cch_HU_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_HU_EUR_BankTransfer_Paysafecard, 2049300000000600094));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_HU_EUR_BankTransfer_Paysafecard, @pc_HU_EUR, @cch_HU_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_HU_EUR IS NOT NULL AND @cch_HU_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_QR_QRIS := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'QR_QRIS' LIMIT 1);
SET @cch_ID_IDR_QR_QRIS := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_QR_QRIS, 2049300000000500095));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_QR_QRIS, @pc_ID_IDR, 'QR_QRIS', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_QR_QRIS := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'QR_QRIS' AND `factory_code` = @factory_code AND `factory_channel` = 'QRIS' LIMIT 1);
SET @dt_ID_IDR_QR_QRIS := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_QR_QRIS IS NULL, NULL, IFNULL(@dt_ID_IDR_QR_QRIS, 2049300000000600095));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_QR_QRIS, @pc_ID_IDR, @cch_ID_IDR_QR_QRIS, 'QR_QRIS', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'QRIS', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_QR_QRIS IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_Ewallet_DANA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'Ewallet_DANA' LIMIT 1);
SET @cch_ID_IDR_Ewallet_DANA := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_Ewallet_DANA, 2049300000000500096));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_Ewallet_DANA, @pc_ID_IDR, 'Ewallet_DANA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_Ewallet_DANA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'Ewallet_DANA' AND `factory_code` = @factory_code AND `factory_channel` = 'DANA' LIMIT 1);
SET @dt_ID_IDR_Ewallet_DANA := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_Ewallet_DANA IS NULL, NULL, IFNULL(@dt_ID_IDR_Ewallet_DANA, 2049300000000600096));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_Ewallet_DANA, @pc_ID_IDR, @cch_ID_IDR_Ewallet_DANA, 'Ewallet_DANA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'DANA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_Ewallet_DANA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_Ewallet_LinkAja := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'Ewallet_LinkAja' LIMIT 1);
SET @cch_ID_IDR_Ewallet_LinkAja := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_Ewallet_LinkAja, 2049300000000500097));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_Ewallet_LinkAja, @pc_ID_IDR, 'Ewallet_LinkAja', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_Ewallet_LinkAja := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'Ewallet_LinkAja' AND `factory_code` = @factory_code AND `factory_channel` = 'LinkAja' LIMIT 1);
SET @dt_ID_IDR_Ewallet_LinkAja := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_Ewallet_LinkAja IS NULL, NULL, IFNULL(@dt_ID_IDR_Ewallet_LinkAja, 2049300000000600097));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_Ewallet_LinkAja, @pc_ID_IDR, @cch_ID_IDR_Ewallet_LinkAja, 'Ewallet_LinkAja', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'LinkAja', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_Ewallet_LinkAja IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_Ewallet_OVO := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'Ewallet_OVO' LIMIT 1);
SET @cch_ID_IDR_Ewallet_OVO := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_Ewallet_OVO, 2049300000000500098));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_Ewallet_OVO, @pc_ID_IDR, 'Ewallet_OVO', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_Ewallet_OVO := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'Ewallet_OVO' AND `factory_code` = @factory_code AND `factory_channel` = 'OVO' LIMIT 1);
SET @dt_ID_IDR_Ewallet_OVO := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_Ewallet_OVO IS NULL, NULL, IFNULL(@dt_ID_IDR_Ewallet_OVO, 2049300000000600098));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_Ewallet_OVO, @pc_ID_IDR, @cch_ID_IDR_Ewallet_OVO, 'Ewallet_OVO', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'OVO', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_Ewallet_OVO IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'Ewallet_ShopeePay' LIMIT 1);
SET @cch_ID_IDR_Ewallet_ShopeePay := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_Ewallet_ShopeePay, 2049300000000500099));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_Ewallet_ShopeePay, @pc_ID_IDR, 'Ewallet_ShopeePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'Ewallet_ShopeePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ShopeePay' LIMIT 1);
SET @dt_ID_IDR_Ewallet_ShopeePay := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_Ewallet_ShopeePay IS NULL, NULL, IFNULL(@dt_ID_IDR_Ewallet_ShopeePay, 2049300000000600099));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_Ewallet_ShopeePay, @pc_ID_IDR, @cch_ID_IDR_Ewallet_ShopeePay, 'Ewallet_ShopeePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'ShopeePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_Ewallet_ShopeePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_Ewallet_GoPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'Ewallet_GoPay' LIMIT 1);
SET @cch_ID_IDR_Ewallet_GoPay := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_Ewallet_GoPay, 2049300000000500100));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_Ewallet_GoPay, @pc_ID_IDR, 'Ewallet_GoPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_Ewallet_GoPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'Ewallet_GoPay' AND `factory_code` = @factory_code AND `factory_channel` = 'GoPay' LIMIT 1);
SET @dt_ID_IDR_Ewallet_GoPay := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_Ewallet_GoPay IS NULL, NULL, IFNULL(@dt_ID_IDR_Ewallet_GoPay, 2049300000000600100));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_Ewallet_GoPay, @pc_ID_IDR, @cch_ID_IDR_Ewallet_GoPay, 'Ewallet_GoPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'GoPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_Ewallet_GoPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BankTransfer_BCA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_BCA' LIMIT 1);
SET @cch_ID_IDR_BankTransfer_BCA := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BankTransfer_BCA, 2049300000000500101));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BankTransfer_BCA, @pc_ID_IDR, 'BankTransfer_BCA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BankTransfer_BCA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_BCA' AND `factory_code` = @factory_code AND `factory_channel` = 'BCA' LIMIT 1);
SET @dt_ID_IDR_BankTransfer_BCA := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BankTransfer_BCA IS NULL, NULL, IFNULL(@dt_ID_IDR_BankTransfer_BCA, 2049300000000600101));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BankTransfer_BCA, @pc_ID_IDR, @cch_ID_IDR_BankTransfer_BCA, 'BankTransfer_BCA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 70, 'BCA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BankTransfer_BCA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BankTransfer_BNI := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_BNI' LIMIT 1);
SET @cch_ID_IDR_BankTransfer_BNI := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BankTransfer_BNI, 2049300000000500102));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BankTransfer_BNI, @pc_ID_IDR, 'BankTransfer_BNI', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BankTransfer_BNI := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_BNI' AND `factory_code` = @factory_code AND `factory_channel` = 'BNI' LIMIT 1);
SET @dt_ID_IDR_BankTransfer_BNI := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BankTransfer_BNI IS NULL, NULL, IFNULL(@dt_ID_IDR_BankTransfer_BNI, 2049300000000600102));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BankTransfer_BNI, @pc_ID_IDR, @cch_ID_IDR_BankTransfer_BNI, 'BankTransfer_BNI', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 65, 'BNI', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BankTransfer_BNI IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BankTransfer_BNC := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_BNC' LIMIT 1);
SET @cch_ID_IDR_BankTransfer_BNC := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BankTransfer_BNC, 2049300000000500103));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BankTransfer_BNC, @pc_ID_IDR, 'BankTransfer_BNC', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BankTransfer_BNC := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_BNC' AND `factory_code` = @factory_code AND `factory_channel` = 'BNC' LIMIT 1);
SET @dt_ID_IDR_BankTransfer_BNC := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BankTransfer_BNC IS NULL, NULL, IFNULL(@dt_ID_IDR_BankTransfer_BNC, 2049300000000600103));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BankTransfer_BNC, @pc_ID_IDR, @cch_ID_IDR_BankTransfer_BNC, 'BankTransfer_BNC', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'BNC', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BankTransfer_BNC IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BankTransfer_Permata := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_Permata' LIMIT 1);
SET @cch_ID_IDR_BankTransfer_Permata := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BankTransfer_Permata, 2049300000000500104));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BankTransfer_Permata, @pc_ID_IDR, 'BankTransfer_Permata', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BankTransfer_Permata := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_Permata' AND `factory_code` = @factory_code AND `factory_channel` = 'Permata' LIMIT 1);
SET @dt_ID_IDR_BankTransfer_Permata := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BankTransfer_Permata IS NULL, NULL, IFNULL(@dt_ID_IDR_BankTransfer_Permata, 2049300000000600104));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BankTransfer_Permata, @pc_ID_IDR, @cch_ID_IDR_BankTransfer_Permata, 'BankTransfer_Permata', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'Permata', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BankTransfer_Permata IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BankTransfer_Mandiri := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_Mandiri' LIMIT 1);
SET @cch_ID_IDR_BankTransfer_Mandiri := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BankTransfer_Mandiri, 2049300000000500105));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BankTransfer_Mandiri, @pc_ID_IDR, 'BankTransfer_Mandiri', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BankTransfer_Mandiri := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_Mandiri' AND `factory_code` = @factory_code AND `factory_channel` = 'Mandiri' LIMIT 1);
SET @dt_ID_IDR_BankTransfer_Mandiri := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BankTransfer_Mandiri IS NULL, NULL, IFNULL(@dt_ID_IDR_BankTransfer_Mandiri, 2049300000000600105));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BankTransfer_Mandiri, @pc_ID_IDR, @cch_ID_IDR_BankTransfer_Mandiri, 'BankTransfer_Mandiri', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'Mandiri', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BankTransfer_Mandiri IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BankTransfer_BRI := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_BRI' LIMIT 1);
SET @cch_ID_IDR_BankTransfer_BRI := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BankTransfer_BRI, 2049300000000500106));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BankTransfer_BRI, @pc_ID_IDR, 'BankTransfer_BRI', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BankTransfer_BRI := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_BRI' AND `factory_code` = @factory_code AND `factory_channel` = 'BRI' LIMIT 1);
SET @dt_ID_IDR_BankTransfer_BRI := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BankTransfer_BRI IS NULL, NULL, IFNULL(@dt_ID_IDR_BankTransfer_BRI, 2049300000000600106));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BankTransfer_BRI, @pc_ID_IDR, @cch_ID_IDR_BankTransfer_BRI, 'BankTransfer_BRI', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'BRI', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BankTransfer_BRI IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BankTransfer_CIMB := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_CIMB' LIMIT 1);
SET @cch_ID_IDR_BankTransfer_CIMB := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BankTransfer_CIMB, 2049300000000500107));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BankTransfer_CIMB, @pc_ID_IDR, 'BankTransfer_CIMB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BankTransfer_CIMB := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_CIMB' AND `factory_code` = @factory_code AND `factory_channel` = 'CIMB' LIMIT 1);
SET @dt_ID_IDR_BankTransfer_CIMB := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BankTransfer_CIMB IS NULL, NULL, IFNULL(@dt_ID_IDR_BankTransfer_CIMB, 2049300000000600107));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BankTransfer_CIMB, @pc_ID_IDR, @cch_ID_IDR_BankTransfer_CIMB, 'BankTransfer_CIMB', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'CIMB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BankTransfer_CIMB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BankTransfer_Danamon := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_Danamon' LIMIT 1);
SET @cch_ID_IDR_BankTransfer_Danamon := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BankTransfer_Danamon, 2049300000000500108));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BankTransfer_Danamon, @pc_ID_IDR, 'BankTransfer_Danamon', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BankTransfer_Danamon := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_Danamon' AND `factory_code` = @factory_code AND `factory_channel` = 'Danamon' LIMIT 1);
SET @dt_ID_IDR_BankTransfer_Danamon := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BankTransfer_Danamon IS NULL, NULL, IFNULL(@dt_ID_IDR_BankTransfer_Danamon, 2049300000000600108));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BankTransfer_Danamon, @pc_ID_IDR, @cch_ID_IDR_BankTransfer_Danamon, 'BankTransfer_Danamon', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'Danamon', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BankTransfer_Danamon IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BankTransfer_SahabatSampoerna := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_SahabatSampoerna' LIMIT 1);
SET @cch_ID_IDR_BankTransfer_SahabatSampoerna := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BankTransfer_SahabatSampoerna, 2049300000000500109));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BankTransfer_SahabatSampoerna, @pc_ID_IDR, 'BankTransfer_SahabatSampoerna', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BankTransfer_SahabatSampoerna := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_SahabatSampoerna' AND `factory_code` = @factory_code AND `factory_channel` = 'SahabatSampoerna' LIMIT 1);
SET @dt_ID_IDR_BankTransfer_SahabatSampoerna := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BankTransfer_SahabatSampoerna IS NULL, NULL, IFNULL(@dt_ID_IDR_BankTransfer_SahabatSampoerna, 2049300000000600109));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BankTransfer_SahabatSampoerna, @pc_ID_IDR, @cch_ID_IDR_BankTransfer_SahabatSampoerna, 'BankTransfer_SahabatSampoerna', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'SahabatSampoerna', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BankTransfer_SahabatSampoerna IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BankTransfer_ID_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_ID_BankTransfer' LIMIT 1);
SET @cch_ID_IDR_BankTransfer_ID_BankTransfer := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BankTransfer_ID_BankTransfer, 2049300000000500110));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BankTransfer_ID_BankTransfer, @pc_ID_IDR, 'BankTransfer_ID_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BankTransfer_ID_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BankTransfer_ID_BankTransfer' AND `factory_code` = @factory_code AND `factory_channel` = 'ID_BankTransfer' LIMIT 1);
SET @dt_ID_IDR_BankTransfer_ID_BankTransfer := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BankTransfer_ID_BankTransfer IS NULL, NULL, IFNULL(@dt_ID_IDR_BankTransfer_ID_BankTransfer, 2049300000000600110));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BankTransfer_ID_BankTransfer, @pc_ID_IDR, @cch_ID_IDR_BankTransfer_ID_BankTransfer, 'BankTransfer_ID_BankTransfer', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'ID_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BankTransfer_ID_BankTransfer IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ID_IDR_BNPL_Kredivo := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BNPL_Kredivo' LIMIT 1);
SET @cch_ID_IDR_BNPL_Kredivo := IF(@pc_ID_IDR IS NULL, NULL, IFNULL(@cch_ID_IDR_BNPL_Kredivo, 2049300000000500111));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ID_IDR_BNPL_Kredivo, @pc_ID_IDR, 'BNPL_Kredivo', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ID_IDR_BNPL_Kredivo := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ID_IDR AND `channel_code` = 'BNPL_Kredivo' AND `factory_code` = @factory_code AND `factory_channel` = 'Kredivo' LIMIT 1);
SET @dt_ID_IDR_BNPL_Kredivo := IF(@pc_ID_IDR IS NULL OR @cch_ID_IDR_BNPL_Kredivo IS NULL, NULL, IFNULL(@dt_ID_IDR_BNPL_Kredivo, 2049300000000600111));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ID_IDR_BNPL_Kredivo, @pc_ID_IDR, @cch_ID_IDR_BNPL_Kredivo, 'BNPL_Kredivo', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'Kredivo', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ID_IDR IS NOT NULL AND @cch_ID_IDR_BNPL_Kredivo IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IE_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IE_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_IE_EUR_BankTransfer_Satispay := IF(@pc_IE_EUR IS NULL, NULL, IFNULL(@cch_IE_EUR_BankTransfer_Satispay, 2049300000000500112));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IE_EUR_BankTransfer_Satispay, @pc_IE_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IE_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IE_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_IE_EUR_BankTransfer_Satispay := IF(@pc_IE_EUR IS NULL OR @cch_IE_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_IE_EUR_BankTransfer_Satispay, 2049300000000600112));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IE_EUR_BankTransfer_Satispay, @pc_IE_EUR, @cch_IE_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IE_EUR IS NOT NULL AND @cch_IE_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IE_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IE_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_IE_EUR_BankTransfer_SEPA := IF(@pc_IE_EUR IS NULL, NULL, IFNULL(@cch_IE_EUR_BankTransfer_SEPA, 2049300000000500113));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IE_EUR_BankTransfer_SEPA, @pc_IE_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IE_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IE_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_IE_EUR_BankTransfer_SEPA := IF(@pc_IE_EUR IS NULL OR @cch_IE_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_IE_EUR_BankTransfer_SEPA, 2049300000000600113));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IE_EUR_BankTransfer_SEPA, @pc_IE_EUR, @cch_IE_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IE_EUR IS NOT NULL AND @cch_IE_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IE_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IE_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_IE_EUR_BankTransfer_Paysafecard := IF(@pc_IE_EUR IS NULL, NULL, IFNULL(@cch_IE_EUR_BankTransfer_Paysafecard, 2049300000000500114));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IE_EUR_BankTransfer_Paysafecard, @pc_IE_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IE_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IE_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_IE_EUR_BankTransfer_Paysafecard := IF(@pc_IE_EUR IS NULL OR @cch_IE_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_IE_EUR_BankTransfer_Paysafecard, 2049300000000600114));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IE_EUR_BankTransfer_Paysafecard, @pc_IE_EUR, @cch_IE_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IE_EUR IS NOT NULL AND @cch_IE_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IN_INR_Ewallet_UPI := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_UPI' LIMIT 1);
SET @cch_IN_INR_Ewallet_UPI := IF(@pc_IN_INR IS NULL, NULL, IFNULL(@cch_IN_INR_Ewallet_UPI, 2049300000000500115));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IN_INR_Ewallet_UPI, @pc_IN_INR, 'Ewallet_UPI', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IN_INR_Ewallet_UPI := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_UPI' AND `factory_code` = @factory_code AND `factory_channel` = 'UPI' LIMIT 1);
SET @dt_IN_INR_Ewallet_UPI := IF(@pc_IN_INR IS NULL OR @cch_IN_INR_Ewallet_UPI IS NULL, NULL, IFNULL(@dt_IN_INR_Ewallet_UPI, 2049300000000600115));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IN_INR_Ewallet_UPI, @pc_IN_INR, @cch_IN_INR_Ewallet_UPI, 'Ewallet_UPI', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'UPI', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL AND @cch_IN_INR_Ewallet_UPI IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IN_INR_Ewallet_Paytm := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_Paytm' LIMIT 1);
SET @cch_IN_INR_Ewallet_Paytm := IF(@pc_IN_INR IS NULL, NULL, IFNULL(@cch_IN_INR_Ewallet_Paytm, 2049300000000500116));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IN_INR_Ewallet_Paytm, @pc_IN_INR, 'Ewallet_Paytm', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IN_INR_Ewallet_Paytm := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_Paytm' AND `factory_code` = @factory_code AND `factory_channel` = 'Paytm' LIMIT 1);
SET @dt_IN_INR_Ewallet_Paytm := IF(@pc_IN_INR IS NULL OR @cch_IN_INR_Ewallet_Paytm IS NULL, NULL, IFNULL(@dt_IN_INR_Ewallet_Paytm, 2049300000000600116));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IN_INR_Ewallet_Paytm, @pc_IN_INR, @cch_IN_INR_Ewallet_Paytm, 'Ewallet_Paytm', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Paytm', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL AND @cch_IN_INR_Ewallet_Paytm IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IN_INR_Ewallet_PhonePe := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_PhonePe' LIMIT 1);
SET @cch_IN_INR_Ewallet_PhonePe := IF(@pc_IN_INR IS NULL, NULL, IFNULL(@cch_IN_INR_Ewallet_PhonePe, 2049300000000500117));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IN_INR_Ewallet_PhonePe, @pc_IN_INR, 'Ewallet_PhonePe', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IN_INR_Ewallet_PhonePe := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_PhonePe' AND `factory_code` = @factory_code AND `factory_channel` = 'PhonePe' LIMIT 1);
SET @dt_IN_INR_Ewallet_PhonePe := IF(@pc_IN_INR IS NULL OR @cch_IN_INR_Ewallet_PhonePe IS NULL, NULL, IFNULL(@dt_IN_INR_Ewallet_PhonePe, 2049300000000600117));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IN_INR_Ewallet_PhonePe, @pc_IN_INR, @cch_IN_INR_Ewallet_PhonePe, 'Ewallet_PhonePe', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'PhonePe', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL AND @cch_IN_INR_Ewallet_PhonePe IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IN_INR_Ewallet_GooglePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_GooglePay' LIMIT 1);
SET @cch_IN_INR_Ewallet_GooglePay := IF(@pc_IN_INR IS NULL, NULL, IFNULL(@cch_IN_INR_Ewallet_GooglePay, 2049300000000500118));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IN_INR_Ewallet_GooglePay, @pc_IN_INR, 'Ewallet_GooglePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IN_INR_Ewallet_GooglePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_GooglePay' AND `factory_code` = @factory_code AND `factory_channel` = 'GooglePay' LIMIT 1);
SET @dt_IN_INR_Ewallet_GooglePay := IF(@pc_IN_INR IS NULL OR @cch_IN_INR_Ewallet_GooglePay IS NULL, NULL, IFNULL(@dt_IN_INR_Ewallet_GooglePay, 2049300000000600118));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IN_INR_Ewallet_GooglePay, @pc_IN_INR, @cch_IN_INR_Ewallet_GooglePay, 'Ewallet_GooglePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'GooglePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL AND @cch_IN_INR_Ewallet_GooglePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IN_INR_Ewallet_BHIM := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_BHIM' LIMIT 1);
SET @cch_IN_INR_Ewallet_BHIM := IF(@pc_IN_INR IS NULL, NULL, IFNULL(@cch_IN_INR_Ewallet_BHIM, 2049300000000500119));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IN_INR_Ewallet_BHIM, @pc_IN_INR, 'Ewallet_BHIM', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IN_INR_Ewallet_BHIM := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_BHIM' AND `factory_code` = @factory_code AND `factory_channel` = 'BHIM' LIMIT 1);
SET @dt_IN_INR_Ewallet_BHIM := IF(@pc_IN_INR IS NULL OR @cch_IN_INR_Ewallet_BHIM IS NULL, NULL, IFNULL(@dt_IN_INR_Ewallet_BHIM, 2049300000000600119));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IN_INR_Ewallet_BHIM, @pc_IN_INR, @cch_IN_INR_Ewallet_BHIM, 'Ewallet_BHIM', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'BHIM', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL AND @cch_IN_INR_Ewallet_BHIM IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IN_INR_Ewallet_Mobikwik := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_Mobikwik' LIMIT 1);
SET @cch_IN_INR_Ewallet_Mobikwik := IF(@pc_IN_INR IS NULL, NULL, IFNULL(@cch_IN_INR_Ewallet_Mobikwik, 2049300000000500120));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IN_INR_Ewallet_Mobikwik, @pc_IN_INR, 'Ewallet_Mobikwik', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IN_INR_Ewallet_Mobikwik := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IN_INR AND `channel_code` = 'Ewallet_Mobikwik' AND `factory_code` = @factory_code AND `factory_channel` = 'Mobikwik' LIMIT 1);
SET @dt_IN_INR_Ewallet_Mobikwik := IF(@pc_IN_INR IS NULL OR @cch_IN_INR_Ewallet_Mobikwik IS NULL, NULL, IFNULL(@dt_IN_INR_Ewallet_Mobikwik, 2049300000000600120));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IN_INR_Ewallet_Mobikwik, @pc_IN_INR, @cch_IN_INR_Ewallet_Mobikwik, 'Ewallet_Mobikwik', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'Mobikwik', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IN_INR IS NOT NULL AND @cch_IN_INR_Ewallet_Mobikwik IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IQ_IQD_Ewallet_ZainCash := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IQ_IQD AND `channel_code` = 'Ewallet_ZainCash' LIMIT 1);
SET @cch_IQ_IQD_Ewallet_ZainCash := IF(@pc_IQ_IQD IS NULL, NULL, IFNULL(@cch_IQ_IQD_Ewallet_ZainCash, 2049300000000500121));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IQ_IQD_Ewallet_ZainCash, @pc_IQ_IQD, 'Ewallet_ZainCash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IQ_IQD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IQ_IQD_Ewallet_ZainCash := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IQ_IQD AND `channel_code` = 'Ewallet_ZainCash' AND `factory_code` = @factory_code AND `factory_channel` = 'ZainCash' LIMIT 1);
SET @dt_IQ_IQD_Ewallet_ZainCash := IF(@pc_IQ_IQD IS NULL OR @cch_IQ_IQD_Ewallet_ZainCash IS NULL, NULL, IFNULL(@dt_IQ_IQD_Ewallet_ZainCash, 2049300000000600121));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IQ_IQD_Ewallet_ZainCash, @pc_IQ_IQD, @cch_IQ_IQD_Ewallet_ZainCash, 'Ewallet_ZainCash', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'ZainCash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IQ_IQD IS NOT NULL AND @cch_IQ_IQD_Ewallet_ZainCash IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IT_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IT_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_IT_EUR_BankTransfer_Satispay := IF(@pc_IT_EUR IS NULL, NULL, IFNULL(@cch_IT_EUR_BankTransfer_Satispay, 2049300000000500122));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IT_EUR_BankTransfer_Satispay, @pc_IT_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IT_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IT_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_IT_EUR_BankTransfer_Satispay := IF(@pc_IT_EUR IS NULL OR @cch_IT_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_IT_EUR_BankTransfer_Satispay, 2049300000000600122));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IT_EUR_BankTransfer_Satispay, @pc_IT_EUR, @cch_IT_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL AND @cch_IT_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IT_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IT_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_IT_EUR_BankTransfer_SEPA := IF(@pc_IT_EUR IS NULL, NULL, IFNULL(@cch_IT_EUR_BankTransfer_SEPA, 2049300000000500123));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IT_EUR_BankTransfer_SEPA, @pc_IT_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IT_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IT_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_IT_EUR_BankTransfer_SEPA := IF(@pc_IT_EUR IS NULL OR @cch_IT_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_IT_EUR_BankTransfer_SEPA, 2049300000000600123));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IT_EUR_BankTransfer_SEPA, @pc_IT_EUR, @cch_IT_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL AND @cch_IT_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IT_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IT_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_IT_EUR_BankTransfer_Paysafecard := IF(@pc_IT_EUR IS NULL, NULL, IFNULL(@cch_IT_EUR_BankTransfer_Paysafecard, 2049300000000500124));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IT_EUR_BankTransfer_Paysafecard, @pc_IT_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IT_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IT_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_IT_EUR_BankTransfer_Paysafecard := IF(@pc_IT_EUR IS NULL OR @cch_IT_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_IT_EUR_BankTransfer_Paysafecard, 2049300000000600124));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IT_EUR_BankTransfer_Paysafecard, @pc_IT_EUR, @cch_IT_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL AND @cch_IT_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IT_EUR_BankTransfer_MyBank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IT_EUR AND `channel_code` = 'BankTransfer_MyBank' LIMIT 1);
SET @cch_IT_EUR_BankTransfer_MyBank := IF(@pc_IT_EUR IS NULL, NULL, IFNULL(@cch_IT_EUR_BankTransfer_MyBank, 2049300000000500125));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IT_EUR_BankTransfer_MyBank, @pc_IT_EUR, 'BankTransfer_MyBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IT_EUR_BankTransfer_MyBank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IT_EUR AND `channel_code` = 'BankTransfer_MyBank' AND `factory_code` = @factory_code AND `factory_channel` = 'MyBank' LIMIT 1);
SET @dt_IT_EUR_BankTransfer_MyBank := IF(@pc_IT_EUR IS NULL OR @cch_IT_EUR_BankTransfer_MyBank IS NULL, NULL, IFNULL(@dt_IT_EUR_BankTransfer_MyBank, 2049300000000600125));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IT_EUR_BankTransfer_MyBank, @pc_IT_EUR, @cch_IT_EUR_BankTransfer_MyBank, 'BankTransfer_MyBank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'MyBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL AND @cch_IT_EUR_BankTransfer_MyBank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_IT_EUR_Ewallet_Tinaba := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_IT_EUR AND `channel_code` = 'Ewallet_Tinaba' LIMIT 1);
SET @cch_IT_EUR_Ewallet_Tinaba := IF(@pc_IT_EUR IS NULL, NULL, IFNULL(@cch_IT_EUR_Ewallet_Tinaba, 2049300000000500126));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_IT_EUR_Ewallet_Tinaba, @pc_IT_EUR, 'Ewallet_Tinaba', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_IT_EUR_Ewallet_Tinaba := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_IT_EUR AND `channel_code` = 'Ewallet_Tinaba' AND `factory_code` = @factory_code AND `factory_channel` = 'Tinaba' LIMIT 1);
SET @dt_IT_EUR_Ewallet_Tinaba := IF(@pc_IT_EUR IS NULL OR @cch_IT_EUR_Ewallet_Tinaba IS NULL, NULL, IFNULL(@dt_IT_EUR_Ewallet_Tinaba, 2049300000000600126));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_IT_EUR_Ewallet_Tinaba, @pc_IT_EUR, @cch_IT_EUR_Ewallet_Tinaba, 'Ewallet_Tinaba', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'Tinaba', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_IT_EUR IS NOT NULL AND @cch_IT_EUR_Ewallet_Tinaba IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_JO_JOD_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_JO_JOD AND `channel_code` = 'Card_CreditCard' LIMIT 1);
SET @cch_JO_JOD_Card_CreditCard := IF(@pc_JO_JOD IS NULL, NULL, IFNULL(@cch_JO_JOD_Card_CreditCard, 2049300000000500127));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_JO_JOD_Card_CreditCard, @pc_JO_JOD, 'Card_CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JO_JOD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_JO_JOD_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_JO_JOD AND `channel_code` = 'Card_CreditCard' AND `factory_code` = @factory_code AND `factory_channel` = 'CreditCard' LIMIT 1);
SET @dt_JO_JOD_Card_CreditCard := IF(@pc_JO_JOD IS NULL OR @cch_JO_JOD_Card_CreditCard IS NULL, NULL, IFNULL(@dt_JO_JOD_Card_CreditCard, 2049300000000600127));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_JO_JOD_Card_CreditCard, @pc_JO_JOD, @cch_JO_JOD_Card_CreditCard, 'Card_CreditCard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JO_JOD IS NOT NULL AND @cch_JO_JOD_Card_CreditCard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_JO_JOD_Ewallet_Efawateercom := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_JO_JOD AND `channel_code` = 'Ewallet_Efawateercom' LIMIT 1);
SET @cch_JO_JOD_Ewallet_Efawateercom := IF(@pc_JO_JOD IS NULL, NULL, IFNULL(@cch_JO_JOD_Ewallet_Efawateercom, 2049300000000500128));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_JO_JOD_Ewallet_Efawateercom, @pc_JO_JOD, 'Ewallet_Efawateercom', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JO_JOD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_JO_JOD_Ewallet_Efawateercom := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_JO_JOD AND `channel_code` = 'Ewallet_Efawateercom' AND `factory_code` = @factory_code AND `factory_channel` = 'Efawateercom' LIMIT 1);
SET @dt_JO_JOD_Ewallet_Efawateercom := IF(@pc_JO_JOD IS NULL OR @cch_JO_JOD_Ewallet_Efawateercom IS NULL, NULL, IFNULL(@dt_JO_JOD_Ewallet_Efawateercom, 2049300000000600128));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_JO_JOD_Ewallet_Efawateercom, @pc_JO_JOD, @cch_JO_JOD_Ewallet_Efawateercom, 'Ewallet_Efawateercom', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Efawateercom', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JO_JOD IS NOT NULL AND @cch_JO_JOD_Ewallet_Efawateercom IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_JP_JPY_Ewallet_PayPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_JP_JPY AND `channel_code` = 'Ewallet_PayPay' LIMIT 1);
SET @cch_JP_JPY_Ewallet_PayPay := IF(@pc_JP_JPY IS NULL, NULL, IFNULL(@cch_JP_JPY_Ewallet_PayPay, 2049300000000500129));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_JP_JPY_Ewallet_PayPay, @pc_JP_JPY, 'Ewallet_PayPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JP_JPY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_JP_JPY_Ewallet_PayPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_JP_JPY AND `channel_code` = 'Ewallet_PayPay' AND `factory_code` = @factory_code AND `factory_channel` = 'PayPay' LIMIT 1);
SET @dt_JP_JPY_Ewallet_PayPay := IF(@pc_JP_JPY IS NULL OR @cch_JP_JPY_Ewallet_PayPay IS NULL, NULL, IFNULL(@dt_JP_JPY_Ewallet_PayPay, 2049300000000600129));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_JP_JPY_Ewallet_PayPay, @pc_JP_JPY, @cch_JP_JPY_Ewallet_PayPay, 'Ewallet_PayPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'PayPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JP_JPY IS NOT NULL AND @cch_JP_JPY_Ewallet_PayPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_JP_JPY_Ewallet_PayEasy := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_JP_JPY AND `channel_code` = 'Ewallet_PayEasy' LIMIT 1);
SET @cch_JP_JPY_Ewallet_PayEasy := IF(@pc_JP_JPY IS NULL, NULL, IFNULL(@cch_JP_JPY_Ewallet_PayEasy, 2049300000000500130));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_JP_JPY_Ewallet_PayEasy, @pc_JP_JPY, 'Ewallet_PayEasy', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JP_JPY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_JP_JPY_Ewallet_PayEasy := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_JP_JPY AND `channel_code` = 'Ewallet_PayEasy' AND `factory_code` = @factory_code AND `factory_channel` = 'PayEasy' LIMIT 1);
SET @dt_JP_JPY_Ewallet_PayEasy := IF(@pc_JP_JPY IS NULL OR @cch_JP_JPY_Ewallet_PayEasy IS NULL, NULL, IFNULL(@dt_JP_JPY_Ewallet_PayEasy, 2049300000000600130));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_JP_JPY_Ewallet_PayEasy, @pc_JP_JPY, @cch_JP_JPY_Ewallet_PayEasy, 'Ewallet_PayEasy', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'PayEasy', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JP_JPY IS NOT NULL AND @cch_JP_JPY_Ewallet_PayEasy IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_JP_JPY_OTC_Konbini := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_JP_JPY AND `channel_code` = 'OTC_Konbini' LIMIT 1);
SET @cch_JP_JPY_OTC_Konbini := IF(@pc_JP_JPY IS NULL, NULL, IFNULL(@cch_JP_JPY_OTC_Konbini, 2049300000000500131));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_JP_JPY_OTC_Konbini, @pc_JP_JPY, 'OTC_Konbini', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JP_JPY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_JP_JPY_OTC_Konbini := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_JP_JPY AND `channel_code` = 'OTC_Konbini' AND `factory_code` = @factory_code AND `factory_channel` = 'Konbini' LIMIT 1);
SET @dt_JP_JPY_OTC_Konbini := IF(@pc_JP_JPY IS NULL OR @cch_JP_JPY_OTC_Konbini IS NULL, NULL, IFNULL(@dt_JP_JPY_OTC_Konbini, 2049300000000600131));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_JP_JPY_OTC_Konbini, @pc_JP_JPY, @cch_JP_JPY_OTC_Konbini, 'OTC_Konbini', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Konbini', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JP_JPY IS NOT NULL AND @cch_JP_JPY_OTC_Konbini IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_JP_JPY_OTC_SevenEleven := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_JP_JPY AND `channel_code` = 'OTC_SevenEleven' LIMIT 1);
SET @cch_JP_JPY_OTC_SevenEleven := IF(@pc_JP_JPY IS NULL, NULL, IFNULL(@cch_JP_JPY_OTC_SevenEleven, 2049300000000500132));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_JP_JPY_OTC_SevenEleven, @pc_JP_JPY, 'OTC_SevenEleven', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JP_JPY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_JP_JPY_OTC_SevenEleven := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_JP_JPY AND `channel_code` = 'OTC_SevenEleven' AND `factory_code` = @factory_code AND `factory_channel` = 'SevenEleven' LIMIT 1);
SET @dt_JP_JPY_OTC_SevenEleven := IF(@pc_JP_JPY IS NULL OR @cch_JP_JPY_OTC_SevenEleven IS NULL, NULL, IFNULL(@dt_JP_JPY_OTC_SevenEleven, 2049300000000600132));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_JP_JPY_OTC_SevenEleven, @pc_JP_JPY, @cch_JP_JPY_OTC_SevenEleven, 'OTC_SevenEleven', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'SevenEleven', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_JP_JPY IS NOT NULL AND @cch_JP_JPY_OTC_SevenEleven IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_KE_KES_Ewallet_MobileMoney := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_KE_KES AND `channel_code` = 'Ewallet_MobileMoney' LIMIT 1);
SET @cch_KE_KES_Ewallet_MobileMoney := IF(@pc_KE_KES IS NULL, NULL, IFNULL(@cch_KE_KES_Ewallet_MobileMoney, 2049300000000500133));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_KE_KES_Ewallet_MobileMoney, @pc_KE_KES, 'Ewallet_MobileMoney', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KE_KES IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_KE_KES_Ewallet_MobileMoney := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_KE_KES AND `channel_code` = 'Ewallet_MobileMoney' AND `factory_code` = @factory_code AND `factory_channel` = 'MobileMoney' LIMIT 1);
SET @dt_KE_KES_Ewallet_MobileMoney := IF(@pc_KE_KES IS NULL OR @cch_KE_KES_Ewallet_MobileMoney IS NULL, NULL, IFNULL(@dt_KE_KES_Ewallet_MobileMoney, 2049300000000600133));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_KE_KES_Ewallet_MobileMoney, @pc_KE_KES, @cch_KE_KES_Ewallet_MobileMoney, 'Ewallet_MobileMoney', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'MobileMoney', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KE_KES IS NOT NULL AND @cch_KE_KES_Ewallet_MobileMoney IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_KR_KRW_Ewallet_KaKaoPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_KaKaoPay' LIMIT 1);
SET @cch_KR_KRW_Ewallet_KaKaoPay := IF(@pc_KR_KRW IS NULL, NULL, IFNULL(@cch_KR_KRW_Ewallet_KaKaoPay, 2049300000000500134));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_KR_KRW_Ewallet_KaKaoPay, @pc_KR_KRW, 'Ewallet_KaKaoPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_KR_KRW_Ewallet_KaKaoPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_KaKaoPay' AND `factory_code` = @factory_code AND `factory_channel` = 'KaKaoPay' LIMIT 1);
SET @dt_KR_KRW_Ewallet_KaKaoPay := IF(@pc_KR_KRW IS NULL OR @cch_KR_KRW_Ewallet_KaKaoPay IS NULL, NULL, IFNULL(@dt_KR_KRW_Ewallet_KaKaoPay, 2049300000000600134));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_KR_KRW_Ewallet_KaKaoPay, @pc_KR_KRW, @cch_KR_KRW_Ewallet_KaKaoPay, 'Ewallet_KaKaoPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'KaKaoPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL AND @cch_KR_KRW_Ewallet_KaKaoPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_KR_KRW_Ewallet_NaverPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_NaverPay' LIMIT 1);
SET @cch_KR_KRW_Ewallet_NaverPay := IF(@pc_KR_KRW IS NULL, NULL, IFNULL(@cch_KR_KRW_Ewallet_NaverPay, 2049300000000500135));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_KR_KRW_Ewallet_NaverPay, @pc_KR_KRW, 'Ewallet_NaverPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_KR_KRW_Ewallet_NaverPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_NaverPay' AND `factory_code` = @factory_code AND `factory_channel` = 'NaverPay' LIMIT 1);
SET @dt_KR_KRW_Ewallet_NaverPay := IF(@pc_KR_KRW IS NULL OR @cch_KR_KRW_Ewallet_NaverPay IS NULL, NULL, IFNULL(@dt_KR_KRW_Ewallet_NaverPay, 2049300000000600135));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_KR_KRW_Ewallet_NaverPay, @pc_KR_KRW, @cch_KR_KRW_Ewallet_NaverPay, 'Ewallet_NaverPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'NaverPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL AND @cch_KR_KRW_Ewallet_NaverPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_KR_KRW_Ewallet_Payco := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_Payco' LIMIT 1);
SET @cch_KR_KRW_Ewallet_Payco := IF(@pc_KR_KRW IS NULL, NULL, IFNULL(@cch_KR_KRW_Ewallet_Payco, 2049300000000500136));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_KR_KRW_Ewallet_Payco, @pc_KR_KRW, 'Ewallet_Payco', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_KR_KRW_Ewallet_Payco := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_Payco' AND `factory_code` = @factory_code AND `factory_channel` = 'Payco' LIMIT 1);
SET @dt_KR_KRW_Ewallet_Payco := IF(@pc_KR_KRW IS NULL OR @cch_KR_KRW_Ewallet_Payco IS NULL, NULL, IFNULL(@dt_KR_KRW_Ewallet_Payco, 2049300000000600136));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_KR_KRW_Ewallet_Payco, @pc_KR_KRW, @cch_KR_KRW_Ewallet_Payco, 'Ewallet_Payco', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Payco', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL AND @cch_KR_KRW_Ewallet_Payco IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_KR_KRW_Ewallet_TOSS := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_TOSS' LIMIT 1);
SET @cch_KR_KRW_Ewallet_TOSS := IF(@pc_KR_KRW IS NULL, NULL, IFNULL(@cch_KR_KRW_Ewallet_TOSS, 2049300000000500137));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_KR_KRW_Ewallet_TOSS, @pc_KR_KRW, 'Ewallet_TOSS', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_KR_KRW_Ewallet_TOSS := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_TOSS' AND `factory_code` = @factory_code AND `factory_channel` = 'TOSS' LIMIT 1);
SET @dt_KR_KRW_Ewallet_TOSS := IF(@pc_KR_KRW IS NULL OR @cch_KR_KRW_Ewallet_TOSS IS NULL, NULL, IFNULL(@dt_KR_KRW_Ewallet_TOSS, 2049300000000600137));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_KR_KRW_Ewallet_TOSS, @pc_KR_KRW, @cch_KR_KRW_Ewallet_TOSS, 'Ewallet_TOSS', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'TOSS', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL AND @cch_KR_KRW_Ewallet_TOSS IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_KR_KRW_Ewallet_SamsungPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_SamsungPay' LIMIT 1);
SET @cch_KR_KRW_Ewallet_SamsungPay := IF(@pc_KR_KRW IS NULL, NULL, IFNULL(@cch_KR_KRW_Ewallet_SamsungPay, 2049300000000500138));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_KR_KRW_Ewallet_SamsungPay, @pc_KR_KRW, 'Ewallet_SamsungPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_KR_KRW_Ewallet_SamsungPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_SamsungPay' AND `factory_code` = @factory_code AND `factory_channel` = 'SamsungPay' LIMIT 1);
SET @dt_KR_KRW_Ewallet_SamsungPay := IF(@pc_KR_KRW IS NULL OR @cch_KR_KRW_Ewallet_SamsungPay IS NULL, NULL, IFNULL(@dt_KR_KRW_Ewallet_SamsungPay, 2049300000000600138));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_KR_KRW_Ewallet_SamsungPay, @pc_KR_KRW, @cch_KR_KRW_Ewallet_SamsungPay, 'Ewallet_SamsungPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'SamsungPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL AND @cch_KR_KRW_Ewallet_SamsungPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_KR_KRW_Ewallet_SSGPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_SSGPay' LIMIT 1);
SET @cch_KR_KRW_Ewallet_SSGPay := IF(@pc_KR_KRW IS NULL, NULL, IFNULL(@cch_KR_KRW_Ewallet_SSGPay, 2049300000000500139));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_KR_KRW_Ewallet_SSGPay, @pc_KR_KRW, 'Ewallet_SSGPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_KR_KRW_Ewallet_SSGPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Ewallet_SSGPay' AND `factory_code` = @factory_code AND `factory_channel` = 'SSGPay' LIMIT 1);
SET @dt_KR_KRW_Ewallet_SSGPay := IF(@pc_KR_KRW IS NULL OR @cch_KR_KRW_Ewallet_SSGPay IS NULL, NULL, IFNULL(@dt_KR_KRW_Ewallet_SSGPay, 2049300000000600139));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_KR_KRW_Ewallet_SSGPay, @pc_KR_KRW, @cch_KR_KRW_Ewallet_SSGPay, 'Ewallet_SSGPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'SSGPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL AND @cch_KR_KRW_Ewallet_SSGPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_KR_KRW_Card_KR_Card := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Card_KR_Card' LIMIT 1);
SET @cch_KR_KRW_Card_KR_Card := IF(@pc_KR_KRW IS NULL, NULL, IFNULL(@cch_KR_KRW_Card_KR_Card, 2049300000000500140));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_KR_KRW_Card_KR_Card, @pc_KR_KRW, 'Card_KR_Card', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_KR_KRW_Card_KR_Card := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_KR_KRW AND `channel_code` = 'Card_KR_Card' AND `factory_code` = @factory_code AND `factory_channel` = 'KR_Card' LIMIT 1);
SET @dt_KR_KRW_Card_KR_Card := IF(@pc_KR_KRW IS NULL OR @cch_KR_KRW_Card_KR_Card IS NULL, NULL, IFNULL(@dt_KR_KRW_Card_KR_Card, 2049300000000600140));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_KR_KRW_Card_KR_Card, @pc_KR_KRW, @cch_KR_KRW_Card_KR_Card, 'Card_KR_Card', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 70, 'KR_Card', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KR_KRW IS NOT NULL AND @cch_KR_KRW_Card_KR_Card IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_KW_KWD_Card_Knet := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_KW_KWD AND `channel_code` = 'Card_Knet' LIMIT 1);
SET @cch_KW_KWD_Card_Knet := IF(@pc_KW_KWD IS NULL, NULL, IFNULL(@cch_KW_KWD_Card_Knet, 2049300000000500141));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_KW_KWD_Card_Knet, @pc_KW_KWD, 'Card_Knet', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KW_KWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_KW_KWD_Card_Knet := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_KW_KWD AND `channel_code` = 'Card_Knet' AND `factory_code` = @factory_code AND `factory_channel` = 'Knet' LIMIT 1);
SET @dt_KW_KWD_Card_Knet := IF(@pc_KW_KWD IS NULL OR @cch_KW_KWD_Card_Knet IS NULL, NULL, IFNULL(@dt_KW_KWD_Card_Knet, 2049300000000600141));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_KW_KWD_Card_Knet, @pc_KW_KWD, @cch_KW_KWD_Card_Knet, 'Card_Knet', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Knet', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KW_KWD IS NOT NULL AND @cch_KW_KWD_Card_Knet IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_KW_KWD_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_KW_KWD AND `channel_code` = 'Ewallet_ApplePay' LIMIT 1);
SET @cch_KW_KWD_Ewallet_ApplePay := IF(@pc_KW_KWD IS NULL, NULL, IFNULL(@cch_KW_KWD_Ewallet_ApplePay, 2049300000000500142));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_KW_KWD_Ewallet_ApplePay, @pc_KW_KWD, 'Ewallet_ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KW_KWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_KW_KWD_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_KW_KWD AND `channel_code` = 'Ewallet_ApplePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ApplePay' LIMIT 1);
SET @dt_KW_KWD_Ewallet_ApplePay := IF(@pc_KW_KWD IS NULL OR @cch_KW_KWD_Ewallet_ApplePay IS NULL, NULL, IFNULL(@dt_KW_KWD_Ewallet_ApplePay, 2049300000000600142));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_KW_KWD_Ewallet_ApplePay, @pc_KW_KWD, @cch_KW_KWD_Ewallet_ApplePay, 'Ewallet_ApplePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_KW_KWD IS NOT NULL AND @cch_KW_KWD_Ewallet_ApplePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LI_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LI_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_LI_EUR_BankTransfer_Paysafecard := IF(@pc_LI_EUR IS NULL, NULL, IFNULL(@cch_LI_EUR_BankTransfer_Paysafecard, 2049300000000500143));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LI_EUR_BankTransfer_Paysafecard, @pc_LI_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LI_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LI_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_LI_EUR_BankTransfer_Paysafecard := IF(@pc_LI_EUR IS NULL OR @cch_LI_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_LI_EUR_BankTransfer_Paysafecard, 2049300000000600143));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LI_EUR_BankTransfer_Paysafecard, @pc_LI_EUR, @cch_LI_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LI_EUR IS NOT NULL AND @cch_LI_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LT_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LT_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_LT_EUR_BankTransfer_Trustly := IF(@pc_LT_EUR IS NULL, NULL, IFNULL(@cch_LT_EUR_BankTransfer_Trustly, 2049300000000500144));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LT_EUR_BankTransfer_Trustly, @pc_LT_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LT_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LT_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_LT_EUR_BankTransfer_Trustly := IF(@pc_LT_EUR IS NULL OR @cch_LT_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_LT_EUR_BankTransfer_Trustly, 2049300000000600144));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LT_EUR_BankTransfer_Trustly, @pc_LT_EUR, @cch_LT_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LT_EUR IS NOT NULL AND @cch_LT_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LT_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LT_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_LT_EUR_BankTransfer_Satispay := IF(@pc_LT_EUR IS NULL, NULL, IFNULL(@cch_LT_EUR_BankTransfer_Satispay, 2049300000000500145));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LT_EUR_BankTransfer_Satispay, @pc_LT_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LT_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LT_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_LT_EUR_BankTransfer_Satispay := IF(@pc_LT_EUR IS NULL OR @cch_LT_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_LT_EUR_BankTransfer_Satispay, 2049300000000600145));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LT_EUR_BankTransfer_Satispay, @pc_LT_EUR, @cch_LT_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LT_EUR IS NOT NULL AND @cch_LT_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LT_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LT_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_LT_EUR_BankTransfer_SEPA := IF(@pc_LT_EUR IS NULL, NULL, IFNULL(@cch_LT_EUR_BankTransfer_SEPA, 2049300000000500146));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LT_EUR_BankTransfer_SEPA, @pc_LT_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LT_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LT_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_LT_EUR_BankTransfer_SEPA := IF(@pc_LT_EUR IS NULL OR @cch_LT_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_LT_EUR_BankTransfer_SEPA, 2049300000000600146));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LT_EUR_BankTransfer_SEPA, @pc_LT_EUR, @cch_LT_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LT_EUR IS NOT NULL AND @cch_LT_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LT_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LT_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_LT_EUR_BankTransfer_Paysafecard := IF(@pc_LT_EUR IS NULL, NULL, IFNULL(@cch_LT_EUR_BankTransfer_Paysafecard, 2049300000000500147));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LT_EUR_BankTransfer_Paysafecard, @pc_LT_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LT_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LT_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_LT_EUR_BankTransfer_Paysafecard := IF(@pc_LT_EUR IS NULL OR @cch_LT_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_LT_EUR_BankTransfer_Paysafecard, 2049300000000600147));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LT_EUR_BankTransfer_Paysafecard, @pc_LT_EUR, @cch_LT_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LT_EUR IS NOT NULL AND @cch_LT_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LU_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LU_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_LU_EUR_BankTransfer_Satispay := IF(@pc_LU_EUR IS NULL, NULL, IFNULL(@cch_LU_EUR_BankTransfer_Satispay, 2049300000000500148));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LU_EUR_BankTransfer_Satispay, @pc_LU_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LU_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LU_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LU_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_LU_EUR_BankTransfer_Satispay := IF(@pc_LU_EUR IS NULL OR @cch_LU_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_LU_EUR_BankTransfer_Satispay, 2049300000000600148));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LU_EUR_BankTransfer_Satispay, @pc_LU_EUR, @cch_LU_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LU_EUR IS NOT NULL AND @cch_LU_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LU_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LU_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_LU_EUR_BankTransfer_SEPA := IF(@pc_LU_EUR IS NULL, NULL, IFNULL(@cch_LU_EUR_BankTransfer_SEPA, 2049300000000500149));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LU_EUR_BankTransfer_SEPA, @pc_LU_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LU_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LU_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LU_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_LU_EUR_BankTransfer_SEPA := IF(@pc_LU_EUR IS NULL OR @cch_LU_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_LU_EUR_BankTransfer_SEPA, 2049300000000600149));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LU_EUR_BankTransfer_SEPA, @pc_LU_EUR, @cch_LU_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LU_EUR IS NOT NULL AND @cch_LU_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LU_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LU_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_LU_EUR_BankTransfer_Paysafecard := IF(@pc_LU_EUR IS NULL, NULL, IFNULL(@cch_LU_EUR_BankTransfer_Paysafecard, 2049300000000500150));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LU_EUR_BankTransfer_Paysafecard, @pc_LU_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LU_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LU_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LU_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_LU_EUR_BankTransfer_Paysafecard := IF(@pc_LU_EUR IS NULL OR @cch_LU_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_LU_EUR_BankTransfer_Paysafecard, 2049300000000600150));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LU_EUR_BankTransfer_Paysafecard, @pc_LU_EUR, @cch_LU_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LU_EUR IS NOT NULL AND @cch_LU_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LU_EUR_Ewallet_Payconiq := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LU_EUR AND `channel_code` = 'Ewallet_Payconiq' LIMIT 1);
SET @cch_LU_EUR_Ewallet_Payconiq := IF(@pc_LU_EUR IS NULL, NULL, IFNULL(@cch_LU_EUR_Ewallet_Payconiq, 2049300000000500151));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LU_EUR_Ewallet_Payconiq, @pc_LU_EUR, 'Ewallet_Payconiq', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LU_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LU_EUR_Ewallet_Payconiq := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LU_EUR AND `channel_code` = 'Ewallet_Payconiq' AND `factory_code` = @factory_code AND `factory_channel` = 'Payconiq' LIMIT 1);
SET @dt_LU_EUR_Ewallet_Payconiq := IF(@pc_LU_EUR IS NULL OR @cch_LU_EUR_Ewallet_Payconiq IS NULL, NULL, IFNULL(@dt_LU_EUR_Ewallet_Payconiq, 2049300000000600151));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LU_EUR_Ewallet_Payconiq, @pc_LU_EUR, @cch_LU_EUR_Ewallet_Payconiq, 'Ewallet_Payconiq', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Payconiq', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LU_EUR IS NOT NULL AND @cch_LU_EUR_Ewallet_Payconiq IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LV_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LV_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_LV_EUR_BankTransfer_Trustly := IF(@pc_LV_EUR IS NULL, NULL, IFNULL(@cch_LV_EUR_BankTransfer_Trustly, 2049300000000500152));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LV_EUR_BankTransfer_Trustly, @pc_LV_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LV_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LV_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LV_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_LV_EUR_BankTransfer_Trustly := IF(@pc_LV_EUR IS NULL OR @cch_LV_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_LV_EUR_BankTransfer_Trustly, 2049300000000600152));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LV_EUR_BankTransfer_Trustly, @pc_LV_EUR, @cch_LV_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LV_EUR IS NOT NULL AND @cch_LV_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LV_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LV_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_LV_EUR_BankTransfer_Satispay := IF(@pc_LV_EUR IS NULL, NULL, IFNULL(@cch_LV_EUR_BankTransfer_Satispay, 2049300000000500153));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LV_EUR_BankTransfer_Satispay, @pc_LV_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LV_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LV_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LV_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_LV_EUR_BankTransfer_Satispay := IF(@pc_LV_EUR IS NULL OR @cch_LV_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_LV_EUR_BankTransfer_Satispay, 2049300000000600153));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LV_EUR_BankTransfer_Satispay, @pc_LV_EUR, @cch_LV_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LV_EUR IS NOT NULL AND @cch_LV_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LV_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LV_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_LV_EUR_BankTransfer_SEPA := IF(@pc_LV_EUR IS NULL, NULL, IFNULL(@cch_LV_EUR_BankTransfer_SEPA, 2049300000000500154));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LV_EUR_BankTransfer_SEPA, @pc_LV_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LV_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LV_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LV_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_LV_EUR_BankTransfer_SEPA := IF(@pc_LV_EUR IS NULL OR @cch_LV_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_LV_EUR_BankTransfer_SEPA, 2049300000000600154));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LV_EUR_BankTransfer_SEPA, @pc_LV_EUR, @cch_LV_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LV_EUR IS NOT NULL AND @cch_LV_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_LV_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_LV_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_LV_EUR_BankTransfer_Paysafecard := IF(@pc_LV_EUR IS NULL, NULL, IFNULL(@cch_LV_EUR_BankTransfer_Paysafecard, 2049300000000500155));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_LV_EUR_BankTransfer_Paysafecard, @pc_LV_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LV_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_LV_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_LV_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_LV_EUR_BankTransfer_Paysafecard := IF(@pc_LV_EUR IS NULL OR @cch_LV_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_LV_EUR_BankTransfer_Paysafecard, 2049300000000600155));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_LV_EUR_BankTransfer_Paysafecard, @pc_LV_EUR, @cch_LV_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_LV_EUR IS NOT NULL AND @cch_LV_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MN_USD_Ewallet_HiPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MN_USD AND `channel_code` = 'Ewallet_HiPay' LIMIT 1);
SET @cch_MN_USD_Ewallet_HiPay := IF(@pc_MN_USD IS NULL, NULL, IFNULL(@cch_MN_USD_Ewallet_HiPay, 2049300000000500156));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MN_USD_Ewallet_HiPay, @pc_MN_USD, 'Ewallet_HiPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MN_USD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MN_USD_Ewallet_HiPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MN_USD AND `channel_code` = 'Ewallet_HiPay' AND `factory_code` = @factory_code AND `factory_channel` = 'HiPay' LIMIT 1);
SET @dt_MN_USD_Ewallet_HiPay := IF(@pc_MN_USD IS NULL OR @cch_MN_USD_Ewallet_HiPay IS NULL, NULL, IFNULL(@dt_MN_USD_Ewallet_HiPay, 2049300000000600156));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MN_USD_Ewallet_HiPay, @pc_MN_USD, @cch_MN_USD_Ewallet_HiPay, 'Ewallet_HiPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'HiPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MN_USD IS NOT NULL AND @cch_MN_USD_Ewallet_HiPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MT_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MT_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_MT_EUR_BankTransfer_Satispay := IF(@pc_MT_EUR IS NULL, NULL, IFNULL(@cch_MT_EUR_BankTransfer_Satispay, 2049300000000500157));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MT_EUR_BankTransfer_Satispay, @pc_MT_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MT_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MT_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_MT_EUR_BankTransfer_Satispay := IF(@pc_MT_EUR IS NULL OR @cch_MT_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_MT_EUR_BankTransfer_Satispay, 2049300000000600157));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MT_EUR_BankTransfer_Satispay, @pc_MT_EUR, @cch_MT_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MT_EUR IS NOT NULL AND @cch_MT_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MT_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MT_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_MT_EUR_BankTransfer_SEPA := IF(@pc_MT_EUR IS NULL, NULL, IFNULL(@cch_MT_EUR_BankTransfer_SEPA, 2049300000000500158));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MT_EUR_BankTransfer_SEPA, @pc_MT_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MT_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MT_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_MT_EUR_BankTransfer_SEPA := IF(@pc_MT_EUR IS NULL OR @cch_MT_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_MT_EUR_BankTransfer_SEPA, 2049300000000600158));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MT_EUR_BankTransfer_SEPA, @pc_MT_EUR, @cch_MT_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MT_EUR IS NOT NULL AND @cch_MT_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MT_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MT_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_MT_EUR_BankTransfer_Paysafecard := IF(@pc_MT_EUR IS NULL, NULL, IFNULL(@cch_MT_EUR_BankTransfer_Paysafecard, 2049300000000500159));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MT_EUR_BankTransfer_Paysafecard, @pc_MT_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MT_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MT_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_MT_EUR_BankTransfer_Paysafecard := IF(@pc_MT_EUR IS NULL OR @cch_MT_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_MT_EUR_BankTransfer_Paysafecard, 2049300000000600159));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MT_EUR_BankTransfer_Paysafecard, @pc_MT_EUR, @cch_MT_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MT_EUR IS NOT NULL AND @cch_MT_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MX_MXN_Ewallet_Todito := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MX_MXN AND `channel_code` = 'Ewallet_Todito' LIMIT 1);
SET @cch_MX_MXN_Ewallet_Todito := IF(@pc_MX_MXN IS NULL, NULL, IFNULL(@cch_MX_MXN_Ewallet_Todito, 2049300000000500160));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MX_MXN_Ewallet_Todito, @pc_MX_MXN, 'Ewallet_Todito', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MX_MXN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MX_MXN_Ewallet_Todito := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MX_MXN AND `channel_code` = 'Ewallet_Todito' AND `factory_code` = @factory_code AND `factory_channel` = 'Todito' LIMIT 1);
SET @dt_MX_MXN_Ewallet_Todito := IF(@pc_MX_MXN IS NULL OR @cch_MX_MXN_Ewallet_Todito IS NULL, NULL, IFNULL(@dt_MX_MXN_Ewallet_Todito, 2049300000000600160));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MX_MXN_Ewallet_Todito, @pc_MX_MXN, @cch_MX_MXN_Ewallet_Todito, 'Ewallet_Todito', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Todito', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MX_MXN IS NOT NULL AND @cch_MX_MXN_Ewallet_Todito IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MX_MXN_Ewallet_CoDi := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MX_MXN AND `channel_code` = 'Ewallet_CoDi' LIMIT 1);
SET @cch_MX_MXN_Ewallet_CoDi := IF(@pc_MX_MXN IS NULL, NULL, IFNULL(@cch_MX_MXN_Ewallet_CoDi, 2049300000000500161));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MX_MXN_Ewallet_CoDi, @pc_MX_MXN, 'Ewallet_CoDi', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MX_MXN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MX_MXN_Ewallet_CoDi := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MX_MXN AND `channel_code` = 'Ewallet_CoDi' AND `factory_code` = @factory_code AND `factory_channel` = 'CoDi' LIMIT 1);
SET @dt_MX_MXN_Ewallet_CoDi := IF(@pc_MX_MXN IS NULL OR @cch_MX_MXN_Ewallet_CoDi IS NULL, NULL, IFNULL(@dt_MX_MXN_Ewallet_CoDi, 2049300000000600161));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MX_MXN_Ewallet_CoDi, @pc_MX_MXN, @cch_MX_MXN_Ewallet_CoDi, 'Ewallet_CoDi', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'CoDi', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MX_MXN IS NOT NULL AND @cch_MX_MXN_Ewallet_CoDi IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MX_MXN_BankTransfer_SPEI := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MX_MXN AND `channel_code` = 'BankTransfer_SPEI' LIMIT 1);
SET @cch_MX_MXN_BankTransfer_SPEI := IF(@pc_MX_MXN IS NULL, NULL, IFNULL(@cch_MX_MXN_BankTransfer_SPEI, 2049300000000500162));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MX_MXN_BankTransfer_SPEI, @pc_MX_MXN, 'BankTransfer_SPEI', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MX_MXN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MX_MXN_BankTransfer_SPEI := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MX_MXN AND `channel_code` = 'BankTransfer_SPEI' AND `factory_code` = @factory_code AND `factory_channel` = 'SPEI' LIMIT 1);
SET @dt_MX_MXN_BankTransfer_SPEI := IF(@pc_MX_MXN IS NULL OR @cch_MX_MXN_BankTransfer_SPEI IS NULL, NULL, IFNULL(@dt_MX_MXN_BankTransfer_SPEI, 2049300000000600162));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MX_MXN_BankTransfer_SPEI, @pc_MX_MXN, @cch_MX_MXN_BankTransfer_SPEI, 'BankTransfer_SPEI', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SPEI', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MX_MXN IS NOT NULL AND @cch_MX_MXN_BankTransfer_SPEI IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MX_MXN_OTC_OXXOPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MX_MXN AND `channel_code` = 'OTC_OXXOPay' LIMIT 1);
SET @cch_MX_MXN_OTC_OXXOPay := IF(@pc_MX_MXN IS NULL, NULL, IFNULL(@cch_MX_MXN_OTC_OXXOPay, 2049300000000500163));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MX_MXN_OTC_OXXOPay, @pc_MX_MXN, 'OTC_OXXOPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MX_MXN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MX_MXN_OTC_OXXOPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MX_MXN AND `channel_code` = 'OTC_OXXOPay' AND `factory_code` = @factory_code AND `factory_channel` = 'OXXOPay' LIMIT 1);
SET @dt_MX_MXN_OTC_OXXOPay := IF(@pc_MX_MXN IS NULL OR @cch_MX_MXN_OTC_OXXOPay IS NULL, NULL, IFNULL(@dt_MX_MXN_OTC_OXXOPay, 2049300000000600163));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MX_MXN_OTC_OXXOPay, @pc_MX_MXN, @cch_MX_MXN_OTC_OXXOPay, 'OTC_OXXOPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'OXXOPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MX_MXN IS NOT NULL AND @cch_MX_MXN_OTC_OXXOPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_Ewallet_TNG := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'Ewallet_TNG' LIMIT 1);
SET @cch_MY_MYR_Ewallet_TNG := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_Ewallet_TNG, 2049300000000500164));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_Ewallet_TNG, @pc_MY_MYR, 'Ewallet_TNG', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_Ewallet_TNG := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'Ewallet_TNG' AND `factory_code` = @factory_code AND `factory_channel` = 'TNG' LIMIT 1);
SET @dt_MY_MYR_Ewallet_TNG := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_Ewallet_TNG IS NULL, NULL, IFNULL(@dt_MY_MYR_Ewallet_TNG, 2049300000000600164));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_Ewallet_TNG, @pc_MY_MYR, @cch_MY_MYR_Ewallet_TNG, 'Ewallet_TNG', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'TNG', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_Ewallet_TNG IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_Ewallet_BOOST := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'Ewallet_BOOST' LIMIT 1);
SET @cch_MY_MYR_Ewallet_BOOST := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_Ewallet_BOOST, 2049300000000500165));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_Ewallet_BOOST, @pc_MY_MYR, 'Ewallet_BOOST', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_Ewallet_BOOST := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'Ewallet_BOOST' AND `factory_code` = @factory_code AND `factory_channel` = 'BOOST' LIMIT 1);
SET @dt_MY_MYR_Ewallet_BOOST := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_Ewallet_BOOST IS NULL, NULL, IFNULL(@dt_MY_MYR_Ewallet_BOOST, 2049300000000600165));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_Ewallet_BOOST, @pc_MY_MYR, @cch_MY_MYR_Ewallet_BOOST, 'Ewallet_BOOST', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'BOOST', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_Ewallet_BOOST IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_Ewallet_GrabPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'Ewallet_GrabPay' LIMIT 1);
SET @cch_MY_MYR_Ewallet_GrabPay := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_Ewallet_GrabPay, 2049300000000500166));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_Ewallet_GrabPay, @pc_MY_MYR, 'Ewallet_GrabPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_Ewallet_GrabPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'Ewallet_GrabPay' AND `factory_code` = @factory_code AND `factory_channel` = 'GrabPay' LIMIT 1);
SET @dt_MY_MYR_Ewallet_GrabPay := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_Ewallet_GrabPay IS NULL, NULL, IFNULL(@dt_MY_MYR_Ewallet_GrabPay, 2049300000000600166));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_Ewallet_GrabPay, @pc_MY_MYR, @cch_MY_MYR_Ewallet_GrabPay, 'Ewallet_GrabPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'GrabPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_Ewallet_GrabPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'Ewallet_ShopeePay' LIMIT 1);
SET @cch_MY_MYR_Ewallet_ShopeePay := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_Ewallet_ShopeePay, 2049300000000500167));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_Ewallet_ShopeePay, @pc_MY_MYR, 'Ewallet_ShopeePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'Ewallet_ShopeePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ShopeePay' LIMIT 1);
SET @dt_MY_MYR_Ewallet_ShopeePay := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_Ewallet_ShopeePay IS NULL, NULL, IFNULL(@dt_MY_MYR_Ewallet_ShopeePay, 2049300000000600167));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_Ewallet_ShopeePay, @pc_MY_MYR, @cch_MY_MYR_Ewallet_ShopeePay, 'Ewallet_ShopeePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'ShopeePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_Ewallet_ShopeePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_Ewallet_MaybankQRpay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'Ewallet_MaybankQRpay' LIMIT 1);
SET @cch_MY_MYR_Ewallet_MaybankQRpay := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_Ewallet_MaybankQRpay, 2049300000000500168));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_Ewallet_MaybankQRpay, @pc_MY_MYR, 'Ewallet_MaybankQRpay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_Ewallet_MaybankQRpay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'Ewallet_MaybankQRpay' AND `factory_code` = @factory_code AND `factory_channel` = 'MaybankQRpay' LIMIT 1);
SET @dt_MY_MYR_Ewallet_MaybankQRpay := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_Ewallet_MaybankQRpay IS NULL, NULL, IFNULL(@dt_MY_MYR_Ewallet_MaybankQRpay, 2049300000000600168));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_Ewallet_MaybankQRpay, @pc_MY_MYR, @cch_MY_MYR_Ewallet_MaybankQRpay, 'Ewallet_MaybankQRpay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'MaybankQRpay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_Ewallet_MaybankQRpay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_QR_DuitNowQR := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'QR_DuitNowQR' LIMIT 1);
SET @cch_MY_MYR_QR_DuitNowQR := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_QR_DuitNowQR, 2049300000000500169));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_QR_DuitNowQR, @pc_MY_MYR, 'QR_DuitNowQR', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_QR_DuitNowQR := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'QR_DuitNowQR' AND `factory_code` = @factory_code AND `factory_channel` = 'DuitNowQR' LIMIT 1);
SET @dt_MY_MYR_QR_DuitNowQR := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_QR_DuitNowQR IS NULL, NULL, IFNULL(@dt_MY_MYR_QR_DuitNowQR, 2049300000000600169));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_QR_DuitNowQR, @pc_MY_MYR, @cch_MY_MYR_QR_DuitNowQR, 'QR_DuitNowQR', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'DuitNowQR', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_QR_DuitNowQR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX, 2049300000000500170));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX, @pc_MY_MYR, 'OnlineBanking_FPX', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX, 2049300000000600170));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX, 'OnlineBanking_FPX', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 70, 'FPX', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_Maybank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_Maybank' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_Maybank := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_Maybank, 2049300000000500171));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_Maybank, @pc_MY_MYR, 'OnlineBanking_FPX_Maybank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_Maybank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_Maybank' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_Maybank' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_Maybank := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_Maybank IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_Maybank, 2049300000000600171));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_Maybank, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_Maybank, 'OnlineBanking_FPX_Maybank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 65, 'FPX_Maybank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_Maybank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_HongLeong := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_HongLeong' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_HongLeong := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_HongLeong, 2049300000000500172));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_HongLeong, @pc_MY_MYR, 'OnlineBanking_FPX_HongLeong', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_HongLeong := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_HongLeong' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_HongLeong' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_HongLeong := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_HongLeong IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_HongLeong, 2049300000000600172));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_HongLeong, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_HongLeong, 'OnlineBanking_FPX_HongLeong', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_HongLeong', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_HongLeong IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_SCB := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_SCB' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_SCB := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_SCB, 2049300000000500173));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_SCB, @pc_MY_MYR, 'OnlineBanking_FPX_SCB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_SCB := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_SCB' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_SCB' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_SCB := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_SCB IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_SCB, 2049300000000600173));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_SCB, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_SCB, 'OnlineBanking_FPX_SCB', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_SCB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_SCB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_KFH := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_KFH' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_KFH := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_KFH, 2049300000000500174));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_KFH, @pc_MY_MYR, 'OnlineBanking_FPX_KFH', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_KFH := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_KFH' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_KFH' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_KFH := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_KFH IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_KFH, 2049300000000600174));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_KFH, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_KFH, 'OnlineBanking_FPX_KFH', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_KFH', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_KFH IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_BSN := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_BSN' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_BSN := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_BSN, 2049300000000500175));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_BSN, @pc_MY_MYR, 'OnlineBanking_FPX_BSN', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_BSN := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_BSN' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_BSN' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_BSN := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_BSN IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_BSN, 2049300000000600175));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_BSN, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_BSN, 'OnlineBanking_FPX_BSN', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_BSN', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_BSN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_BMMB := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_BMMB' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_BMMB := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_BMMB, 2049300000000500176));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_BMMB, @pc_MY_MYR, 'OnlineBanking_FPX_BMMB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_BMMB := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_BMMB' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_BMMB' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_BMMB := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_BMMB IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_BMMB, 2049300000000600176));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_BMMB, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_BMMB, 'OnlineBanking_FPX_BMMB', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_BMMB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_BMMB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_BKRM := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_BKRM' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_BKRM := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_BKRM, 2049300000000500177));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_BKRM, @pc_MY_MYR, 'OnlineBanking_FPX_BKRM', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_BKRM := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_BKRM' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_BKRM' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_BKRM := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_BKRM IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_BKRM, 2049300000000600177));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_BKRM, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_BKRM, 'OnlineBanking_FPX_BKRM', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_BKRM', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_BKRM IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_BIMB := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_BIMB' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_BIMB := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_BIMB, 2049300000000500178));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_BIMB, @pc_MY_MYR, 'OnlineBanking_FPX_BIMB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_BIMB := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_BIMB' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_BIMB' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_BIMB := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_BIMB IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_BIMB, 2049300000000600178));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_BIMB, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_BIMB, 'OnlineBanking_FPX_BIMB', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_BIMB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_BIMB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_ABB := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_ABB' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_ABB := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_ABB, 2049300000000500179));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_ABB, @pc_MY_MYR, 'OnlineBanking_FPX_ABB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_ABB := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_ABB' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_ABB' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_ABB := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_ABB IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_ABB, 2049300000000600179));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_ABB, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_ABB, 'OnlineBanking_FPX_ABB', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_ABB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_ABB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_AGRO := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_AGRO' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_AGRO := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_AGRO, 2049300000000500180));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_AGRO, @pc_MY_MYR, 'OnlineBanking_FPX_AGRO', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_AGRO := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_AGRO' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_AGRO' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_AGRO := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_AGRO IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_AGRO, 2049300000000600180));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_AGRO, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_AGRO, 'OnlineBanking_FPX_AGRO', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_AGRO', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_AGRO IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_BOC := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_BOC' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_BOC := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_BOC, 2049300000000500181));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_BOC, @pc_MY_MYR, 'OnlineBanking_FPX_BOC', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_BOC := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_BOC' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_BOC' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_BOC := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_BOC IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_BOC, 2049300000000600181));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_BOC, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_BOC, 'OnlineBanking_FPX_BOC', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_BOC', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_BOC IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_UOB := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_UOB' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_UOB := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_UOB, 2049300000000500182));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_UOB, @pc_MY_MYR, 'OnlineBanking_FPX_UOB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_UOB := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_UOB' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_UOB' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_UOB := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_UOB IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_UOB, 2049300000000600182));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_UOB, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_UOB, 'OnlineBanking_FPX_UOB', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_UOB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_UOB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_RHB := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_RHB' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_RHB := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_RHB, 2049300000000500183));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_RHB, @pc_MY_MYR, 'OnlineBanking_FPX_RHB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_RHB := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_RHB' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_RHB' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_RHB := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_RHB IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_RHB, 2049300000000600183));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_RHB, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_RHB, 'OnlineBanking_FPX_RHB', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_RHB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_RHB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_PBB := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_PBB' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_PBB := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_PBB, 2049300000000500184));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_PBB, @pc_MY_MYR, 'OnlineBanking_FPX_PBB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_PBB := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_PBB' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_PBB' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_PBB := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_PBB IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_PBB, 2049300000000600184));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_PBB, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_PBB, 'OnlineBanking_FPX_PBB', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_PBB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_PBB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_OCBC := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_OCBC' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_OCBC := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_OCBC, 2049300000000500185));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_OCBC, @pc_MY_MYR, 'OnlineBanking_FPX_OCBC', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_OCBC := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_OCBC' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_OCBC' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_OCBC := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_OCBC IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_OCBC, 2049300000000600185));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_OCBC, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_OCBC, 'OnlineBanking_FPX_OCBC', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_OCBC', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_OCBC IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_MY_MYR_OnlineBanking_FPX_HSBC := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_HSBC' LIMIT 1);
SET @cch_MY_MYR_OnlineBanking_FPX_HSBC := IF(@pc_MY_MYR IS NULL, NULL, IFNULL(@cch_MY_MYR_OnlineBanking_FPX_HSBC, 2049300000000500186));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_MY_MYR_OnlineBanking_FPX_HSBC, @pc_MY_MYR, 'OnlineBanking_FPX_HSBC', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_MY_MYR_OnlineBanking_FPX_HSBC := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_MY_MYR AND `channel_code` = 'OnlineBanking_FPX_HSBC' AND `factory_code` = @factory_code AND `factory_channel` = 'FPX_HSBC' LIMIT 1);
SET @dt_MY_MYR_OnlineBanking_FPX_HSBC := IF(@pc_MY_MYR IS NULL OR @cch_MY_MYR_OnlineBanking_FPX_HSBC IS NULL, NULL, IFNULL(@dt_MY_MYR_OnlineBanking_FPX_HSBC, 2049300000000600186));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_MY_MYR_OnlineBanking_FPX_HSBC, @pc_MY_MYR, @cch_MY_MYR_OnlineBanking_FPX_HSBC, 'OnlineBanking_FPX_HSBC', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'FPX_HSBC', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_MY_MYR IS NOT NULL AND @cch_MY_MYR_OnlineBanking_FPX_HSBC IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_NL_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_NL_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_NL_EUR_BankTransfer_Trustly := IF(@pc_NL_EUR IS NULL, NULL, IFNULL(@cch_NL_EUR_BankTransfer_Trustly, 2049300000000500187));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_NL_EUR_BankTransfer_Trustly, @pc_NL_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_NL_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_NL_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_NL_EUR_BankTransfer_Trustly := IF(@pc_NL_EUR IS NULL OR @cch_NL_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_NL_EUR_BankTransfer_Trustly, 2049300000000600187));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_NL_EUR_BankTransfer_Trustly, @pc_NL_EUR, @cch_NL_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL AND @cch_NL_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_NL_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_NL_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_NL_EUR_BankTransfer_Satispay := IF(@pc_NL_EUR IS NULL, NULL, IFNULL(@cch_NL_EUR_BankTransfer_Satispay, 2049300000000500188));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_NL_EUR_BankTransfer_Satispay, @pc_NL_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_NL_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_NL_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_NL_EUR_BankTransfer_Satispay := IF(@pc_NL_EUR IS NULL OR @cch_NL_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_NL_EUR_BankTransfer_Satispay, 2049300000000600188));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_NL_EUR_BankTransfer_Satispay, @pc_NL_EUR, @cch_NL_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL AND @cch_NL_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_NL_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_NL_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_NL_EUR_BankTransfer_SEPA := IF(@pc_NL_EUR IS NULL, NULL, IFNULL(@cch_NL_EUR_BankTransfer_SEPA, 2049300000000500189));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_NL_EUR_BankTransfer_SEPA, @pc_NL_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_NL_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_NL_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_NL_EUR_BankTransfer_SEPA := IF(@pc_NL_EUR IS NULL OR @cch_NL_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_NL_EUR_BankTransfer_SEPA, 2049300000000600189));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_NL_EUR_BankTransfer_SEPA, @pc_NL_EUR, @cch_NL_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL AND @cch_NL_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_NL_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_NL_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_NL_EUR_BankTransfer_Paysafecard := IF(@pc_NL_EUR IS NULL, NULL, IFNULL(@cch_NL_EUR_BankTransfer_Paysafecard, 2049300000000500190));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_NL_EUR_BankTransfer_Paysafecard, @pc_NL_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_NL_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_NL_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_NL_EUR_BankTransfer_Paysafecard := IF(@pc_NL_EUR IS NULL OR @cch_NL_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_NL_EUR_BankTransfer_Paysafecard, 2049300000000600190));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_NL_EUR_BankTransfer_Paysafecard, @pc_NL_EUR, @cch_NL_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL AND @cch_NL_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_NL_EUR_BankTransfer_iDEAL := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_NL_EUR AND `channel_code` = 'BankTransfer_iDEAL' LIMIT 1);
SET @cch_NL_EUR_BankTransfer_iDEAL := IF(@pc_NL_EUR IS NULL, NULL, IFNULL(@cch_NL_EUR_BankTransfer_iDEAL, 2049300000000500191));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_NL_EUR_BankTransfer_iDEAL, @pc_NL_EUR, 'BankTransfer_iDEAL', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_NL_EUR_BankTransfer_iDEAL := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_NL_EUR AND `channel_code` = 'BankTransfer_iDEAL' AND `factory_code` = @factory_code AND `factory_channel` = 'iDEAL' LIMIT 1);
SET @dt_NL_EUR_BankTransfer_iDEAL := IF(@pc_NL_EUR IS NULL OR @cch_NL_EUR_BankTransfer_iDEAL IS NULL, NULL, IFNULL(@dt_NL_EUR_BankTransfer_iDEAL, 2049300000000600191));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_NL_EUR_BankTransfer_iDEAL, @pc_NL_EUR, @cch_NL_EUR_BankTransfer_iDEAL, 'BankTransfer_iDEAL', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'iDEAL', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NL_EUR IS NOT NULL AND @cch_NL_EUR_BankTransfer_iDEAL IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_NO_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_NO_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_NO_EUR_BankTransfer_Trustly := IF(@pc_NO_EUR IS NULL, NULL, IFNULL(@cch_NO_EUR_BankTransfer_Trustly, 2049300000000500192));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_NO_EUR_BankTransfer_Trustly, @pc_NO_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NO_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_NO_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_NO_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_NO_EUR_BankTransfer_Trustly := IF(@pc_NO_EUR IS NULL OR @cch_NO_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_NO_EUR_BankTransfer_Trustly, 2049300000000600192));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_NO_EUR_BankTransfer_Trustly, @pc_NO_EUR, @cch_NO_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NO_EUR IS NOT NULL AND @cch_NO_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_NP_NPR_Ewallet_Khalti := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_NP_NPR AND `channel_code` = 'Ewallet_Khalti' LIMIT 1);
SET @cch_NP_NPR_Ewallet_Khalti := IF(@pc_NP_NPR IS NULL, NULL, IFNULL(@cch_NP_NPR_Ewallet_Khalti, 2049300000000500193));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_NP_NPR_Ewallet_Khalti, @pc_NP_NPR, 'Ewallet_Khalti', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NP_NPR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_NP_NPR_Ewallet_Khalti := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_NP_NPR AND `channel_code` = 'Ewallet_Khalti' AND `factory_code` = @factory_code AND `factory_channel` = 'Khalti' LIMIT 1);
SET @dt_NP_NPR_Ewallet_Khalti := IF(@pc_NP_NPR IS NULL OR @cch_NP_NPR_Ewallet_Khalti IS NULL, NULL, IFNULL(@dt_NP_NPR_Ewallet_Khalti, 2049300000000600193));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_NP_NPR_Ewallet_Khalti, @pc_NP_NPR, @cch_NP_NPR_Ewallet_Khalti, 'Ewallet_Khalti', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Khalti', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_NP_NPR IS NOT NULL AND @cch_NP_NPR_Ewallet_Khalti IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_OM_OMR_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_OM_OMR AND `channel_code` = 'Card_CreditCard' LIMIT 1);
SET @cch_OM_OMR_Card_CreditCard := IF(@pc_OM_OMR IS NULL, NULL, IFNULL(@cch_OM_OMR_Card_CreditCard, 2049300000000500194));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_OM_OMR_Card_CreditCard, @pc_OM_OMR, 'Card_CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_OM_OMR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_OM_OMR_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_OM_OMR AND `channel_code` = 'Card_CreditCard' AND `factory_code` = @factory_code AND `factory_channel` = 'CreditCard' LIMIT 1);
SET @dt_OM_OMR_Card_CreditCard := IF(@pc_OM_OMR IS NULL OR @cch_OM_OMR_Card_CreditCard IS NULL, NULL, IFNULL(@dt_OM_OMR_Card_CreditCard, 2049300000000600194));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_OM_OMR_Card_CreditCard, @pc_OM_OMR, @cch_OM_OMR_Card_CreditCard, 'Card_CreditCard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_OM_OMR IS NOT NULL AND @cch_OM_OMR_Card_CreditCard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_OM_OMR_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_OM_OMR AND `channel_code` = 'Ewallet_ApplePay' LIMIT 1);
SET @cch_OM_OMR_Ewallet_ApplePay := IF(@pc_OM_OMR IS NULL, NULL, IFNULL(@cch_OM_OMR_Ewallet_ApplePay, 2049300000000500195));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_OM_OMR_Ewallet_ApplePay, @pc_OM_OMR, 'Ewallet_ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_OM_OMR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_OM_OMR_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_OM_OMR AND `channel_code` = 'Ewallet_ApplePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ApplePay' LIMIT 1);
SET @dt_OM_OMR_Ewallet_ApplePay := IF(@pc_OM_OMR IS NULL OR @cch_OM_OMR_Ewallet_ApplePay IS NULL, NULL, IFNULL(@dt_OM_OMR_Ewallet_ApplePay, 2049300000000600195));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_OM_OMR_Ewallet_ApplePay, @pc_OM_OMR, @cch_OM_OMR_Ewallet_ApplePay, 'Ewallet_ApplePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_OM_OMR IS NOT NULL AND @cch_OM_OMR_Ewallet_ApplePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PE_PEN_OTC_Cash := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PE_PEN AND `channel_code` = 'OTC_Cash' LIMIT 1);
SET @cch_PE_PEN_OTC_Cash := IF(@pc_PE_PEN IS NULL, NULL, IFNULL(@cch_PE_PEN_OTC_Cash, 2049300000000500196));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PE_PEN_OTC_Cash, @pc_PE_PEN, 'OTC_Cash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PE_PEN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PE_PEN_OTC_Cash := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PE_PEN AND `channel_code` = 'OTC_Cash' AND `factory_code` = @factory_code AND `factory_channel` = 'Cash' LIMIT 1);
SET @dt_PE_PEN_OTC_Cash := IF(@pc_PE_PEN IS NULL OR @cch_PE_PEN_OTC_Cash IS NULL, NULL, IFNULL(@dt_PE_PEN_OTC_Cash, 2049300000000600196));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PE_PEN_OTC_Cash, @pc_PE_PEN, @cch_PE_PEN_OTC_Cash, 'OTC_Cash', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Cash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PE_PEN IS NOT NULL AND @cch_PE_PEN_OTC_Cash IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PE_PEN_BankTransfer_PE_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PE_PEN AND `channel_code` = 'BankTransfer_PE_BankTransfer' LIMIT 1);
SET @cch_PE_PEN_BankTransfer_PE_BankTransfer := IF(@pc_PE_PEN IS NULL, NULL, IFNULL(@cch_PE_PEN_BankTransfer_PE_BankTransfer, 2049300000000500197));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PE_PEN_BankTransfer_PE_BankTransfer, @pc_PE_PEN, 'BankTransfer_PE_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PE_PEN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PE_PEN_BankTransfer_PE_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PE_PEN AND `channel_code` = 'BankTransfer_PE_BankTransfer' AND `factory_code` = @factory_code AND `factory_channel` = 'PE_BankTransfer' LIMIT 1);
SET @dt_PE_PEN_BankTransfer_PE_BankTransfer := IF(@pc_PE_PEN IS NULL OR @cch_PE_PEN_BankTransfer_PE_BankTransfer IS NULL, NULL, IFNULL(@dt_PE_PEN_BankTransfer_PE_BankTransfer, 2049300000000600197));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PE_PEN_BankTransfer_PE_BankTransfer, @pc_PE_PEN, @cch_PE_PEN_BankTransfer_PE_BankTransfer, 'BankTransfer_PE_BankTransfer', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'PE_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PE_PEN IS NOT NULL AND @cch_PE_PEN_BankTransfer_PE_BankTransfer IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PE_PEN_QR_PEQR := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PE_PEN AND `channel_code` = 'QR_PEQR' LIMIT 1);
SET @cch_PE_PEN_QR_PEQR := IF(@pc_PE_PEN IS NULL, NULL, IFNULL(@cch_PE_PEN_QR_PEQR, 2049300000000500198));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PE_PEN_QR_PEQR, @pc_PE_PEN, 'QR_PEQR', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PE_PEN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PE_PEN_QR_PEQR := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PE_PEN AND `channel_code` = 'QR_PEQR' AND `factory_code` = @factory_code AND `factory_channel` = 'PEQR' LIMIT 1);
SET @dt_PE_PEN_QR_PEQR := IF(@pc_PE_PEN IS NULL OR @cch_PE_PEN_QR_PEQR IS NULL, NULL, IFNULL(@dt_PE_PEN_QR_PEQR, 2049300000000600198));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PE_PEN_QR_PEQR, @pc_PE_PEN, @cch_PE_PEN_QR_PEQR, 'QR_PEQR', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'PEQR', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PE_PEN IS NOT NULL AND @cch_PE_PEN_QR_PEQR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PE_PEN_OnlineBanking_PE_eBank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PE_PEN AND `channel_code` = 'OnlineBanking_PE_eBank' LIMIT 1);
SET @cch_PE_PEN_OnlineBanking_PE_eBank := IF(@pc_PE_PEN IS NULL, NULL, IFNULL(@cch_PE_PEN_OnlineBanking_PE_eBank, 2049300000000500199));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PE_PEN_OnlineBanking_PE_eBank, @pc_PE_PEN, 'OnlineBanking_PE_eBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PE_PEN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PE_PEN_OnlineBanking_PE_eBank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PE_PEN AND `channel_code` = 'OnlineBanking_PE_eBank' AND `factory_code` = @factory_code AND `factory_channel` = 'PE_eBank' LIMIT 1);
SET @dt_PE_PEN_OnlineBanking_PE_eBank := IF(@pc_PE_PEN IS NULL OR @cch_PE_PEN_OnlineBanking_PE_eBank IS NULL, NULL, IFNULL(@dt_PE_PEN_OnlineBanking_PE_eBank, 2049300000000600199));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PE_PEN_OnlineBanking_PE_eBank, @pc_PE_PEN, @cch_PE_PEN_OnlineBanking_PE_eBank, 'OnlineBanking_PE_eBank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'PE_eBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PE_PEN IS NOT NULL AND @cch_PE_PEN_OnlineBanking_PE_eBank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_QR_QRPH := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'QR_QRPH' LIMIT 1);
SET @cch_PH_PHP_QR_QRPH := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_QR_QRPH, 2049300000000500200));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_QR_QRPH, @pc_PH_PHP, 'QR_QRPH', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_QR_QRPH := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'QR_QRPH' AND `factory_code` = @factory_code AND `factory_channel` = 'QRPH' LIMIT 1);
SET @dt_PH_PHP_QR_QRPH := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_QR_QRPH IS NULL, NULL, IFNULL(@dt_PH_PHP_QR_QRPH, 2049300000000600200));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_QR_QRPH, @pc_PH_PHP, @cch_PH_PHP_QR_QRPH, 'QR_QRPH', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'QRPH', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_QR_QRPH IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_Ewallet_Gcash := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'Ewallet_Gcash' LIMIT 1);
SET @cch_PH_PHP_Ewallet_Gcash := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_Ewallet_Gcash, 2049300000000500201));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_Ewallet_Gcash, @pc_PH_PHP, 'Ewallet_Gcash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_Ewallet_Gcash := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'Ewallet_Gcash' AND `factory_code` = @factory_code AND `factory_channel` = 'Gcash' LIMIT 1);
SET @dt_PH_PHP_Ewallet_Gcash := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_Ewallet_Gcash IS NULL, NULL, IFNULL(@dt_PH_PHP_Ewallet_Gcash, 2049300000000600201));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_Ewallet_Gcash, @pc_PH_PHP, @cch_PH_PHP_Ewallet_Gcash, 'Ewallet_Gcash', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Gcash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_Ewallet_Gcash IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_Ewallet_PayMaya := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'Ewallet_PayMaya' LIMIT 1);
SET @cch_PH_PHP_Ewallet_PayMaya := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_Ewallet_PayMaya, 2049300000000500202));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_Ewallet_PayMaya, @pc_PH_PHP, 'Ewallet_PayMaya', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_Ewallet_PayMaya := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'Ewallet_PayMaya' AND `factory_code` = @factory_code AND `factory_channel` = 'PayMaya' LIMIT 1);
SET @dt_PH_PHP_Ewallet_PayMaya := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_Ewallet_PayMaya IS NULL, NULL, IFNULL(@dt_PH_PHP_Ewallet_PayMaya, 2049300000000600202));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_Ewallet_PayMaya, @pc_PH_PHP, @cch_PH_PHP_Ewallet_PayMaya, 'Ewallet_PayMaya', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'PayMaya', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_Ewallet_PayMaya IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_Ewallet_GrabPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'Ewallet_GrabPay' LIMIT 1);
SET @cch_PH_PHP_Ewallet_GrabPay := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_Ewallet_GrabPay, 2049300000000500203));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_Ewallet_GrabPay, @pc_PH_PHP, 'Ewallet_GrabPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_Ewallet_GrabPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'Ewallet_GrabPay' AND `factory_code` = @factory_code AND `factory_channel` = 'GrabPay' LIMIT 1);
SET @dt_PH_PHP_Ewallet_GrabPay := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_Ewallet_GrabPay IS NULL, NULL, IFNULL(@dt_PH_PHP_Ewallet_GrabPay, 2049300000000600203));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_Ewallet_GrabPay, @pc_PH_PHP, @cch_PH_PHP_Ewallet_GrabPay, 'Ewallet_GrabPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'GrabPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_Ewallet_GrabPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_Ewallet_Coins := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'Ewallet_Coins' LIMIT 1);
SET @cch_PH_PHP_Ewallet_Coins := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_Ewallet_Coins, 2049300000000500204));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_Ewallet_Coins, @pc_PH_PHP, 'Ewallet_Coins', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_Ewallet_Coins := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'Ewallet_Coins' AND `factory_code` = @factory_code AND `factory_channel` = 'Coins' LIMIT 1);
SET @dt_PH_PHP_Ewallet_Coins := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_Ewallet_Coins IS NULL, NULL, IFNULL(@dt_PH_PHP_Ewallet_Coins, 2049300000000600204));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_Ewallet_Coins, @pc_PH_PHP, @cch_PH_PHP_Ewallet_Coins, 'Ewallet_Coins', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'Coins', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_Ewallet_Coins IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'Ewallet_ShopeePay' LIMIT 1);
SET @cch_PH_PHP_Ewallet_ShopeePay := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_Ewallet_ShopeePay, 2049300000000500205));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_Ewallet_ShopeePay, @pc_PH_PHP, 'Ewallet_ShopeePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'Ewallet_ShopeePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ShopeePay' LIMIT 1);
SET @dt_PH_PHP_Ewallet_ShopeePay := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_Ewallet_ShopeePay IS NULL, NULL, IFNULL(@dt_PH_PHP_Ewallet_ShopeePay, 2049300000000600205));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_Ewallet_ShopeePay, @pc_PH_PHP, @cch_PH_PHP_Ewallet_ShopeePay, 'Ewallet_ShopeePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'ShopeePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_Ewallet_ShopeePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_OnlineBanking_BPI := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'OnlineBanking_BPI' LIMIT 1);
SET @cch_PH_PHP_OnlineBanking_BPI := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_OnlineBanking_BPI, 2049300000000500206));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_OnlineBanking_BPI, @pc_PH_PHP, 'OnlineBanking_BPI', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_OnlineBanking_BPI := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'OnlineBanking_BPI' AND `factory_code` = @factory_code AND `factory_channel` = 'BPI' LIMIT 1);
SET @dt_PH_PHP_OnlineBanking_BPI := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_OnlineBanking_BPI IS NULL, NULL, IFNULL(@dt_PH_PHP_OnlineBanking_BPI, 2049300000000600206));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_OnlineBanking_BPI, @pc_PH_PHP, @cch_PH_PHP_OnlineBanking_BPI, 'OnlineBanking_BPI', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 70, 'BPI', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_OnlineBanking_BPI IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_OnlineBanking_UBP := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'OnlineBanking_UBP' LIMIT 1);
SET @cch_PH_PHP_OnlineBanking_UBP := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_OnlineBanking_UBP, 2049300000000500207));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_OnlineBanking_UBP, @pc_PH_PHP, 'OnlineBanking_UBP', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_OnlineBanking_UBP := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'OnlineBanking_UBP' AND `factory_code` = @factory_code AND `factory_channel` = 'UBP' LIMIT 1);
SET @dt_PH_PHP_OnlineBanking_UBP := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_OnlineBanking_UBP IS NULL, NULL, IFNULL(@dt_PH_PHP_OnlineBanking_UBP, 2049300000000600207));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_OnlineBanking_UBP, @pc_PH_PHP, @cch_PH_PHP_OnlineBanking_UBP, 'OnlineBanking_UBP', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 65, 'UBP', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_OnlineBanking_UBP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_OnlineBanking_BDO := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'OnlineBanking_BDO' LIMIT 1);
SET @cch_PH_PHP_OnlineBanking_BDO := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_OnlineBanking_BDO, 2049300000000500208));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_OnlineBanking_BDO, @pc_PH_PHP, 'OnlineBanking_BDO', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_OnlineBanking_BDO := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'OnlineBanking_BDO' AND `factory_code` = @factory_code AND `factory_channel` = 'BDO' LIMIT 1);
SET @dt_PH_PHP_OnlineBanking_BDO := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_OnlineBanking_BDO IS NULL, NULL, IFNULL(@dt_PH_PHP_OnlineBanking_BDO, 2049300000000600208));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_OnlineBanking_BDO, @pc_PH_PHP, @cch_PH_PHP_OnlineBanking_BDO, 'OnlineBanking_BDO', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'BDO', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_OnlineBanking_BDO IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_OnlineBanking_ChinaBank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'OnlineBanking_ChinaBank' LIMIT 1);
SET @cch_PH_PHP_OnlineBanking_ChinaBank := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_OnlineBanking_ChinaBank, 2049300000000500209));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_OnlineBanking_ChinaBank, @pc_PH_PHP, 'OnlineBanking_ChinaBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_OnlineBanking_ChinaBank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'OnlineBanking_ChinaBank' AND `factory_code` = @factory_code AND `factory_channel` = 'ChinaBank' LIMIT 1);
SET @dt_PH_PHP_OnlineBanking_ChinaBank := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_OnlineBanking_ChinaBank IS NULL, NULL, IFNULL(@dt_PH_PHP_OnlineBanking_ChinaBank, 2049300000000600209));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_OnlineBanking_ChinaBank, @pc_PH_PHP, @cch_PH_PHP_OnlineBanking_ChinaBank, 'OnlineBanking_ChinaBank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'ChinaBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_OnlineBanking_ChinaBank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_OnlineBanking_RCBC := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'OnlineBanking_RCBC' LIMIT 1);
SET @cch_PH_PHP_OnlineBanking_RCBC := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_OnlineBanking_RCBC, 2049300000000500210));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_OnlineBanking_RCBC, @pc_PH_PHP, 'OnlineBanking_RCBC', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_OnlineBanking_RCBC := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'OnlineBanking_RCBC' AND `factory_code` = @factory_code AND `factory_channel` = 'RCBC' LIMIT 1);
SET @dt_PH_PHP_OnlineBanking_RCBC := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_OnlineBanking_RCBC IS NULL, NULL, IFNULL(@dt_PH_PHP_OnlineBanking_RCBC, 2049300000000600210));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_OnlineBanking_RCBC, @pc_PH_PHP, @cch_PH_PHP_OnlineBanking_RCBC, 'OnlineBanking_RCBC', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'RCBC', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_OnlineBanking_RCBC IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PH_PHP_BNPL_BillEase := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'BNPL_BillEase' LIMIT 1);
SET @cch_PH_PHP_BNPL_BillEase := IF(@pc_PH_PHP IS NULL, NULL, IFNULL(@cch_PH_PHP_BNPL_BillEase, 2049300000000500211));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PH_PHP_BNPL_BillEase, @pc_PH_PHP, 'BNPL_BillEase', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PH_PHP_BNPL_BillEase := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PH_PHP AND `channel_code` = 'BNPL_BillEase' AND `factory_code` = @factory_code AND `factory_channel` = 'BillEase' LIMIT 1);
SET @dt_PH_PHP_BNPL_BillEase := IF(@pc_PH_PHP IS NULL OR @cch_PH_PHP_BNPL_BillEase IS NULL, NULL, IFNULL(@dt_PH_PHP_BNPL_BillEase, 2049300000000600211));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PH_PHP_BNPL_BillEase, @pc_PH_PHP, @cch_PH_PHP_BNPL_BillEase, 'BNPL_BillEase', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'BillEase', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PH_PHP IS NOT NULL AND @cch_PH_PHP_BNPL_BillEase IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PK_PKR_BankTransfer_Alfa := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PK_PKR AND `channel_code` = 'BankTransfer_Alfa' LIMIT 1);
SET @cch_PK_PKR_BankTransfer_Alfa := IF(@pc_PK_PKR IS NULL, NULL, IFNULL(@cch_PK_PKR_BankTransfer_Alfa, 2049300000000500212));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PK_PKR_BankTransfer_Alfa, @pc_PK_PKR, 'BankTransfer_Alfa', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PK_PKR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PK_PKR_BankTransfer_Alfa := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PK_PKR AND `channel_code` = 'BankTransfer_Alfa' AND `factory_code` = @factory_code AND `factory_channel` = 'Alfa' LIMIT 1);
SET @dt_PK_PKR_BankTransfer_Alfa := IF(@pc_PK_PKR IS NULL OR @cch_PK_PKR_BankTransfer_Alfa IS NULL, NULL, IFNULL(@dt_PK_PKR_BankTransfer_Alfa, 2049300000000600212));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PK_PKR_BankTransfer_Alfa, @pc_PK_PKR, @cch_PK_PKR_BankTransfer_Alfa, 'BankTransfer_Alfa', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Alfa', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PK_PKR IS NOT NULL AND @cch_PK_PKR_BankTransfer_Alfa IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PK_PKR_BankTransfer_HBLKonnect := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PK_PKR AND `channel_code` = 'BankTransfer_HBLKonnect' LIMIT 1);
SET @cch_PK_PKR_BankTransfer_HBLKonnect := IF(@pc_PK_PKR IS NULL, NULL, IFNULL(@cch_PK_PKR_BankTransfer_HBLKonnect, 2049300000000500213));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PK_PKR_BankTransfer_HBLKonnect, @pc_PK_PKR, 'BankTransfer_HBLKonnect', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PK_PKR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PK_PKR_BankTransfer_HBLKonnect := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PK_PKR AND `channel_code` = 'BankTransfer_HBLKonnect' AND `factory_code` = @factory_code AND `factory_channel` = 'HBLKonnect' LIMIT 1);
SET @dt_PK_PKR_BankTransfer_HBLKonnect := IF(@pc_PK_PKR IS NULL OR @cch_PK_PKR_BankTransfer_HBLKonnect IS NULL, NULL, IFNULL(@dt_PK_PKR_BankTransfer_HBLKonnect, 2049300000000600213));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PK_PKR_BankTransfer_HBLKonnect, @pc_PK_PKR, @cch_PK_PKR_BankTransfer_HBLKonnect, 'BankTransfer_HBLKonnect', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'HBLKonnect', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PK_PKR IS NOT NULL AND @cch_PK_PKR_BankTransfer_HBLKonnect IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PK_PKR_Ewallet_JazzCash := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PK_PKR AND `channel_code` = 'Ewallet_JazzCash' LIMIT 1);
SET @cch_PK_PKR_Ewallet_JazzCash := IF(@pc_PK_PKR IS NULL, NULL, IFNULL(@cch_PK_PKR_Ewallet_JazzCash, 2049300000000500214));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PK_PKR_Ewallet_JazzCash, @pc_PK_PKR, 'Ewallet_JazzCash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PK_PKR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PK_PKR_Ewallet_JazzCash := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PK_PKR AND `channel_code` = 'Ewallet_JazzCash' AND `factory_code` = @factory_code AND `factory_channel` = 'JazzCash' LIMIT 1);
SET @dt_PK_PKR_Ewallet_JazzCash := IF(@pc_PK_PKR IS NULL OR @cch_PK_PKR_Ewallet_JazzCash IS NULL, NULL, IFNULL(@dt_PK_PKR_Ewallet_JazzCash, 2049300000000600214));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PK_PKR_Ewallet_JazzCash, @pc_PK_PKR, @cch_PK_PKR_Ewallet_JazzCash, 'Ewallet_JazzCash', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'JazzCash', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PK_PKR IS NOT NULL AND @cch_PK_PKR_Ewallet_JazzCash IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PK_PKR_Ewallet_Easypaisa := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PK_PKR AND `channel_code` = 'Ewallet_Easypaisa' LIMIT 1);
SET @cch_PK_PKR_Ewallet_Easypaisa := IF(@pc_PK_PKR IS NULL, NULL, IFNULL(@cch_PK_PKR_Ewallet_Easypaisa, 2049300000000500215));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PK_PKR_Ewallet_Easypaisa, @pc_PK_PKR, 'Ewallet_Easypaisa', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PK_PKR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PK_PKR_Ewallet_Easypaisa := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PK_PKR AND `channel_code` = 'Ewallet_Easypaisa' AND `factory_code` = @factory_code AND `factory_channel` = 'Easypaisa' LIMIT 1);
SET @dt_PK_PKR_Ewallet_Easypaisa := IF(@pc_PK_PKR IS NULL OR @cch_PK_PKR_Ewallet_Easypaisa IS NULL, NULL, IFNULL(@dt_PK_PKR_Ewallet_Easypaisa, 2049300000000600215));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PK_PKR_Ewallet_Easypaisa, @pc_PK_PKR, @cch_PK_PKR_Ewallet_Easypaisa, 'Ewallet_Easypaisa', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Easypaisa', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PK_PKR IS NOT NULL AND @cch_PK_PKR_Ewallet_Easypaisa IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PL_PLN_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PL_PLN AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_PL_PLN_BankTransfer_Paysafecard := IF(@pc_PL_PLN IS NULL, NULL, IFNULL(@cch_PL_PLN_BankTransfer_Paysafecard, 2049300000000500216));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PL_PLN_BankTransfer_Paysafecard, @pc_PL_PLN, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PL_PLN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PL_PLN_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PL_PLN AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_PL_PLN_BankTransfer_Paysafecard := IF(@pc_PL_PLN IS NULL OR @cch_PL_PLN_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_PL_PLN_BankTransfer_Paysafecard, 2049300000000600216));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PL_PLN_BankTransfer_Paysafecard, @pc_PL_PLN, @cch_PL_PLN_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PL_PLN IS NOT NULL AND @cch_PL_PLN_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PL_PLN_BankTransfer_BLIK := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PL_PLN AND `channel_code` = 'BankTransfer_BLIK' LIMIT 1);
SET @cch_PL_PLN_BankTransfer_BLIK := IF(@pc_PL_PLN IS NULL, NULL, IFNULL(@cch_PL_PLN_BankTransfer_BLIK, 2049300000000500217));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PL_PLN_BankTransfer_BLIK, @pc_PL_PLN, 'BankTransfer_BLIK', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PL_PLN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PL_PLN_BankTransfer_BLIK := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PL_PLN AND `channel_code` = 'BankTransfer_BLIK' AND `factory_code` = @factory_code AND `factory_channel` = 'BLIK' LIMIT 1);
SET @dt_PL_PLN_BankTransfer_BLIK := IF(@pc_PL_PLN IS NULL OR @cch_PL_PLN_BankTransfer_BLIK IS NULL, NULL, IFNULL(@dt_PL_PLN_BankTransfer_BLIK, 2049300000000600217));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PL_PLN_BankTransfer_BLIK, @pc_PL_PLN, @cch_PL_PLN_BankTransfer_BLIK, 'BankTransfer_BLIK', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'BLIK', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PL_PLN IS NOT NULL AND @cch_PL_PLN_BankTransfer_BLIK IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PL_PLN_BankTransfer_PayU := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PL_PLN AND `channel_code` = 'BankTransfer_PayU' LIMIT 1);
SET @cch_PL_PLN_BankTransfer_PayU := IF(@pc_PL_PLN IS NULL, NULL, IFNULL(@cch_PL_PLN_BankTransfer_PayU, 2049300000000500218));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PL_PLN_BankTransfer_PayU, @pc_PL_PLN, 'BankTransfer_PayU', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PL_PLN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PL_PLN_BankTransfer_PayU := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PL_PLN AND `channel_code` = 'BankTransfer_PayU' AND `factory_code` = @factory_code AND `factory_channel` = 'PayU' LIMIT 1);
SET @dt_PL_PLN_BankTransfer_PayU := IF(@pc_PL_PLN IS NULL OR @cch_PL_PLN_BankTransfer_PayU IS NULL, NULL, IFNULL(@dt_PL_PLN_BankTransfer_PayU, 2049300000000600218));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PL_PLN_BankTransfer_PayU, @pc_PL_PLN, @cch_PL_PLN_BankTransfer_PayU, 'BankTransfer_PayU', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'PayU', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PL_PLN IS NOT NULL AND @cch_PL_PLN_BankTransfer_PayU IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PL_PLN_BankTransfer_Przelewy24 := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PL_PLN AND `channel_code` = 'BankTransfer_Przelewy24' LIMIT 1);
SET @cch_PL_PLN_BankTransfer_Przelewy24 := IF(@pc_PL_PLN IS NULL, NULL, IFNULL(@cch_PL_PLN_BankTransfer_Przelewy24, 2049300000000500219));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PL_PLN_BankTransfer_Przelewy24, @pc_PL_PLN, 'BankTransfer_Przelewy24', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PL_PLN IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PL_PLN_BankTransfer_Przelewy24 := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PL_PLN AND `channel_code` = 'BankTransfer_Przelewy24' AND `factory_code` = @factory_code AND `factory_channel` = 'Przelewy24' LIMIT 1);
SET @dt_PL_PLN_BankTransfer_Przelewy24 := IF(@pc_PL_PLN IS NULL OR @cch_PL_PLN_BankTransfer_Przelewy24 IS NULL, NULL, IFNULL(@dt_PL_PLN_BankTransfer_Przelewy24, 2049300000000600219));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PL_PLN_BankTransfer_Przelewy24, @pc_PL_PLN, @cch_PL_PLN_BankTransfer_Przelewy24, 'BankTransfer_Przelewy24', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Przelewy24', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PL_PLN IS NOT NULL AND @cch_PL_PLN_BankTransfer_Przelewy24 IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PT_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_PT_EUR_BankTransfer_Satispay := IF(@pc_PT_EUR IS NULL, NULL, IFNULL(@cch_PT_EUR_BankTransfer_Satispay, 2049300000000500220));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PT_EUR_BankTransfer_Satispay, @pc_PT_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PT_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_PT_EUR_BankTransfer_Satispay := IF(@pc_PT_EUR IS NULL OR @cch_PT_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_PT_EUR_BankTransfer_Satispay, 2049300000000600220));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PT_EUR_BankTransfer_Satispay, @pc_PT_EUR, @cch_PT_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL AND @cch_PT_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PT_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_PT_EUR_BankTransfer_SEPA := IF(@pc_PT_EUR IS NULL, NULL, IFNULL(@cch_PT_EUR_BankTransfer_SEPA, 2049300000000500221));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PT_EUR_BankTransfer_SEPA, @pc_PT_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PT_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_PT_EUR_BankTransfer_SEPA := IF(@pc_PT_EUR IS NULL OR @cch_PT_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_PT_EUR_BankTransfer_SEPA, 2049300000000600221));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PT_EUR_BankTransfer_SEPA, @pc_PT_EUR, @cch_PT_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL AND @cch_PT_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PT_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_PT_EUR_BankTransfer_Paysafecard := IF(@pc_PT_EUR IS NULL, NULL, IFNULL(@cch_PT_EUR_BankTransfer_Paysafecard, 2049300000000500222));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PT_EUR_BankTransfer_Paysafecard, @pc_PT_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PT_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_PT_EUR_BankTransfer_Paysafecard := IF(@pc_PT_EUR IS NULL OR @cch_PT_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_PT_EUR_BankTransfer_Paysafecard, 2049300000000600222));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PT_EUR_BankTransfer_Paysafecard, @pc_PT_EUR, @cch_PT_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL AND @cch_PT_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PT_EUR_Ewallet_Multibanco := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'Ewallet_Multibanco' LIMIT 1);
SET @cch_PT_EUR_Ewallet_Multibanco := IF(@pc_PT_EUR IS NULL, NULL, IFNULL(@cch_PT_EUR_Ewallet_Multibanco, 2049300000000500223));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PT_EUR_Ewallet_Multibanco, @pc_PT_EUR, 'Ewallet_Multibanco', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PT_EUR_Ewallet_Multibanco := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'Ewallet_Multibanco' AND `factory_code` = @factory_code AND `factory_channel` = 'Multibanco' LIMIT 1);
SET @dt_PT_EUR_Ewallet_Multibanco := IF(@pc_PT_EUR IS NULL OR @cch_PT_EUR_Ewallet_Multibanco IS NULL, NULL, IFNULL(@dt_PT_EUR_Ewallet_Multibanco, 2049300000000600223));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PT_EUR_Ewallet_Multibanco, @pc_PT_EUR, @cch_PT_EUR_Ewallet_Multibanco, 'Ewallet_Multibanco', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Multibanco', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL AND @cch_PT_EUR_Ewallet_Multibanco IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PT_EUR_Ewallet_MBWay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'Ewallet_MBWay' LIMIT 1);
SET @cch_PT_EUR_Ewallet_MBWay := IF(@pc_PT_EUR IS NULL, NULL, IFNULL(@cch_PT_EUR_Ewallet_MBWay, 2049300000000500224));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PT_EUR_Ewallet_MBWay, @pc_PT_EUR, 'Ewallet_MBWay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PT_EUR_Ewallet_MBWay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'Ewallet_MBWay' AND `factory_code` = @factory_code AND `factory_channel` = 'MBWay' LIMIT 1);
SET @dt_PT_EUR_Ewallet_MBWay := IF(@pc_PT_EUR IS NULL OR @cch_PT_EUR_Ewallet_MBWay IS NULL, NULL, IFNULL(@dt_PT_EUR_Ewallet_MBWay, 2049300000000600224));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PT_EUR_Ewallet_MBWay, @pc_PT_EUR, @cch_PT_EUR_Ewallet_MBWay, 'Ewallet_MBWay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'MBWay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL AND @cch_PT_EUR_Ewallet_MBWay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_PT_EUR_BankTransfer_MyBank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'BankTransfer_MyBank' LIMIT 1);
SET @cch_PT_EUR_BankTransfer_MyBank := IF(@pc_PT_EUR IS NULL, NULL, IFNULL(@cch_PT_EUR_BankTransfer_MyBank, 2049300000000500225));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_PT_EUR_BankTransfer_MyBank, @pc_PT_EUR, 'BankTransfer_MyBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_PT_EUR_BankTransfer_MyBank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_PT_EUR AND `channel_code` = 'BankTransfer_MyBank' AND `factory_code` = @factory_code AND `factory_channel` = 'MyBank' LIMIT 1);
SET @dt_PT_EUR_BankTransfer_MyBank := IF(@pc_PT_EUR IS NULL OR @cch_PT_EUR_BankTransfer_MyBank IS NULL, NULL, IFNULL(@dt_PT_EUR_BankTransfer_MyBank, 2049300000000600225));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_PT_EUR_BankTransfer_MyBank, @pc_PT_EUR, @cch_PT_EUR_BankTransfer_MyBank, 'BankTransfer_MyBank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'MyBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_PT_EUR IS NOT NULL AND @cch_PT_EUR_BankTransfer_MyBank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_QA_QAR_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_QA_QAR AND `channel_code` = 'Card_CreditCard' LIMIT 1);
SET @cch_QA_QAR_Card_CreditCard := IF(@pc_QA_QAR IS NULL, NULL, IFNULL(@cch_QA_QAR_Card_CreditCard, 2049300000000500226));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_QA_QAR_Card_CreditCard, @pc_QA_QAR, 'Card_CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_QA_QAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_QA_QAR_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_QA_QAR AND `channel_code` = 'Card_CreditCard' AND `factory_code` = @factory_code AND `factory_channel` = 'CreditCard' LIMIT 1);
SET @dt_QA_QAR_Card_CreditCard := IF(@pc_QA_QAR IS NULL OR @cch_QA_QAR_Card_CreditCard IS NULL, NULL, IFNULL(@dt_QA_QAR_Card_CreditCard, 2049300000000600226));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_QA_QAR_Card_CreditCard, @pc_QA_QAR, @cch_QA_QAR_Card_CreditCard, 'Card_CreditCard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_QA_QAR IS NOT NULL AND @cch_QA_QAR_Card_CreditCard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_QA_QAR_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_QA_QAR AND `channel_code` = 'Ewallet_ApplePay' LIMIT 1);
SET @cch_QA_QAR_Ewallet_ApplePay := IF(@pc_QA_QAR IS NULL, NULL, IFNULL(@cch_QA_QAR_Ewallet_ApplePay, 2049300000000500227));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_QA_QAR_Ewallet_ApplePay, @pc_QA_QAR, 'Ewallet_ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_QA_QAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_QA_QAR_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_QA_QAR AND `channel_code` = 'Ewallet_ApplePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ApplePay' LIMIT 1);
SET @dt_QA_QAR_Ewallet_ApplePay := IF(@pc_QA_QAR IS NULL OR @cch_QA_QAR_Ewallet_ApplePay IS NULL, NULL, IFNULL(@dt_QA_QAR_Ewallet_ApplePay, 2049300000000600227));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_QA_QAR_Ewallet_ApplePay, @pc_QA_QAR, @cch_QA_QAR_Ewallet_ApplePay, 'Ewallet_ApplePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_QA_QAR IS NOT NULL AND @cch_QA_QAR_Ewallet_ApplePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_RO_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_RO_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_RO_EUR_BankTransfer_Satispay := IF(@pc_RO_EUR IS NULL, NULL, IFNULL(@cch_RO_EUR_BankTransfer_Satispay, 2049300000000500228));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_RO_EUR_BankTransfer_Satispay, @pc_RO_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RO_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_RO_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_RO_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_RO_EUR_BankTransfer_Satispay := IF(@pc_RO_EUR IS NULL OR @cch_RO_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_RO_EUR_BankTransfer_Satispay, 2049300000000600228));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_RO_EUR_BankTransfer_Satispay, @pc_RO_EUR, @cch_RO_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RO_EUR IS NOT NULL AND @cch_RO_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_RO_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_RO_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_RO_EUR_BankTransfer_SEPA := IF(@pc_RO_EUR IS NULL, NULL, IFNULL(@cch_RO_EUR_BankTransfer_SEPA, 2049300000000500229));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_RO_EUR_BankTransfer_SEPA, @pc_RO_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RO_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_RO_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_RO_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_RO_EUR_BankTransfer_SEPA := IF(@pc_RO_EUR IS NULL OR @cch_RO_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_RO_EUR_BankTransfer_SEPA, 2049300000000600229));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_RO_EUR_BankTransfer_SEPA, @pc_RO_EUR, @cch_RO_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RO_EUR IS NOT NULL AND @cch_RO_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_RO_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_RO_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_RO_EUR_BankTransfer_Paysafecard := IF(@pc_RO_EUR IS NULL, NULL, IFNULL(@cch_RO_EUR_BankTransfer_Paysafecard, 2049300000000500230));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_RO_EUR_BankTransfer_Paysafecard, @pc_RO_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RO_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_RO_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_RO_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_RO_EUR_BankTransfer_Paysafecard := IF(@pc_RO_EUR IS NULL OR @cch_RO_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_RO_EUR_BankTransfer_Paysafecard, 2049300000000600230));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_RO_EUR_BankTransfer_Paysafecard, @pc_RO_EUR, @cch_RO_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RO_EUR IS NOT NULL AND @cch_RO_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_RU_RUB_Ewallet_SBP := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_RU_RUB AND `channel_code` = 'Ewallet_SBP' LIMIT 1);
SET @cch_RU_RUB_Ewallet_SBP := IF(@pc_RU_RUB IS NULL, NULL, IFNULL(@cch_RU_RUB_Ewallet_SBP, 2049300000000500231));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_RU_RUB_Ewallet_SBP, @pc_RU_RUB, 'Ewallet_SBP', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_RU_RUB_Ewallet_SBP := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_RU_RUB AND `channel_code` = 'Ewallet_SBP' AND `factory_code` = @factory_code AND `factory_channel` = 'SBP' LIMIT 1);
SET @dt_RU_RUB_Ewallet_SBP := IF(@pc_RU_RUB IS NULL OR @cch_RU_RUB_Ewallet_SBP IS NULL, NULL, IFNULL(@dt_RU_RUB_Ewallet_SBP, 2049300000000600231));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_RU_RUB_Ewallet_SBP, @pc_RU_RUB, @cch_RU_RUB_Ewallet_SBP, 'Ewallet_SBP', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'SBP', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL AND @cch_RU_RUB_Ewallet_SBP IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_RU_RUB_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_RU_RUB AND `channel_code` = 'Card_CreditCard' LIMIT 1);
SET @cch_RU_RUB_Card_CreditCard := IF(@pc_RU_RUB IS NULL, NULL, IFNULL(@cch_RU_RUB_Card_CreditCard, 2049300000000500232));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_RU_RUB_Card_CreditCard, @pc_RU_RUB, 'Card_CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_RU_RUB_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_RU_RUB AND `channel_code` = 'Card_CreditCard' AND `factory_code` = @factory_code AND `factory_channel` = 'CreditCard' LIMIT 1);
SET @dt_RU_RUB_Card_CreditCard := IF(@pc_RU_RUB IS NULL OR @cch_RU_RUB_Card_CreditCard IS NULL, NULL, IFNULL(@dt_RU_RUB_Card_CreditCard, 2049300000000600232));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_RU_RUB_Card_CreditCard, @pc_RU_RUB, @cch_RU_RUB_Card_CreditCard, 'Card_CreditCard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL AND @cch_RU_RUB_Card_CreditCard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_RU_RUB_Ewallet_SberPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_RU_RUB AND `channel_code` = 'Ewallet_SberPay' LIMIT 1);
SET @cch_RU_RUB_Ewallet_SberPay := IF(@pc_RU_RUB IS NULL, NULL, IFNULL(@cch_RU_RUB_Ewallet_SberPay, 2049300000000500233));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_RU_RUB_Ewallet_SberPay, @pc_RU_RUB, 'Ewallet_SberPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_RU_RUB_Ewallet_SberPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_RU_RUB AND `channel_code` = 'Ewallet_SberPay' AND `factory_code` = @factory_code AND `factory_channel` = 'SberPay' LIMIT 1);
SET @dt_RU_RUB_Ewallet_SberPay := IF(@pc_RU_RUB IS NULL OR @cch_RU_RUB_Ewallet_SberPay IS NULL, NULL, IFNULL(@dt_RU_RUB_Ewallet_SberPay, 2049300000000600233));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_RU_RUB_Ewallet_SberPay, @pc_RU_RUB, @cch_RU_RUB_Ewallet_SberPay, 'Ewallet_SberPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SberPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL AND @cch_RU_RUB_Ewallet_SberPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_RU_RUB_Ewallet_TinkoffPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_RU_RUB AND `channel_code` = 'Ewallet_TinkoffPay' LIMIT 1);
SET @cch_RU_RUB_Ewallet_TinkoffPay := IF(@pc_RU_RUB IS NULL, NULL, IFNULL(@cch_RU_RUB_Ewallet_TinkoffPay, 2049300000000500234));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_RU_RUB_Ewallet_TinkoffPay, @pc_RU_RUB, 'Ewallet_TinkoffPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_RU_RUB_Ewallet_TinkoffPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_RU_RUB AND `channel_code` = 'Ewallet_TinkoffPay' AND `factory_code` = @factory_code AND `factory_channel` = 'TinkoffPay' LIMIT 1);
SET @dt_RU_RUB_Ewallet_TinkoffPay := IF(@pc_RU_RUB IS NULL OR @cch_RU_RUB_Ewallet_TinkoffPay IS NULL, NULL, IFNULL(@dt_RU_RUB_Ewallet_TinkoffPay, 2049300000000600234));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_RU_RUB_Ewallet_TinkoffPay, @pc_RU_RUB, @cch_RU_RUB_Ewallet_TinkoffPay, 'Ewallet_TinkoffPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'TinkoffPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL AND @cch_RU_RUB_Ewallet_TinkoffPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_RU_RUB_Ewallet_YooMoney := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_RU_RUB AND `channel_code` = 'Ewallet_YooMoney' LIMIT 1);
SET @cch_RU_RUB_Ewallet_YooMoney := IF(@pc_RU_RUB IS NULL, NULL, IFNULL(@cch_RU_RUB_Ewallet_YooMoney, 2049300000000500235));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_RU_RUB_Ewallet_YooMoney, @pc_RU_RUB, 'Ewallet_YooMoney', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_RU_RUB_Ewallet_YooMoney := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_RU_RUB AND `channel_code` = 'Ewallet_YooMoney' AND `factory_code` = @factory_code AND `factory_channel` = 'YooMoney' LIMIT 1);
SET @dt_RU_RUB_Ewallet_YooMoney := IF(@pc_RU_RUB IS NULL OR @cch_RU_RUB_Ewallet_YooMoney IS NULL, NULL, IFNULL(@dt_RU_RUB_Ewallet_YooMoney, 2049300000000600235));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_RU_RUB_Ewallet_YooMoney, @pc_RU_RUB, @cch_RU_RUB_Ewallet_YooMoney, 'Ewallet_YooMoney', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'YooMoney', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_RU_RUB IS NOT NULL AND @cch_RU_RUB_Ewallet_YooMoney IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SA_SAR_Card_MADA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SA_SAR AND `channel_code` = 'Card_MADA' LIMIT 1);
SET @cch_SA_SAR_Card_MADA := IF(@pc_SA_SAR IS NULL, NULL, IFNULL(@cch_SA_SAR_Card_MADA, 2049300000000500236));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SA_SAR_Card_MADA, @pc_SA_SAR, 'Card_MADA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SA_SAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SA_SAR_Card_MADA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SA_SAR AND `channel_code` = 'Card_MADA' AND `factory_code` = @factory_code AND `factory_channel` = 'MADA' LIMIT 1);
SET @dt_SA_SAR_Card_MADA := IF(@pc_SA_SAR IS NULL OR @cch_SA_SAR_Card_MADA IS NULL, NULL, IFNULL(@dt_SA_SAR_Card_MADA, 2049300000000600236));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SA_SAR_Card_MADA, @pc_SA_SAR, @cch_SA_SAR_Card_MADA, 'Card_MADA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'MADA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SA_SAR IS NOT NULL AND @cch_SA_SAR_Card_MADA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SA_SAR_Ewallet_STCPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SA_SAR AND `channel_code` = 'Ewallet_STCPay' LIMIT 1);
SET @cch_SA_SAR_Ewallet_STCPay := IF(@pc_SA_SAR IS NULL, NULL, IFNULL(@cch_SA_SAR_Ewallet_STCPay, 2049300000000500237));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SA_SAR_Ewallet_STCPay, @pc_SA_SAR, 'Ewallet_STCPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SA_SAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SA_SAR_Ewallet_STCPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SA_SAR AND `channel_code` = 'Ewallet_STCPay' AND `factory_code` = @factory_code AND `factory_channel` = 'STCPay' LIMIT 1);
SET @dt_SA_SAR_Ewallet_STCPay := IF(@pc_SA_SAR IS NULL OR @cch_SA_SAR_Ewallet_STCPay IS NULL, NULL, IFNULL(@dt_SA_SAR_Ewallet_STCPay, 2049300000000600237));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SA_SAR_Ewallet_STCPay, @pc_SA_SAR, @cch_SA_SAR_Ewallet_STCPay, 'Ewallet_STCPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'STCPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SA_SAR IS NOT NULL AND @cch_SA_SAR_Ewallet_STCPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SA_SAR_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SA_SAR AND `channel_code` = 'Ewallet_ApplePay' LIMIT 1);
SET @cch_SA_SAR_Ewallet_ApplePay := IF(@pc_SA_SAR IS NULL, NULL, IFNULL(@cch_SA_SAR_Ewallet_ApplePay, 2049300000000500238));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SA_SAR_Ewallet_ApplePay, @pc_SA_SAR, 'Ewallet_ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SA_SAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SA_SAR_Ewallet_ApplePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SA_SAR AND `channel_code` = 'Ewallet_ApplePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ApplePay' LIMIT 1);
SET @dt_SA_SAR_Ewallet_ApplePay := IF(@pc_SA_SAR IS NULL OR @cch_SA_SAR_Ewallet_ApplePay IS NULL, NULL, IFNULL(@dt_SA_SAR_Ewallet_ApplePay, 2049300000000600238));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SA_SAR_Ewallet_ApplePay, @pc_SA_SAR, @cch_SA_SAR_Ewallet_ApplePay, 'Ewallet_ApplePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'ApplePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SA_SAR IS NOT NULL AND @cch_SA_SAR_Ewallet_ApplePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SE_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SE_EUR AND `channel_code` = 'BankTransfer_Trustly' LIMIT 1);
SET @cch_SE_EUR_BankTransfer_Trustly := IF(@pc_SE_EUR IS NULL, NULL, IFNULL(@cch_SE_EUR_BankTransfer_Trustly, 2049300000000500239));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SE_EUR_BankTransfer_Trustly, @pc_SE_EUR, 'BankTransfer_Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SE_EUR_BankTransfer_Trustly := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SE_EUR AND `channel_code` = 'BankTransfer_Trustly' AND `factory_code` = @factory_code AND `factory_channel` = 'Trustly' LIMIT 1);
SET @dt_SE_EUR_BankTransfer_Trustly := IF(@pc_SE_EUR IS NULL OR @cch_SE_EUR_BankTransfer_Trustly IS NULL, NULL, IFNULL(@dt_SE_EUR_BankTransfer_Trustly, 2049300000000600239));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SE_EUR_BankTransfer_Trustly, @pc_SE_EUR, @cch_SE_EUR_BankTransfer_Trustly, 'BankTransfer_Trustly', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Trustly', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL AND @cch_SE_EUR_BankTransfer_Trustly IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SE_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SE_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_SE_EUR_BankTransfer_Satispay := IF(@pc_SE_EUR IS NULL, NULL, IFNULL(@cch_SE_EUR_BankTransfer_Satispay, 2049300000000500240));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SE_EUR_BankTransfer_Satispay, @pc_SE_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SE_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SE_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_SE_EUR_BankTransfer_Satispay := IF(@pc_SE_EUR IS NULL OR @cch_SE_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_SE_EUR_BankTransfer_Satispay, 2049300000000600240));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SE_EUR_BankTransfer_Satispay, @pc_SE_EUR, @cch_SE_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL AND @cch_SE_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SE_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SE_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_SE_EUR_BankTransfer_SEPA := IF(@pc_SE_EUR IS NULL, NULL, IFNULL(@cch_SE_EUR_BankTransfer_SEPA, 2049300000000500241));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SE_EUR_BankTransfer_SEPA, @pc_SE_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SE_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SE_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_SE_EUR_BankTransfer_SEPA := IF(@pc_SE_EUR IS NULL OR @cch_SE_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_SE_EUR_BankTransfer_SEPA, 2049300000000600241));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SE_EUR_BankTransfer_SEPA, @pc_SE_EUR, @cch_SE_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL AND @cch_SE_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SE_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SE_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_SE_EUR_BankTransfer_Paysafecard := IF(@pc_SE_EUR IS NULL, NULL, IFNULL(@cch_SE_EUR_BankTransfer_Paysafecard, 2049300000000500242));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SE_EUR_BankTransfer_Paysafecard, @pc_SE_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SE_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SE_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_SE_EUR_BankTransfer_Paysafecard := IF(@pc_SE_EUR IS NULL OR @cch_SE_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_SE_EUR_BankTransfer_Paysafecard, 2049300000000600242));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SE_EUR_BankTransfer_Paysafecard, @pc_SE_EUR, @cch_SE_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL AND @cch_SE_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SE_EUR_Ewallet_Swish := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SE_EUR AND `channel_code` = 'Ewallet_Swish' LIMIT 1);
SET @cch_SE_EUR_Ewallet_Swish := IF(@pc_SE_EUR IS NULL, NULL, IFNULL(@cch_SE_EUR_Ewallet_Swish, 2049300000000500243));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SE_EUR_Ewallet_Swish, @pc_SE_EUR, 'Ewallet_Swish', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SE_EUR_Ewallet_Swish := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SE_EUR AND `channel_code` = 'Ewallet_Swish' AND `factory_code` = @factory_code AND `factory_channel` = 'Swish' LIMIT 1);
SET @dt_SE_EUR_Ewallet_Swish := IF(@pc_SE_EUR IS NULL OR @cch_SE_EUR_Ewallet_Swish IS NULL, NULL, IFNULL(@dt_SE_EUR_Ewallet_Swish, 2049300000000600243));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SE_EUR_Ewallet_Swish, @pc_SE_EUR, @cch_SE_EUR_Ewallet_Swish, 'Ewallet_Swish', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'Swish', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SE_EUR IS NOT NULL AND @cch_SE_EUR_Ewallet_Swish IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SG_SGD_Ewallet_PayNow := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SG_SGD AND `channel_code` = 'Ewallet_PayNow' LIMIT 1);
SET @cch_SG_SGD_Ewallet_PayNow := IF(@pc_SG_SGD IS NULL, NULL, IFNULL(@cch_SG_SGD_Ewallet_PayNow, 2049300000000500244));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SG_SGD_Ewallet_PayNow, @pc_SG_SGD, 'Ewallet_PayNow', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SG_SGD_Ewallet_PayNow := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SG_SGD AND `channel_code` = 'Ewallet_PayNow' AND `factory_code` = @factory_code AND `factory_channel` = 'PayNow' LIMIT 1);
SET @dt_SG_SGD_Ewallet_PayNow := IF(@pc_SG_SGD IS NULL OR @cch_SG_SGD_Ewallet_PayNow IS NULL, NULL, IFNULL(@dt_SG_SGD_Ewallet_PayNow, 2049300000000600244));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SG_SGD_Ewallet_PayNow, @pc_SG_SGD, @cch_SG_SGD_Ewallet_PayNow, 'Ewallet_PayNow', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'PayNow', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL AND @cch_SG_SGD_Ewallet_PayNow IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SG_SGD_Ewallet_GrabPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SG_SGD AND `channel_code` = 'Ewallet_GrabPay' LIMIT 1);
SET @cch_SG_SGD_Ewallet_GrabPay := IF(@pc_SG_SGD IS NULL, NULL, IFNULL(@cch_SG_SGD_Ewallet_GrabPay, 2049300000000500245));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SG_SGD_Ewallet_GrabPay, @pc_SG_SGD, 'Ewallet_GrabPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SG_SGD_Ewallet_GrabPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SG_SGD AND `channel_code` = 'Ewallet_GrabPay' AND `factory_code` = @factory_code AND `factory_channel` = 'GrabPay' LIMIT 1);
SET @dt_SG_SGD_Ewallet_GrabPay := IF(@pc_SG_SGD IS NULL OR @cch_SG_SGD_Ewallet_GrabPay IS NULL, NULL, IFNULL(@dt_SG_SGD_Ewallet_GrabPay, 2049300000000600245));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SG_SGD_Ewallet_GrabPay, @pc_SG_SGD, @cch_SG_SGD_Ewallet_GrabPay, 'Ewallet_GrabPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'GrabPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL AND @cch_SG_SGD_Ewallet_GrabPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SG_SGD_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SG_SGD AND `channel_code` = 'Ewallet_ShopeePay' LIMIT 1);
SET @cch_SG_SGD_Ewallet_ShopeePay := IF(@pc_SG_SGD IS NULL, NULL, IFNULL(@cch_SG_SGD_Ewallet_ShopeePay, 2049300000000500246));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SG_SGD_Ewallet_ShopeePay, @pc_SG_SGD, 'Ewallet_ShopeePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SG_SGD_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SG_SGD AND `channel_code` = 'Ewallet_ShopeePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ShopeePay' LIMIT 1);
SET @dt_SG_SGD_Ewallet_ShopeePay := IF(@pc_SG_SGD IS NULL OR @cch_SG_SGD_Ewallet_ShopeePay IS NULL, NULL, IFNULL(@dt_SG_SGD_Ewallet_ShopeePay, 2049300000000600246));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SG_SGD_Ewallet_ShopeePay, @pc_SG_SGD, @cch_SG_SGD_Ewallet_ShopeePay, 'Ewallet_ShopeePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'ShopeePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL AND @cch_SG_SGD_Ewallet_ShopeePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SG_SGD_Ewallet_AlipayH5 := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SG_SGD AND `channel_code` = 'Ewallet_AlipayH5' LIMIT 1);
SET @cch_SG_SGD_Ewallet_AlipayH5 := IF(@pc_SG_SGD IS NULL, NULL, IFNULL(@cch_SG_SGD_Ewallet_AlipayH5, 2049300000000500247));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SG_SGD_Ewallet_AlipayH5, @pc_SG_SGD, 'Ewallet_AlipayH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SG_SGD_Ewallet_AlipayH5 := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SG_SGD AND `channel_code` = 'Ewallet_AlipayH5' AND `factory_code` = @factory_code AND `factory_channel` = 'AlipayH5' LIMIT 1);
SET @dt_SG_SGD_Ewallet_AlipayH5 := IF(@pc_SG_SGD IS NULL OR @cch_SG_SGD_Ewallet_AlipayH5 IS NULL, NULL, IFNULL(@dt_SG_SGD_Ewallet_AlipayH5, 2049300000000600247));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SG_SGD_Ewallet_AlipayH5, @pc_SG_SGD, @cch_SG_SGD_Ewallet_AlipayH5, 'Ewallet_AlipayH5', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'AlipayH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL AND @cch_SG_SGD_Ewallet_AlipayH5 IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SG_SGD_Ewallet_WeChatH5 := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SG_SGD AND `channel_code` = 'Ewallet_WeChatH5' LIMIT 1);
SET @cch_SG_SGD_Ewallet_WeChatH5 := IF(@pc_SG_SGD IS NULL, NULL, IFNULL(@cch_SG_SGD_Ewallet_WeChatH5, 2049300000000500248));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SG_SGD_Ewallet_WeChatH5, @pc_SG_SGD, 'Ewallet_WeChatH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SG_SGD_Ewallet_WeChatH5 := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SG_SGD AND `channel_code` = 'Ewallet_WeChatH5' AND `factory_code` = @factory_code AND `factory_channel` = 'WeChatH5' LIMIT 1);
SET @dt_SG_SGD_Ewallet_WeChatH5 := IF(@pc_SG_SGD IS NULL OR @cch_SG_SGD_Ewallet_WeChatH5 IS NULL, NULL, IFNULL(@dt_SG_SGD_Ewallet_WeChatH5, 2049300000000600248));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SG_SGD_Ewallet_WeChatH5, @pc_SG_SGD, @cch_SG_SGD_Ewallet_WeChatH5, 'Ewallet_WeChatH5', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'WeChatH5', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SG_SGD IS NOT NULL AND @cch_SG_SGD_Ewallet_WeChatH5 IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SI_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SI_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_SI_EUR_BankTransfer_Satispay := IF(@pc_SI_EUR IS NULL, NULL, IFNULL(@cch_SI_EUR_BankTransfer_Satispay, 2049300000000500249));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SI_EUR_BankTransfer_Satispay, @pc_SI_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SI_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SI_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_SI_EUR_BankTransfer_Satispay := IF(@pc_SI_EUR IS NULL OR @cch_SI_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_SI_EUR_BankTransfer_Satispay, 2049300000000600249));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SI_EUR_BankTransfer_Satispay, @pc_SI_EUR, @cch_SI_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SI_EUR IS NOT NULL AND @cch_SI_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SI_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SI_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_SI_EUR_BankTransfer_SEPA := IF(@pc_SI_EUR IS NULL, NULL, IFNULL(@cch_SI_EUR_BankTransfer_SEPA, 2049300000000500250));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SI_EUR_BankTransfer_SEPA, @pc_SI_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SI_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SI_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_SI_EUR_BankTransfer_SEPA := IF(@pc_SI_EUR IS NULL OR @cch_SI_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_SI_EUR_BankTransfer_SEPA, 2049300000000600250));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SI_EUR_BankTransfer_SEPA, @pc_SI_EUR, @cch_SI_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SI_EUR IS NOT NULL AND @cch_SI_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SI_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SI_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_SI_EUR_BankTransfer_Paysafecard := IF(@pc_SI_EUR IS NULL, NULL, IFNULL(@cch_SI_EUR_BankTransfer_Paysafecard, 2049300000000500251));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SI_EUR_BankTransfer_Paysafecard, @pc_SI_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SI_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SI_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SI_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_SI_EUR_BankTransfer_Paysafecard := IF(@pc_SI_EUR IS NULL OR @cch_SI_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_SI_EUR_BankTransfer_Paysafecard, 2049300000000600251));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SI_EUR_BankTransfer_Paysafecard, @pc_SI_EUR, @cch_SI_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SI_EUR IS NOT NULL AND @cch_SI_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SK_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SK_EUR AND `channel_code` = 'BankTransfer_Satispay' LIMIT 1);
SET @cch_SK_EUR_BankTransfer_Satispay := IF(@pc_SK_EUR IS NULL, NULL, IFNULL(@cch_SK_EUR_BankTransfer_Satispay, 2049300000000500252));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SK_EUR_BankTransfer_Satispay, @pc_SK_EUR, 'BankTransfer_Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SK_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SK_EUR_BankTransfer_Satispay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SK_EUR AND `channel_code` = 'BankTransfer_Satispay' AND `factory_code` = @factory_code AND `factory_channel` = 'Satispay' LIMIT 1);
SET @dt_SK_EUR_BankTransfer_Satispay := IF(@pc_SK_EUR IS NULL OR @cch_SK_EUR_BankTransfer_Satispay IS NULL, NULL, IFNULL(@dt_SK_EUR_BankTransfer_Satispay, 2049300000000600252));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SK_EUR_BankTransfer_Satispay, @pc_SK_EUR, @cch_SK_EUR_BankTransfer_Satispay, 'BankTransfer_Satispay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Satispay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SK_EUR IS NOT NULL AND @cch_SK_EUR_BankTransfer_Satispay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SK_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SK_EUR AND `channel_code` = 'BankTransfer_SEPA' LIMIT 1);
SET @cch_SK_EUR_BankTransfer_SEPA := IF(@pc_SK_EUR IS NULL, NULL, IFNULL(@cch_SK_EUR_BankTransfer_SEPA, 2049300000000500253));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SK_EUR_BankTransfer_SEPA, @pc_SK_EUR, 'BankTransfer_SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SK_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SK_EUR_BankTransfer_SEPA := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SK_EUR AND `channel_code` = 'BankTransfer_SEPA' AND `factory_code` = @factory_code AND `factory_channel` = 'SEPA' LIMIT 1);
SET @dt_SK_EUR_BankTransfer_SEPA := IF(@pc_SK_EUR IS NULL OR @cch_SK_EUR_BankTransfer_SEPA IS NULL, NULL, IFNULL(@dt_SK_EUR_BankTransfer_SEPA, 2049300000000600253));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SK_EUR_BankTransfer_SEPA, @pc_SK_EUR, @cch_SK_EUR_BankTransfer_SEPA, 'BankTransfer_SEPA', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'SEPA', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SK_EUR IS NOT NULL AND @cch_SK_EUR_BankTransfer_SEPA IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_SK_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_SK_EUR AND `channel_code` = 'BankTransfer_Paysafecard' LIMIT 1);
SET @cch_SK_EUR_BankTransfer_Paysafecard := IF(@pc_SK_EUR IS NULL, NULL, IFNULL(@cch_SK_EUR_BankTransfer_Paysafecard, 2049300000000500254));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_SK_EUR_BankTransfer_Paysafecard, @pc_SK_EUR, 'BankTransfer_Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SK_EUR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_SK_EUR_BankTransfer_Paysafecard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_SK_EUR AND `channel_code` = 'BankTransfer_Paysafecard' AND `factory_code` = @factory_code AND `factory_channel` = 'Paysafecard' LIMIT 1);
SET @dt_SK_EUR_BankTransfer_Paysafecard := IF(@pc_SK_EUR IS NULL OR @cch_SK_EUR_BankTransfer_Paysafecard IS NULL, NULL, IFNULL(@dt_SK_EUR_BankTransfer_Paysafecard, 2049300000000600254));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_SK_EUR_BankTransfer_Paysafecard, @pc_SK_EUR, @cch_SK_EUR_BankTransfer_Paysafecard, 'BankTransfer_Paysafecard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Paysafecard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_SK_EUR IS NOT NULL AND @cch_SK_EUR_BankTransfer_Paysafecard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TH_THB_QR_PromptpayQR := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'QR_PromptpayQR' LIMIT 1);
SET @cch_TH_THB_QR_PromptpayQR := IF(@pc_TH_THB IS NULL, NULL, IFNULL(@cch_TH_THB_QR_PromptpayQR, 2049300000000500255));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TH_THB_QR_PromptpayQR, @pc_TH_THB, 'QR_PromptpayQR', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TH_THB_QR_PromptpayQR := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'QR_PromptpayQR' AND `factory_code` = @factory_code AND `factory_channel` = 'PromptpayQR' LIMIT 1);
SET @dt_TH_THB_QR_PromptpayQR := IF(@pc_TH_THB IS NULL OR @cch_TH_THB_QR_PromptpayQR IS NULL, NULL, IFNULL(@dt_TH_THB_QR_PromptpayQR, 2049300000000600255));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TH_THB_QR_PromptpayQR, @pc_TH_THB, @cch_TH_THB_QR_PromptpayQR, 'QR_PromptpayQR', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'PromptpayQR', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL AND @cch_TH_THB_QR_PromptpayQR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TH_THB_Ewallet_LinePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'Ewallet_LinePay' LIMIT 1);
SET @cch_TH_THB_Ewallet_LinePay := IF(@pc_TH_THB IS NULL, NULL, IFNULL(@cch_TH_THB_Ewallet_LinePay, 2049300000000500256));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TH_THB_Ewallet_LinePay, @pc_TH_THB, 'Ewallet_LinePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TH_THB_Ewallet_LinePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'Ewallet_LinePay' AND `factory_code` = @factory_code AND `factory_channel` = 'LinePay' LIMIT 1);
SET @dt_TH_THB_Ewallet_LinePay := IF(@pc_TH_THB IS NULL OR @cch_TH_THB_Ewallet_LinePay IS NULL, NULL, IFNULL(@dt_TH_THB_Ewallet_LinePay, 2049300000000600256));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TH_THB_Ewallet_LinePay, @pc_TH_THB, @cch_TH_THB_Ewallet_LinePay, 'Ewallet_LinePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'LinePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL AND @cch_TH_THB_Ewallet_LinePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TH_THB_Ewallet_TrueMoney := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'Ewallet_TrueMoney' LIMIT 1);
SET @cch_TH_THB_Ewallet_TrueMoney := IF(@pc_TH_THB IS NULL, NULL, IFNULL(@cch_TH_THB_Ewallet_TrueMoney, 2049300000000500257));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TH_THB_Ewallet_TrueMoney, @pc_TH_THB, 'Ewallet_TrueMoney', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TH_THB_Ewallet_TrueMoney := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'Ewallet_TrueMoney' AND `factory_code` = @factory_code AND `factory_channel` = 'TrueMoney' LIMIT 1);
SET @dt_TH_THB_Ewallet_TrueMoney := IF(@pc_TH_THB IS NULL OR @cch_TH_THB_Ewallet_TrueMoney IS NULL, NULL, IFNULL(@dt_TH_THB_Ewallet_TrueMoney, 2049300000000600257));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TH_THB_Ewallet_TrueMoney, @pc_TH_THB, @cch_TH_THB_Ewallet_TrueMoney, 'Ewallet_TrueMoney', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'TrueMoney', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL AND @cch_TH_THB_Ewallet_TrueMoney IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TH_THB_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'Ewallet_ShopeePay' LIMIT 1);
SET @cch_TH_THB_Ewallet_ShopeePay := IF(@pc_TH_THB IS NULL, NULL, IFNULL(@cch_TH_THB_Ewallet_ShopeePay, 2049300000000500258));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TH_THB_Ewallet_ShopeePay, @pc_TH_THB, 'Ewallet_ShopeePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TH_THB_Ewallet_ShopeePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'Ewallet_ShopeePay' AND `factory_code` = @factory_code AND `factory_channel` = 'ShopeePay' LIMIT 1);
SET @dt_TH_THB_Ewallet_ShopeePay := IF(@pc_TH_THB IS NULL OR @cch_TH_THB_Ewallet_ShopeePay IS NULL, NULL, IFNULL(@dt_TH_THB_Ewallet_ShopeePay, 2049300000000600258));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TH_THB_Ewallet_ShopeePay, @pc_TH_THB, @cch_TH_THB_Ewallet_ShopeePay, 'Ewallet_ShopeePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'ShopeePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL AND @cch_TH_THB_Ewallet_ShopeePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TH_THB_Ewallet_PromptPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'Ewallet_PromptPay' LIMIT 1);
SET @cch_TH_THB_Ewallet_PromptPay := IF(@pc_TH_THB IS NULL, NULL, IFNULL(@cch_TH_THB_Ewallet_PromptPay, 2049300000000500259));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TH_THB_Ewallet_PromptPay, @pc_TH_THB, 'Ewallet_PromptPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TH_THB_Ewallet_PromptPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'Ewallet_PromptPay' AND `factory_code` = @factory_code AND `factory_channel` = 'PromptPay' LIMIT 1);
SET @dt_TH_THB_Ewallet_PromptPay := IF(@pc_TH_THB IS NULL OR @cch_TH_THB_Ewallet_PromptPay IS NULL, NULL, IFNULL(@dt_TH_THB_Ewallet_PromptPay, 2049300000000600259));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TH_THB_Ewallet_PromptPay, @pc_TH_THB, @cch_TH_THB_Ewallet_PromptPay, 'Ewallet_PromptPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'PromptPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL AND @cch_TH_THB_Ewallet_PromptPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TH_THB_OnlineBanking_Krungsri := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'OnlineBanking_Krungsri' LIMIT 1);
SET @cch_TH_THB_OnlineBanking_Krungsri := IF(@pc_TH_THB IS NULL, NULL, IFNULL(@cch_TH_THB_OnlineBanking_Krungsri, 2049300000000500260));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TH_THB_OnlineBanking_Krungsri, @pc_TH_THB, 'OnlineBanking_Krungsri', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TH_THB_OnlineBanking_Krungsri := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'OnlineBanking_Krungsri' AND `factory_code` = @factory_code AND `factory_channel` = 'Krungsri' LIMIT 1);
SET @dt_TH_THB_OnlineBanking_Krungsri := IF(@pc_TH_THB IS NULL OR @cch_TH_THB_OnlineBanking_Krungsri IS NULL, NULL, IFNULL(@dt_TH_THB_OnlineBanking_Krungsri, 2049300000000600260));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TH_THB_OnlineBanking_Krungsri, @pc_TH_THB, @cch_TH_THB_OnlineBanking_Krungsri, 'OnlineBanking_Krungsri', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'Krungsri', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL AND @cch_TH_THB_OnlineBanking_Krungsri IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TH_THB_OnlineBanking_BangkokBank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'OnlineBanking_BangkokBank' LIMIT 1);
SET @cch_TH_THB_OnlineBanking_BangkokBank := IF(@pc_TH_THB IS NULL, NULL, IFNULL(@cch_TH_THB_OnlineBanking_BangkokBank, 2049300000000500261));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TH_THB_OnlineBanking_BangkokBank, @pc_TH_THB, 'OnlineBanking_BangkokBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TH_THB_OnlineBanking_BangkokBank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'OnlineBanking_BangkokBank' AND `factory_code` = @factory_code AND `factory_channel` = 'BangkokBank' LIMIT 1);
SET @dt_TH_THB_OnlineBanking_BangkokBank := IF(@pc_TH_THB IS NULL OR @cch_TH_THB_OnlineBanking_BangkokBank IS NULL, NULL, IFNULL(@dt_TH_THB_OnlineBanking_BangkokBank, 2049300000000600261));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TH_THB_OnlineBanking_BangkokBank, @pc_TH_THB, @cch_TH_THB_OnlineBanking_BangkokBank, 'OnlineBanking_BangkokBank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 70, 'BangkokBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL AND @cch_TH_THB_OnlineBanking_BangkokBank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TH_THB_OnlineBanking_SCBBank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'OnlineBanking_SCBBank' LIMIT 1);
SET @cch_TH_THB_OnlineBanking_SCBBank := IF(@pc_TH_THB IS NULL, NULL, IFNULL(@cch_TH_THB_OnlineBanking_SCBBank, 2049300000000500262));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TH_THB_OnlineBanking_SCBBank, @pc_TH_THB, 'OnlineBanking_SCBBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TH_THB_OnlineBanking_SCBBank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'OnlineBanking_SCBBank' AND `factory_code` = @factory_code AND `factory_channel` = 'SCBBank' LIMIT 1);
SET @dt_TH_THB_OnlineBanking_SCBBank := IF(@pc_TH_THB IS NULL OR @cch_TH_THB_OnlineBanking_SCBBank IS NULL, NULL, IFNULL(@dt_TH_THB_OnlineBanking_SCBBank, 2049300000000600262));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TH_THB_OnlineBanking_SCBBank, @pc_TH_THB, @cch_TH_THB_OnlineBanking_SCBBank, 'OnlineBanking_SCBBank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 65, 'SCBBank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL AND @cch_TH_THB_OnlineBanking_SCBBank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TH_THB_OnlineBanking_Kasikornbank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'OnlineBanking_Kasikornbank' LIMIT 1);
SET @cch_TH_THB_OnlineBanking_Kasikornbank := IF(@pc_TH_THB IS NULL, NULL, IFNULL(@cch_TH_THB_OnlineBanking_Kasikornbank, 2049300000000500263));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TH_THB_OnlineBanking_Kasikornbank, @pc_TH_THB, 'OnlineBanking_Kasikornbank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TH_THB_OnlineBanking_Kasikornbank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TH_THB AND `channel_code` = 'OnlineBanking_Kasikornbank' AND `factory_code` = @factory_code AND `factory_channel` = 'Kasikornbank' LIMIT 1);
SET @dt_TH_THB_OnlineBanking_Kasikornbank := IF(@pc_TH_THB IS NULL OR @cch_TH_THB_OnlineBanking_Kasikornbank IS NULL, NULL, IFNULL(@dt_TH_THB_OnlineBanking_Kasikornbank, 2049300000000600263));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TH_THB_OnlineBanking_Kasikornbank, @pc_TH_THB, @cch_TH_THB_OnlineBanking_Kasikornbank, 'OnlineBanking_Kasikornbank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'Kasikornbank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TH_THB IS NOT NULL AND @cch_TH_THB_OnlineBanking_Kasikornbank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TR_TRY_Ewallet_Gpay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TR_TRY AND `channel_code` = 'Ewallet_Gpay' LIMIT 1);
SET @cch_TR_TRY_Ewallet_Gpay := IF(@pc_TR_TRY IS NULL, NULL, IFNULL(@cch_TR_TRY_Ewallet_Gpay, 2049300000000500264));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TR_TRY_Ewallet_Gpay, @pc_TR_TRY, 'Ewallet_Gpay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TR_TRY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TR_TRY_Ewallet_Gpay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TR_TRY AND `channel_code` = 'Ewallet_Gpay' AND `factory_code` = @factory_code AND `factory_channel` = 'Gpay' LIMIT 1);
SET @dt_TR_TRY_Ewallet_Gpay := IF(@pc_TR_TRY IS NULL OR @cch_TR_TRY_Ewallet_Gpay IS NULL, NULL, IFNULL(@dt_TR_TRY_Ewallet_Gpay, 2049300000000600264));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TR_TRY_Ewallet_Gpay, @pc_TR_TRY, @cch_TR_TRY_Ewallet_Gpay, 'Ewallet_Gpay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Gpay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TR_TRY IS NOT NULL AND @cch_TR_TRY_Ewallet_Gpay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TR_TRY_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TR_TRY AND `channel_code` = 'Card_CreditCard' LIMIT 1);
SET @cch_TR_TRY_Card_CreditCard := IF(@pc_TR_TRY IS NULL, NULL, IFNULL(@cch_TR_TRY_Card_CreditCard, 2049300000000500265));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TR_TRY_Card_CreditCard, @pc_TR_TRY, 'Card_CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TR_TRY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TR_TRY_Card_CreditCard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TR_TRY AND `channel_code` = 'Card_CreditCard' AND `factory_code` = @factory_code AND `factory_channel` = 'CreditCard' LIMIT 1);
SET @dt_TR_TRY_Card_CreditCard := IF(@pc_TR_TRY IS NULL OR @cch_TR_TRY_Card_CreditCard IS NULL, NULL, IFNULL(@dt_TR_TRY_Card_CreditCard, 2049300000000600265));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TR_TRY_Card_CreditCard, @pc_TR_TRY, @cch_TR_TRY_Card_CreditCard, 'Card_CreditCard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'CreditCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TR_TRY IS NOT NULL AND @cch_TR_TRY_Card_CreditCard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TR_TRY_Ewallet_BKMExpress := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TR_TRY AND `channel_code` = 'Ewallet_BKMExpress' LIMIT 1);
SET @cch_TR_TRY_Ewallet_BKMExpress := IF(@pc_TR_TRY IS NULL, NULL, IFNULL(@cch_TR_TRY_Ewallet_BKMExpress, 2049300000000500266));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TR_TRY_Ewallet_BKMExpress, @pc_TR_TRY, 'Ewallet_BKMExpress', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TR_TRY IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TR_TRY_Ewallet_BKMExpress := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TR_TRY AND `channel_code` = 'Ewallet_BKMExpress' AND `factory_code` = @factory_code AND `factory_channel` = 'BKMExpress' LIMIT 1);
SET @dt_TR_TRY_Ewallet_BKMExpress := IF(@pc_TR_TRY IS NULL OR @cch_TR_TRY_Ewallet_BKMExpress IS NULL, NULL, IFNULL(@dt_TR_TRY_Ewallet_BKMExpress, 2049300000000600266));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TR_TRY_Ewallet_BKMExpress, @pc_TR_TRY, @cch_TR_TRY_Ewallet_BKMExpress, 'Ewallet_BKMExpress', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'BKMExpress', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TR_TRY IS NOT NULL AND @cch_TR_TRY_Ewallet_BKMExpress IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_BankTransfer_BankATM := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'BankTransfer_BankATM' LIMIT 1);
SET @cch_TW_TWD_BankTransfer_BankATM := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_BankTransfer_BankATM, 2049300000000500267));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_BankTransfer_BankATM, @pc_TW_TWD, 'BankTransfer_BankATM', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_BankTransfer_BankATM := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'BankTransfer_BankATM' AND `factory_code` = @factory_code AND `factory_channel` = 'BankATM' LIMIT 1);
SET @dt_TW_TWD_BankTransfer_BankATM := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_BankTransfer_BankATM IS NULL, NULL, IFNULL(@dt_TW_TWD_BankTransfer_BankATM, 2049300000000600267));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_BankTransfer_BankATM, @pc_TW_TWD, @cch_TW_TWD_BankTransfer_BankATM, 'BankTransfer_BankATM', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'BankATM', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_BankTransfer_BankATM IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_Ewallet_JkoPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'Ewallet_JkoPay' LIMIT 1);
SET @cch_TW_TWD_Ewallet_JkoPay := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_Ewallet_JkoPay, 2049300000000500268));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_Ewallet_JkoPay, @pc_TW_TWD, 'Ewallet_JkoPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_Ewallet_JkoPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'Ewallet_JkoPay' AND `factory_code` = @factory_code AND `factory_channel` = 'JkoPay' LIMIT 1);
SET @dt_TW_TWD_Ewallet_JkoPay := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_Ewallet_JkoPay IS NULL, NULL, IFNULL(@dt_TW_TWD_Ewallet_JkoPay, 2049300000000600268));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_Ewallet_JkoPay, @pc_TW_TWD, @cch_TW_TWD_Ewallet_JkoPay, 'Ewallet_JkoPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'JkoPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_Ewallet_JkoPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_Ewallet_LinePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'Ewallet_LinePay' LIMIT 1);
SET @cch_TW_TWD_Ewallet_LinePay := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_Ewallet_LinePay, 2049300000000500269));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_Ewallet_LinePay, @pc_TW_TWD, 'Ewallet_LinePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_Ewallet_LinePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'Ewallet_LinePay' AND `factory_code` = @factory_code AND `factory_channel` = 'LinePay' LIMIT 1);
SET @dt_TW_TWD_Ewallet_LinePay := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_Ewallet_LinePay IS NULL, NULL, IFNULL(@dt_TW_TWD_Ewallet_LinePay, 2049300000000600269));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_Ewallet_LinePay, @pc_TW_TWD, @cch_TW_TWD_Ewallet_LinePay, 'Ewallet_LinePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'LinePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_Ewallet_LinePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_OTC_SevenEleven := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_SevenEleven' LIMIT 1);
SET @cch_TW_TWD_OTC_SevenEleven := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_OTC_SevenEleven, 2049300000000500270));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_OTC_SevenEleven, @pc_TW_TWD, 'OTC_SevenEleven', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_OTC_SevenEleven := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_SevenEleven' AND `factory_code` = @factory_code AND `factory_channel` = 'SevenEleven' LIMIT 1);
SET @dt_TW_TWD_OTC_SevenEleven := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_OTC_SevenEleven IS NULL, NULL, IFNULL(@dt_TW_TWD_OTC_SevenEleven, 2049300000000600270));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_OTC_SevenEleven, @pc_TW_TWD, @cch_TW_TWD_OTC_SevenEleven, 'OTC_SevenEleven', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'SevenEleven', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_OTC_SevenEleven IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_OTC_FamilyMart := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_FamilyMart' LIMIT 1);
SET @cch_TW_TWD_OTC_FamilyMart := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_OTC_FamilyMart, 2049300000000500271));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_OTC_FamilyMart, @pc_TW_TWD, 'OTC_FamilyMart', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_OTC_FamilyMart := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_FamilyMart' AND `factory_code` = @factory_code AND `factory_channel` = 'FamilyMart' LIMIT 1);
SET @dt_TW_TWD_OTC_FamilyMart := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_OTC_FamilyMart IS NULL, NULL, IFNULL(@dt_TW_TWD_OTC_FamilyMart, 2049300000000600271));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_OTC_FamilyMart, @pc_TW_TWD, @cch_TW_TWD_OTC_FamilyMart, 'OTC_FamilyMart', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'FamilyMart', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_OTC_FamilyMart IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_OTC_LifeET := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_LifeET' LIMIT 1);
SET @cch_TW_TWD_OTC_LifeET := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_OTC_LifeET, 2049300000000500272));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_OTC_LifeET, @pc_TW_TWD, 'OTC_LifeET', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_OTC_LifeET := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_LifeET' AND `factory_code` = @factory_code AND `factory_channel` = 'LifeET' LIMIT 1);
SET @dt_TW_TWD_OTC_LifeET := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_OTC_LifeET IS NULL, NULL, IFNULL(@dt_TW_TWD_OTC_LifeET, 2049300000000600272));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_OTC_LifeET, @pc_TW_TWD, @cch_TW_TWD_OTC_LifeET, 'OTC_LifeET', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'LifeET', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_OTC_LifeET IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_OTC_iBon := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_iBon' LIMIT 1);
SET @cch_TW_TWD_OTC_iBon := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_OTC_iBon, 2049300000000500273));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_OTC_iBon, @pc_TW_TWD, 'OTC_iBon', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_OTC_iBon := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_iBon' AND `factory_code` = @factory_code AND `factory_channel` = 'iBon' LIMIT 1);
SET @dt_TW_TWD_OTC_iBon := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_OTC_iBon IS NULL, NULL, IFNULL(@dt_TW_TWD_OTC_iBon, 2049300000000600273));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_OTC_iBon, @pc_TW_TWD, @cch_TW_TWD_OTC_iBon, 'OTC_iBon', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 70, 'iBon', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_OTC_iBon IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_OTC_OK_GO := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_OK_GO' LIMIT 1);
SET @cch_TW_TWD_OTC_OK_GO := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_OTC_OK_GO, 2049300000000500274));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_OTC_OK_GO, @pc_TW_TWD, 'OTC_OK_GO', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_OTC_OK_GO := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_OK_GO' AND `factory_code` = @factory_code AND `factory_channel` = 'OK_GO' LIMIT 1);
SET @dt_TW_TWD_OTC_OK_GO := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_OTC_OK_GO IS NULL, NULL, IFNULL(@dt_TW_TWD_OTC_OK_GO, 2049300000000600274));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_OTC_OK_GO, @pc_TW_TWD, @cch_TW_TWD_OTC_OK_GO, 'OTC_OK_GO', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 65, 'OK_GO', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_OTC_OK_GO IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_BankTransfer_ESumATM := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'BankTransfer_ESumATM' LIMIT 1);
SET @cch_TW_TWD_BankTransfer_ESumATM := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_BankTransfer_ESumATM, 2049300000000500275));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_BankTransfer_ESumATM, @pc_TW_TWD, 'BankTransfer_ESumATM', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_BankTransfer_ESumATM := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'BankTransfer_ESumATM' AND `factory_code` = @factory_code AND `factory_channel` = 'ESumATM' LIMIT 1);
SET @dt_TW_TWD_BankTransfer_ESumATM := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_BankTransfer_ESumATM IS NULL, NULL, IFNULL(@dt_TW_TWD_BankTransfer_ESumATM, 2049300000000600275));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_BankTransfer_ESumATM, @pc_TW_TWD, @cch_TW_TWD_BankTransfer_ESumATM, 'BankTransfer_ESumATM', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'ESumATM', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_BankTransfer_ESumATM IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_OTC_ESum711 := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_ESum711' LIMIT 1);
SET @cch_TW_TWD_OTC_ESum711 := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_OTC_ESum711, 2049300000000500276));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_OTC_ESum711, @pc_TW_TWD, 'OTC_ESum711', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_OTC_ESum711 := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_ESum711' AND `factory_code` = @factory_code AND `factory_channel` = 'ESum711' LIMIT 1);
SET @dt_TW_TWD_OTC_ESum711 := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_OTC_ESum711 IS NULL, NULL, IFNULL(@dt_TW_TWD_OTC_ESum711, 2049300000000600276));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_OTC_ESum711, @pc_TW_TWD, @cch_TW_TWD_OTC_ESum711, 'OTC_ESum711', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'ESum711', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_OTC_ESum711 IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_OTC_ESumFamilyMart := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_ESumFamilyMart' LIMIT 1);
SET @cch_TW_TWD_OTC_ESumFamilyMart := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_OTC_ESumFamilyMart, 2049300000000500277));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_OTC_ESumFamilyMart, @pc_TW_TWD, 'OTC_ESumFamilyMart', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_OTC_ESumFamilyMart := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_ESumFamilyMart' AND `factory_code` = @factory_code AND `factory_channel` = 'ESumFamilyMart' LIMIT 1);
SET @dt_TW_TWD_OTC_ESumFamilyMart := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_OTC_ESumFamilyMart IS NULL, NULL, IFNULL(@dt_TW_TWD_OTC_ESumFamilyMart, 2049300000000600277));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_OTC_ESumFamilyMart, @pc_TW_TWD, @cch_TW_TWD_OTC_ESumFamilyMart, 'OTC_ESumFamilyMart', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'ESumFamilyMart', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_OTC_ESumFamilyMart IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_OTC_ESumLifeET := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_ESumLifeET' LIMIT 1);
SET @cch_TW_TWD_OTC_ESumLifeET := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_OTC_ESumLifeET, 2049300000000500278));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_OTC_ESumLifeET, @pc_TW_TWD, 'OTC_ESumLifeET', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_OTC_ESumLifeET := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_ESumLifeET' AND `factory_code` = @factory_code AND `factory_channel` = 'ESumLifeET' LIMIT 1);
SET @dt_TW_TWD_OTC_ESumLifeET := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_OTC_ESumLifeET IS NULL, NULL, IFNULL(@dt_TW_TWD_OTC_ESumLifeET, 2049300000000600278));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_OTC_ESumLifeET, @pc_TW_TWD, @cch_TW_TWD_OTC_ESumLifeET, 'OTC_ESumLifeET', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'ESumLifeET', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_OTC_ESumLifeET IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_TW_TWD_OTC_StorePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_StorePay' LIMIT 1);
SET @cch_TW_TWD_OTC_StorePay := IF(@pc_TW_TWD IS NULL, NULL, IFNULL(@cch_TW_TWD_OTC_StorePay, 2049300000000500279));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_TW_TWD_OTC_StorePay, @pc_TW_TWD, 'OTC_StorePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_TW_TWD_OTC_StorePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_TW_TWD AND `channel_code` = 'OTC_StorePay' AND `factory_code` = @factory_code AND `factory_channel` = 'StorePay' LIMIT 1);
SET @dt_TW_TWD_OTC_StorePay := IF(@pc_TW_TWD IS NULL OR @cch_TW_TWD_OTC_StorePay IS NULL, NULL, IFNULL(@dt_TW_TWD_OTC_StorePay, 2049300000000600279));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_TW_TWD_OTC_StorePay, @pc_TW_TWD, @cch_TW_TWD_OTC_StorePay, 'OTC_StorePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 60, 'StorePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_TW_TWD IS NOT NULL AND @cch_TW_TWD_OTC_StorePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_US_USD_Ewallet_LinePay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_US_USD AND `channel_code` = 'Ewallet_LinePay' LIMIT 1);
SET @cch_US_USD_Ewallet_LinePay := IF(@pc_US_USD IS NULL, NULL, IFNULL(@cch_US_USD_Ewallet_LinePay, 2049300000000500280));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_US_USD_Ewallet_LinePay, @pc_US_USD, 'Ewallet_LinePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_US_USD IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_US_USD_Ewallet_LinePay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_US_USD AND `channel_code` = 'Ewallet_LinePay' AND `factory_code` = @factory_code AND `factory_channel` = 'LinePay' LIMIT 1);
SET @dt_US_USD_Ewallet_LinePay := IF(@pc_US_USD IS NULL OR @cch_US_USD_Ewallet_LinePay IS NULL, NULL, IFNULL(@dt_US_USD_Ewallet_LinePay, 2049300000000600280));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_US_USD_Ewallet_LinePay, @pc_US_USD, @cch_US_USD_Ewallet_LinePay, 'Ewallet_LinePay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'LinePay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_US_USD IS NOT NULL AND @cch_US_USD_Ewallet_LinePay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_VN_VND_QR_VietQR := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'QR_VietQR' LIMIT 1);
SET @cch_VN_VND_QR_VietQR := IF(@pc_VN_VND IS NULL, NULL, IFNULL(@cch_VN_VND_QR_VietQR, 2049300000000500281));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_VN_VND_QR_VietQR, @pc_VN_VND, 'QR_VietQR', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_VN_VND_QR_VietQR := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'QR_VietQR' AND `factory_code` = @factory_code AND `factory_channel` = 'VietQR' LIMIT 1);
SET @dt_VN_VND_QR_VietQR := IF(@pc_VN_VND IS NULL OR @cch_VN_VND_QR_VietQR IS NULL, NULL, IFNULL(@dt_VN_VND_QR_VietQR, 2049300000000600281));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_VN_VND_QR_VietQR, @pc_VN_VND, @cch_VN_VND_QR_VietQR, 'QR_VietQR', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'VietQR', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL AND @cch_VN_VND_QR_VietQR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_VN_VND_BankTransfer_VN_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'BankTransfer_VN_BankTransfer' LIMIT 1);
SET @cch_VN_VND_BankTransfer_VN_BankTransfer := IF(@pc_VN_VND IS NULL, NULL, IFNULL(@cch_VN_VND_BankTransfer_VN_BankTransfer, 2049300000000500282));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_VN_VND_BankTransfer_VN_BankTransfer, @pc_VN_VND, 'BankTransfer_VN_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_VN_VND_BankTransfer_VN_BankTransfer := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'BankTransfer_VN_BankTransfer' AND `factory_code` = @factory_code AND `factory_channel` = 'VN_BankTransfer' LIMIT 1);
SET @dt_VN_VND_BankTransfer_VN_BankTransfer := IF(@pc_VN_VND IS NULL OR @cch_VN_VND_BankTransfer_VN_BankTransfer IS NULL, NULL, IFNULL(@dt_VN_VND_BankTransfer_VN_BankTransfer, 2049300000000600282));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_VN_VND_BankTransfer_VN_BankTransfer, @pc_VN_VND, @cch_VN_VND_BankTransfer_VN_BankTransfer, 'BankTransfer_VN_BankTransfer', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'VN_BankTransfer', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL AND @cch_VN_VND_BankTransfer_VN_BankTransfer IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_VN_VND_BankTransfer_BankCard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'BankTransfer_BankCard' LIMIT 1);
SET @cch_VN_VND_BankTransfer_BankCard := IF(@pc_VN_VND IS NULL, NULL, IFNULL(@cch_VN_VND_BankTransfer_BankCard, 2049300000000500283));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_VN_VND_BankTransfer_BankCard, @pc_VN_VND, 'BankTransfer_BankCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_VN_VND_BankTransfer_BankCard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'BankTransfer_BankCard' AND `factory_code` = @factory_code AND `factory_channel` = 'BankCard' LIMIT 1);
SET @dt_VN_VND_BankTransfer_BankCard := IF(@pc_VN_VND IS NULL OR @cch_VN_VND_BankTransfer_BankCard IS NULL, NULL, IFNULL(@dt_VN_VND_BankTransfer_BankCard, 2049300000000600283));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_VN_VND_BankTransfer_BankCard, @pc_VN_VND, @cch_VN_VND_BankTransfer_BankCard, 'BankTransfer_BankCard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'BankCard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL AND @cch_VN_VND_BankTransfer_BankCard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_VN_VND_Ewallet_Zalopay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'Ewallet_Zalopay' LIMIT 1);
SET @cch_VN_VND_Ewallet_Zalopay := IF(@pc_VN_VND IS NULL, NULL, IFNULL(@cch_VN_VND_Ewallet_Zalopay, 2049300000000500284));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_VN_VND_Ewallet_Zalopay, @pc_VN_VND, 'Ewallet_Zalopay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_VN_VND_Ewallet_Zalopay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'Ewallet_Zalopay' AND `factory_code` = @factory_code AND `factory_channel` = 'Zalopay' LIMIT 1);
SET @dt_VN_VND_Ewallet_Zalopay := IF(@pc_VN_VND IS NULL OR @cch_VN_VND_Ewallet_Zalopay IS NULL, NULL, IFNULL(@dt_VN_VND_Ewallet_Zalopay, 2049300000000600284));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_VN_VND_Ewallet_Zalopay, @pc_VN_VND, @cch_VN_VND_Ewallet_Zalopay, 'Ewallet_Zalopay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Zalopay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL AND @cch_VN_VND_Ewallet_Zalopay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_VN_VND_Ewallet_VTCPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'Ewallet_VTCPay' LIMIT 1);
SET @cch_VN_VND_Ewallet_VTCPay := IF(@pc_VN_VND IS NULL, NULL, IFNULL(@cch_VN_VND_Ewallet_VTCPay, 2049300000000500285));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_VN_VND_Ewallet_VTCPay, @pc_VN_VND, 'Ewallet_VTCPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_VN_VND_Ewallet_VTCPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'Ewallet_VTCPay' AND `factory_code` = @factory_code AND `factory_channel` = 'VTCPay' LIMIT 1);
SET @dt_VN_VND_Ewallet_VTCPay := IF(@pc_VN_VND IS NULL OR @cch_VN_VND_Ewallet_VTCPay IS NULL, NULL, IFNULL(@dt_VN_VND_Ewallet_VTCPay, 2049300000000600285));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_VN_VND_Ewallet_VTCPay, @pc_VN_VND, @cch_VN_VND_Ewallet_VTCPay, 'Ewallet_VTCPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'VTCPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL AND @cch_VN_VND_Ewallet_VTCPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_VN_VND_Ewallet_VNPay := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'Ewallet_VNPay' LIMIT 1);
SET @cch_VN_VND_Ewallet_VNPay := IF(@pc_VN_VND IS NULL, NULL, IFNULL(@cch_VN_VND_Ewallet_VNPay, 2049300000000500286));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_VN_VND_Ewallet_VNPay, @pc_VN_VND, 'Ewallet_VNPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_VN_VND_Ewallet_VNPay := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'Ewallet_VNPay' AND `factory_code` = @factory_code AND `factory_channel` = 'VNPay' LIMIT 1);
SET @dt_VN_VND_Ewallet_VNPay := IF(@pc_VN_VND IS NULL OR @cch_VN_VND_Ewallet_VNPay IS NULL, NULL, IFNULL(@dt_VN_VND_Ewallet_VNPay, 2049300000000600286));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_VN_VND_Ewallet_VNPay, @pc_VN_VND, @cch_VN_VND_Ewallet_VNPay, 'Ewallet_VNPay', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'VNPay', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL AND @cch_VN_VND_Ewallet_VNPay IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_VN_VND_Ewallet_MoMo := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'Ewallet_MoMo' LIMIT 1);
SET @cch_VN_VND_Ewallet_MoMo := IF(@pc_VN_VND IS NULL, NULL, IFNULL(@cch_VN_VND_Ewallet_MoMo, 2049300000000500287));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_VN_VND_Ewallet_MoMo, @pc_VN_VND, 'Ewallet_MoMo', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_VN_VND_Ewallet_MoMo := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_VN_VND AND `channel_code` = 'Ewallet_MoMo' AND `factory_code` = @factory_code AND `factory_channel` = 'MoMo' LIMIT 1);
SET @dt_VN_VND_Ewallet_MoMo := IF(@pc_VN_VND IS NULL OR @cch_VN_VND_Ewallet_MoMo IS NULL, NULL, IFNULL(@dt_VN_VND_Ewallet_MoMo, 2049300000000600287));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_VN_VND_Ewallet_MoMo, @pc_VN_VND, @cch_VN_VND_Ewallet_MoMo, 'Ewallet_MoMo', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 70, 'MoMo', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_VN_VND IS NOT NULL AND @cch_VN_VND_Ewallet_MoMo IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ZA_ZAR_BankTransfer_Bidvest := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_Bidvest' LIMIT 1);
SET @cch_ZA_ZAR_BankTransfer_Bidvest := IF(@pc_ZA_ZAR IS NULL, NULL, IFNULL(@cch_ZA_ZAR_BankTransfer_Bidvest, 2049300000000500288));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ZA_ZAR_BankTransfer_Bidvest, @pc_ZA_ZAR, 'BankTransfer_Bidvest', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ZA_ZAR_BankTransfer_Bidvest := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_Bidvest' AND `factory_code` = @factory_code AND `factory_channel` = 'Bidvest' LIMIT 1);
SET @dt_ZA_ZAR_BankTransfer_Bidvest := IF(@pc_ZA_ZAR IS NULL OR @cch_ZA_ZAR_BankTransfer_Bidvest IS NULL, NULL, IFNULL(@dt_ZA_ZAR_BankTransfer_Bidvest, 2049300000000600288));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ZA_ZAR_BankTransfer_Bidvest, @pc_ZA_ZAR, @cch_ZA_ZAR_BankTransfer_Bidvest, 'BankTransfer_Bidvest', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 100, 'Bidvest', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL AND @cch_ZA_ZAR_BankTransfer_Bidvest IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ZA_ZAR_BankTransfer_FNB := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_FNB' LIMIT 1);
SET @cch_ZA_ZAR_BankTransfer_FNB := IF(@pc_ZA_ZAR IS NULL, NULL, IFNULL(@cch_ZA_ZAR_BankTransfer_FNB, 2049300000000500289));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ZA_ZAR_BankTransfer_FNB, @pc_ZA_ZAR, 'BankTransfer_FNB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ZA_ZAR_BankTransfer_FNB := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_FNB' AND `factory_code` = @factory_code AND `factory_channel` = 'FNB' LIMIT 1);
SET @dt_ZA_ZAR_BankTransfer_FNB := IF(@pc_ZA_ZAR IS NULL OR @cch_ZA_ZAR_BankTransfer_FNB IS NULL, NULL, IFNULL(@dt_ZA_ZAR_BankTransfer_FNB, 2049300000000600289));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ZA_ZAR_BankTransfer_FNB, @pc_ZA_ZAR, @cch_ZA_ZAR_BankTransfer_FNB, 'BankTransfer_FNB', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 95, 'FNB', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL AND @cch_ZA_ZAR_BankTransfer_FNB IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ZA_ZAR_BankTransfer_Investec := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_Investec' LIMIT 1);
SET @cch_ZA_ZAR_BankTransfer_Investec := IF(@pc_ZA_ZAR IS NULL, NULL, IFNULL(@cch_ZA_ZAR_BankTransfer_Investec, 2049300000000500290));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ZA_ZAR_BankTransfer_Investec, @pc_ZA_ZAR, 'BankTransfer_Investec', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ZA_ZAR_BankTransfer_Investec := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_Investec' AND `factory_code` = @factory_code AND `factory_channel` = 'Investec' LIMIT 1);
SET @dt_ZA_ZAR_BankTransfer_Investec := IF(@pc_ZA_ZAR IS NULL OR @cch_ZA_ZAR_BankTransfer_Investec IS NULL, NULL, IFNULL(@dt_ZA_ZAR_BankTransfer_Investec, 2049300000000600290));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ZA_ZAR_BankTransfer_Investec, @pc_ZA_ZAR, @cch_ZA_ZAR_BankTransfer_Investec, 'BankTransfer_Investec', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 90, 'Investec', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL AND @cch_ZA_ZAR_BankTransfer_Investec IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ZA_ZAR_BankTransfer_Nedbank := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_Nedbank' LIMIT 1);
SET @cch_ZA_ZAR_BankTransfer_Nedbank := IF(@pc_ZA_ZAR IS NULL, NULL, IFNULL(@cch_ZA_ZAR_BankTransfer_Nedbank, 2049300000000500291));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ZA_ZAR_BankTransfer_Nedbank, @pc_ZA_ZAR, 'BankTransfer_Nedbank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ZA_ZAR_BankTransfer_Nedbank := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_Nedbank' AND `factory_code` = @factory_code AND `factory_channel` = 'Nedbank' LIMIT 1);
SET @dt_ZA_ZAR_BankTransfer_Nedbank := IF(@pc_ZA_ZAR IS NULL OR @cch_ZA_ZAR_BankTransfer_Nedbank IS NULL, NULL, IFNULL(@dt_ZA_ZAR_BankTransfer_Nedbank, 2049300000000600291));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ZA_ZAR_BankTransfer_Nedbank, @pc_ZA_ZAR, @cch_ZA_ZAR_BankTransfer_Nedbank, 'BankTransfer_Nedbank', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 85, 'Nedbank', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL AND @cch_ZA_ZAR_BankTransfer_Nedbank IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ZA_ZAR_BankTransfer_Standard := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_Standard' LIMIT 1);
SET @cch_ZA_ZAR_BankTransfer_Standard := IF(@pc_ZA_ZAR IS NULL, NULL, IFNULL(@cch_ZA_ZAR_BankTransfer_Standard, 2049300000000500292));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ZA_ZAR_BankTransfer_Standard, @pc_ZA_ZAR, 'BankTransfer_Standard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ZA_ZAR_BankTransfer_Standard := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_Standard' AND `factory_code` = @factory_code AND `factory_channel` = 'Standard' LIMIT 1);
SET @dt_ZA_ZAR_BankTransfer_Standard := IF(@pc_ZA_ZAR IS NULL OR @cch_ZA_ZAR_BankTransfer_Standard IS NULL, NULL, IFNULL(@dt_ZA_ZAR_BankTransfer_Standard, 2049300000000600292));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ZA_ZAR_BankTransfer_Standard, @pc_ZA_ZAR, @cch_ZA_ZAR_BankTransfer_Standard, 'BankTransfer_Standard', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 80, 'Standard', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL AND @cch_ZA_ZAR_BankTransfer_Standard IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @cch_ZA_ZAR_BankTransfer_Tyme := (SELECT `id` FROM `sys_pay_country_channel` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_Tyme' LIMIT 1);
SET @cch_ZA_ZAR_BankTransfer_Tyme := IF(@pc_ZA_ZAR IS NULL, NULL, IFNULL(@cch_ZA_ZAR_BankTransfer_Tyme, 2049300000000500293));
INSERT INTO `sys_pay_country_channel` (`id`, `pay_country_id`, `channel_code`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @cch_ZA_ZAR_BankTransfer_Tyme, @pc_ZA_ZAR, 'BankTransfer_Tyme', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL
ON DUPLICATE KEY UPDATE
  `pay_country_id` = VALUES(`pay_country_id`),
  `channel_code` = VALUES(`channel_code`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

SET @dt_ZA_ZAR_BankTransfer_Tyme := (SELECT `id` FROM `sys_pay_country_channel_details` WHERE `pay_country_id` = @pc_ZA_ZAR AND `channel_code` = 'BankTransfer_Tyme' AND `factory_code` = @factory_code AND `factory_channel` = 'Tyme' LIMIT 1);
SET @dt_ZA_ZAR_BankTransfer_Tyme := IF(@pc_ZA_ZAR IS NULL OR @cch_ZA_ZAR_BankTransfer_Tyme IS NULL, NULL, IFNULL(@dt_ZA_ZAR_BankTransfer_Tyme, 2049300000000600293));
INSERT INTO `sys_pay_country_channel_details` (`id`, `pay_country_id`, `country_channel_id`, `channel_code`, `factory_code`, `factory_min_limit`, `factory_max_limit`, `factory_daily_limit`, `factory_currency_point`, `suggest_score`, `factory_channel`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`)
SELECT @dt_ZA_ZAR_BankTransfer_Tyme, @pc_ZA_ZAR, @cch_ZA_ZAR_BankTransfer_Tyme, 'BankTransfer_Tyme', @factory_code, 0.01, 99999999.00, 99999999.00, 2, 75, 'Tyme', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL
WHERE @pc_ZA_ZAR IS NOT NULL AND @cch_ZA_ZAR_BankTransfer_Tyme IS NOT NULL
ON DUPLICATE KEY UPDATE
  `country_channel_id` = VALUES(`country_channel_id`),
  `factory_min_limit` = VALUES(`factory_min_limit`),
  `factory_max_limit` = VALUES(`factory_max_limit`),
  `factory_daily_limit` = VALUES(`factory_daily_limit`),
  `factory_currency_point` = VALUES(`factory_currency_point`),
  `suggest_score` = VALUES(`suggest_score`),
  `factory_channel` = VALUES(`factory_channel`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

-- LIKEI V2 region commodity tiers.
DELETE FROM `sys_pay_application_commodity`
WHERE `application_id` = @application_id
  AND `region_id` = @region_id
  AND `type` = @type
  AND `amount_usd` IN (1.00, 5.00, 10.00, 25.00, 50.00, 100.00)
  AND `id` NOT IN (2048200000000000801, 2048200000000000802, 2048200000000000803, 2048200000000000804, 2048200000000000805, 2048200000000000806);

INSERT INTO `sys_pay_application_commodity` (`id`, `application_id`, `pay_country_id`, `region_id`, `type`, `content`, `award_content`, `amount_usd`, `is_shelf`, `create_time`, `update_time`, `create_user`, `update_user`) VALUES
  (2048200000000000801, @application_id, NULL, @region_id, @type, '80000', '0', 1.00, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL),
  (2048200000000000802, @application_id, NULL, @region_id, @type, '400000', '0', 5.00, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL),
  (2048200000000000803, @application_id, NULL, @region_id, @type, '800000', '0', 10.00, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL),
  (2048200000000000804, @application_id, NULL, @region_id, @type, '2000000', '0', 25.00, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL),
  (2048200000000000805, @application_id, NULL, @region_id, @type, '4000000', '0', 50.00, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL),
  (2048200000000000806, @application_id, NULL, @region_id, @type, '8000000', '0', 100.00, 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL)
ON DUPLICATE KEY UPDATE
  `application_id` = VALUES(`application_id`),
  `pay_country_id` = VALUES(`pay_country_id`),
  `region_id` = VALUES(`region_id`),
  `type` = VALUES(`type`),
  `content` = VALUES(`content`),
  `award_content` = VALUES(`award_content`),
  `amount_usd` = VALUES(`amount_usd`),
  `is_shelf` = VALUES(`is_shelf`),
  `update_time` = CURRENT_TIMESTAMP;

COMMIT;
