CREATE TABLE `HOLDEM_BET_HIST` (
  `HOLDEM_BET_IDX` bigint(21) unsigned NOT NULL AUTO_INCREMENT COMMENT 'uniqe idx',
  `REG_DTM` datetime NOT NULL DEFAULT current_timestamp() COMMENT 'reg_dt',
  `MBR_IDX` int(11) NOT NULL DEFAULT 0 COMMENT 'member id',
  `GAME_NUM` int(11) NOT NULL DEFAULT 0 COMMENT 'round num',
  `START_MONEY` int(11) unsigned NOT NULL DEFAULT 0 COMMENT 'start money',
  `BET_MONEY` int(11) unsigned NOT NULL DEFAULT 0 COMMENT 'betting money',
  `FINAL_MONEY` int(11) NOT NULL DEFAULT 0 COMMENT 'final money',
  `WIN_MONEY` int(11) NOT NULL DEFAULT 0 COMMENT 'win money',
  `STACK` int(11) NOT NULL DEFAULT 0,
  `UPDATE_DT` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `EVENT` varchar(45) NOT NULL DEFAULT '',
  `FEE` decimal(7,2) NOT NULL DEFAULT 0.00,
  `CALL_BACK_DATA` text DEFAULT NULL,
  PRIMARY KEY (`HOLDEM_BET_IDX`),
  KEY `REG_DTM_INDEX` (`REG_DTM`),
  KEY `MBR_ID_INDEX` (`MBR_IDX`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='holdem bet table';

CREATE TABLE `HOLDEM_CALL_BACK_DATA` (
  `IDX` bigint(21) unsigned NOT NULL AUTO_INCREMENT COMMENT 'uniqe idx',
  `MBR_IDX` int(11) NOT NULL COMMENT 'member idx',
  `MONEY` int(11) DEFAULT 0,
  `EVENT` varchar(45) NOT NULL DEFAULT '',
  `DATA` text DEFAULT NULL,
  `CREATE_DT` datetime NOT NULL DEFAULT current_timestamp(),
  `FUNCTION` varchar(45) DEFAULT '' COMMENT '호출 함수명',
  PRIMARY KEY (`IDX`),
  KEY `MBR_IDX` (`MBR_IDX`),
  KEY `CREATE_DT` (`CREATE_DT`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='holdem call back data';

ALTER TABLE `member` 
ADD COLUMN `info_change_dt` DATETIME NULL DEFAULT CURRENT_TIMESTAMP() AFTER `keep_login_access_token`,
ADD COLUMN `is_holdem_register` ENUM('Y', 'N') NULL DEFAULT 'N' COMMENT '홀덤 가입 여부' AFTER `info_change_dt`,
ADD COLUMN `is_holdem_start` ENUM('Y', 'N') NULL DEFAULT 'N' COMMENT '홀덤 세션시작 여부' AFTER `is_holdem_register`,
ADD COLUMN `is_holdem_start_dt` DATETIME NULL DEFAULT CURRENT_TIMESTAMP() COMMENT '홀덤 최근 플레이 시간' AFTER `is_holdem_start`;

ALTER TABLE member 
CHANGE COLUMN u_business u_business TINYINT(4) NULL DEFAULT 1 COMMENT '회원 구분, 1:일반, 10: 대총판,11 총판,12 하위 \\n' ;

ALTER TABLE `member_money_charge_history` 
ADD COLUMN `classic_bet_s_money` INT(11) NULL DEFAULT 0 AFTER `real_bet_d_money`,
ADD COLUMN `classic_bet_d_money` INT(11) NULL DEFAULT 0 AFTER `classic_bet_s_money`,
ADD COLUMN `holdem_bet_money` INT(11) NULL DEFAULT 0 AFTER `hash_bet_money`;

CREATE TABLE `mobile_carrier_list` (
  `idx` int(11) NOT NULL,
  `name` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`idx`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='통신사 목록';

ALTER TABLE `shop_calculate_result` 
ADD COLUMN `low_calculate_point` DECIMAL(11,2) NULL DEFAULT 0.00 AFTER `calculate_point`,
ADD COLUMN `total_holdem_bet_money` DECIMAL(11,2) NULL DEFAULT 0.00 AFTER `total_espt_bet_money`,
ADD COLUMN `bet_holdem_fee` DECIMAL(7,2) NULL DEFAULT 0.00 AFTER `bet_hash_fee`,
ADD COLUMN `holdem_bet_take` DECIMAL(11,2) NULL DEFAULT 0.00 AFTER `espt_bet_take`,
ADD COLUMN `pre_classic_bet_sum_s` DECIMAL(11,2) NULL DEFAULT 0.00 AFTER `holdem_bet_take`,
ADD COLUMN `pre_classic_bet_take_s` DECIMAL(11,2) NULL DEFAULT 0.00 AFTER `pre_classic_bet_sum_s`,
ADD COLUMN `pre_classic_bet_sum_d` DECIMAL(11,2) NULL DEFAULT 0.00 AFTER `pre_classic_bet_take_s`,
ADD COLUMN `pre_classic_bet_take_d` DECIMAL(11,2) NULL DEFAULT 0.00 AFTER `pre_classic_bet_sum_d`;

ALTER TABLE `shop_config` 
ADD COLUMN `bet_holdem_fee` DECIMAL(7,2) NULL DEFAULT 0.00 AFTER `bet_hash_fee`;

ALTER TABLE `t_adm_ip` 
ADD COLUMN `type` TINYINT(4) NULL DEFAULT 1 COMMENT '1:ipv4, 2:ipv6' AFTER `idx`;

ALTER TABLE `t_adm_ip` 
CHANGE COLUMN `a_ip` `a_ip` VARCHAR(60) NULL DEFAULT NULL ;

ALTER TABLE `t_domain_code` 
ADD COLUMN `type` TINYINT(4) NULL DEFAULT 1 COMMENT '1-본사, 2-총판, 3-가로' AFTER `reg_time`;

ALTER TABLE `t_log_cash` 
ADD COLUMN `a_country` VARCHAR(45) NULL DEFAULT '' AFTER `coment`;

ALTER TABLE `total_member_cash` 
ADD COLUMN `holdem_total_money` BIGINT(20) NULL DEFAULT 0 AFTER `take_hash_total_money`,
ADD COLUMN `take_holdem_total_money` BIGINT(20) NULL DEFAULT 0 AFTER `holdem_total_money`;

ALTER TABLE `tb_static_bonus` 
ADD COLUMN `bonus_3_desc` VARCHAR(128) NULL DEFAULT '' AFTER `bonus_2_flag`,
ADD COLUMN `bonus_3_flag` ENUM('ON', 'OFF') NULL DEFAULT 'ON' AFTER `bonus_3_desc`,
ADD COLUMN `bonus_4_desc` VARCHAR(128) NULL DEFAULT '' AFTER `bonus_3_flag`,
ADD COLUMN `bonus_4_flag` ENUM('ON', 'OFF') NULL DEFAULT 'ON' AFTER `bonus_4_desc`,
ADD COLUMN `bonus_5_desc` VARCHAR(128) NULL DEFAULT '' AFTER `bonus_4_flag`,
ADD COLUMN `bonus_5_flag` ENUM('ON', 'OFF') NULL DEFAULT 'ON' AFTER `bonus_5_desc`;


ALTER TABLE `charge_type` 
ADD COLUMN `bonus_3_charge_first_money` INT(11) NULL DEFAULT 0 AFTER `bonus_2_charge_per`,
ADD COLUMN `bonus_3_charge_first_per` INT(11) NULL DEFAULT 0 AFTER `bonus_3_charge_first_money`,
ADD COLUMN `bonus_3_charge_first_max_money` INT(11) NULL DEFAULT 0 AFTER `bonus_3_charge_first_per`,
ADD COLUMN `bonus_3_charge_money` INT(11) NULL DEFAULT 0 AFTER `bonus_3_charge_first_max_money`,
ADD COLUMN `bonus_3_charge_max_money` INT(11) NULL DEFAULT 0 AFTER `bonus_3_charge_money`,
ADD COLUMN `bonus_3_charge_per` INT(11) NULL DEFAULT 0 AFTER `bonus_3_charge_max_money`,

ADD COLUMN `bonus_4_charge_first_money` INT(11) NULL DEFAULT 0 AFTER `bonus_3_charge_per`,
ADD COLUMN `bonus_4_charge_first_per` INT(11) NULL DEFAULT 0 AFTER `bonus_4_charge_first_money`,
ADD COLUMN `bonus_4_charge_first_max_money` INT(11) NULL DEFAULT 0 AFTER `bonus_4_charge_first_per`,
ADD COLUMN `bonus_4_charge_money` INT(11) NULL DEFAULT 0 AFTER `bonus_4_charge_first_max_money`,
ADD COLUMN `bonus_4_charge_max_money` INT(11) NULL DEFAULT 0 AFTER `bonus_4_charge_money`,
ADD COLUMN `bonus_4_charge_per` INT(11) NULL DEFAULT 0 AFTER `bonus_4_charge_max_money`,

ADD COLUMN `bonus_5_charge_first_money` INT(11) NULL DEFAULT 0 AFTER `bonus_4_charge_per`,
ADD COLUMN `bonus_5_charge_first_per` INT(11) NULL DEFAULT 0 AFTER `bonus_5_charge_first_money`,
ADD COLUMN `bonus_5_charge_first_max_money` INT(11) NULL DEFAULT 0 AFTER `bonus_5_charge_first_per`,
ADD COLUMN `bonus_5_charge_money` INT(11) NULL DEFAULT 0 AFTER `bonus_5_charge_first_max_money`,
ADD COLUMN `bonus_5_charge_max_money` INT(11) NULL DEFAULT 0 AFTER `bonus_5_charge_money`,
ADD COLUMN `bonus_5_charge_per` INT(11) NULL DEFAULT 0 AFTER `bonus_5_charge_max_money`;

ALTER TABLE tb_user_pay_back_info 
ADD COLUMN last_charge INT(11) NULL DEFAULT 0 AFTER create_dt,
ADD COLUMN last_exchange INT(11) NULL DEFAULT 0 AFTER last_charge,
ADD COLUMN last_tot_bet_money BIGINT(20) NULL DEFAULT 0 AFTER last_exchange,
CHANGE COLUMN tot_bet_money tot_bet_money BIGINT(20) NULL DEFAULT 0 ;

-- view
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `day_bet_classic` AS select 'bet_tot_ing' AS `stype`,`member_bet`.`bet_status` AS `status`,count(0) AS `cnt`,sum(`member_bet`.`total_bet_money`) AS `s_money`,0 AS `s_win_money` from (`member_bet` left join `member` on(`member_bet`.`member_idx` = `member`.`idx`)) where `member_bet`.`bet_type` = 1 and `member_bet`.`is_classic` = 'ON' and `member_bet`.`bet_status` = 1 and `member`.`level` <> 9 union all select 'bet_tot' AS `stype`,`member_bet`.`bet_status` AS `status`,count(0) AS `cnt`,`member_bet`.`total_bet_money` AS `s_money`,`member_bet`.`take_money` AS `s_win_money` from (`member_bet` left join `member` on(`member_bet`.`member_idx` = `member`.`idx`)) where `member_bet`.`calculate_dt` >= date_format(current_timestamp(),'%Y-%m-%d 00:00:00') and `member_bet`.`calculate_dt` <= date_format(current_timestamp(),'%Y-%m-%d 23:59:59') and `member_bet`.`bet_type` = 1 and `member_bet`.`bet_status` = 3 and `member_bet`.`is_classic` = 'ON' and `member`.`level` <> 9 and `member_bet`.`total_bet_money` <> `member_bet`.`take_money` group by `member_bet`.`idx` union all select 'bet_tot_sports' AS `stype`,`member_bet`.`bet_status` AS `status`,count(0) AS `cnt`,`member_bet`.`total_bet_money` AS `s_money`,sum(`member_bet`.`take_money`) AS `s_win_money` from (`member_bet` left join `member` on(`member_bet`.`member_idx` = `member`.`idx`)) where `member_bet`.`calculate_dt` >= date_format(current_timestamp(),'%Y-%m-%d 00:00:00') and `member_bet`.`calculate_dt` <= date_format(current_timestamp(),'%Y-%m-%d 23:59:59') and `member_bet`.`bet_type` = 1 and `member_bet`.`bet_status` = 3 and `member_bet`.`is_classic` = 'ON' and `member_bet`.`total_bet_money` <> `member_bet`.`take_money` and `member`.`level` <> 9;
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `day_holdem_view` AS select ifnull(sum(`CBH`.`BET_MONEY`),0) AS `total_bet_money`,ifnull(sum(`CBH`.`WIN_MONEY`),0) AS `total_win_money` from (`member` `MB` left join `HOLDEM_BET_HIST` `CBH` on(`MB`.`idx` = `CBH`.`MBR_IDX`)) where `CBH`.`UPDATE_DT` >= date_format(current_timestamp(),'%Y-%m-%d 00:00:00') and `CBH`.`UPDATE_DT` <= date_format(current_timestamp(),'%Y-%m-%d 23:59:59') and `MB`.`level` <> 9 and `MB`.`u_business` = 1;

-- procedure
DELIMITER $$
CREATE PROCEDURE `day_bet_mini_distributor`()
BEGIN
	SELECT 
        'bet_tot_mini_powerball' AS `stype`,
        SUM(`mini_game_member_bet`.`total_bet_money`) AS `s_money`
    FROM
        (`mini_game_member_bet`
        LEFT JOIN `member` ON (`mini_game_member_bet`.`member_idx` = `member`.`idx`))
    WHERE
        `mini_game_member_bet`.`calculate_dt` >= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 00:00:00')
            AND `mini_game_member_bet`.`calculate_dt` <= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 23:59:59')
            AND `mini_game_member_bet`.`bet_type` = 3
            AND `mini_game_member_bet`.`bet_status` = 3
            AND `member`.`level` <> 9
            AND `mini_game_member_bet`.`total_bet_money` <> `mini_game_member_bet`.`take_money` 
    UNION ALL SELECT 
        'bet_tot_mini_powerball_win' AS `stype`,
        SUM(`mini_game_member_bet`.`take_money`) AS `s_money`
    FROM
        (`mini_game_member_bet`
        LEFT JOIN `member` ON (`mini_game_member_bet`.`member_idx` = `member`.`idx`))
    WHERE
        `mini_game_member_bet`.`calculate_dt` >= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 00:00:00')
            AND `mini_game_member_bet`.`calculate_dt` <= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 23:59:59')
            AND `mini_game_member_bet`.`bet_type` = 3
            AND `mini_game_member_bet`.`bet_status` = 3
            AND `mini_game_member_bet`.`take_money` > 0
            AND `member`.`level` <> 9 
    UNION ALL SELECT 
        'bet_tot_mini_pladder' AS `stype`,
        SUM(`mini_game_member_bet`.`total_bet_money`) AS `s_money`
    FROM
        (`mini_game_member_bet`
        LEFT JOIN `member` ON (`mini_game_member_bet`.`member_idx` = `member`.`idx`))
    WHERE
        `mini_game_member_bet`.`calculate_dt` >= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 00:00:00')
            AND `mini_game_member_bet`.`calculate_dt` <= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 23:59:59')
            AND `mini_game_member_bet`.`bet_type` = 4
            AND `mini_game_member_bet`.`bet_status` = 3
            AND `member`.`level` <> 9
            AND `mini_game_member_bet`.`total_bet_money` <> `mini_game_member_bet`.`take_money` 
    UNION ALL SELECT 
        'bet_tot_mini_pladder_win' AS `stype`,
        SUM(`mini_game_member_bet`.`take_money`) AS `s_money`
    FROM
        (`mini_game_member_bet`
        LEFT JOIN `member` ON (`mini_game_member_bet`.`member_idx` = `member`.`idx`))
    WHERE
        `mini_game_member_bet`.`calculate_dt` >= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 00:00:00')
            AND `mini_game_member_bet`.`calculate_dt` <= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 23:59:59')
            AND `mini_game_member_bet`.`bet_type` = 4
            AND `mini_game_member_bet`.`bet_status` = 3
            AND `mini_game_member_bet`.`take_money` > 0
            AND `member`.`level` <> 9 
    UNION ALL SELECT 
        'bet_tot_mini_kladder' AS `stype`,
        SUM(`mini_game_member_bet`.`total_bet_money`) AS `s_money`
    FROM
        (`mini_game_member_bet`
        LEFT JOIN `member` ON (`mini_game_member_bet`.`member_idx` = `member`.`idx`))
    WHERE
        `mini_game_member_bet`.`calculate_dt` >= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 00:00:00')
            AND `mini_game_member_bet`.`calculate_dt` <= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 23:59:59')
            AND `mini_game_member_bet`.`bet_type` = 5
            AND `mini_game_member_bet`.`bet_status` = 3
            AND `member`.`level` <> 9
            AND `mini_game_member_bet`.`total_bet_money` <> `mini_game_member_bet`.`take_money` 
    UNION ALL SELECT 
        'bet_tot_mini_kladder_win' AS `stype`,
        SUM(`mini_game_member_bet`.`take_money`) AS `s_money`
    FROM
        (`mini_game_member_bet`
        LEFT JOIN `member` ON (`mini_game_member_bet`.`member_idx` = `member`.`idx`))
    WHERE
        `mini_game_member_bet`.`calculate_dt` >= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 00:00:00')
            AND `mini_game_member_bet`.`calculate_dt` <= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 23:59:59')
            AND `mini_game_member_bet`.`bet_type` = 5
            AND `mini_game_member_bet`.`bet_status` = 3
            AND `mini_game_member_bet`.`take_money` > 0
            AND `member`.`level` <> 9 
    UNION ALL SELECT 
        'bet_tot_mini_b_soccer' AS `stype`,
        SUM(`mini_game_member_bet`.`total_bet_money`) AS `s_money`
    FROM
        (`mini_game_member_bet`
        LEFT JOIN `member` ON (`mini_game_member_bet`.`member_idx` = `member`.`idx`))
    WHERE
        `mini_game_member_bet`.`calculate_dt` >= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 00:00:00')
            AND `mini_game_member_bet`.`calculate_dt` <= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 23:59:59')
            AND `mini_game_member_bet`.`bet_type` = 6
            AND `mini_game_member_bet`.`bet_status` = 3
            AND `member`.`level` <> 9
            AND `mini_game_member_bet`.`total_bet_money` <> `mini_game_member_bet`.`take_money` 
    UNION ALL SELECT 
        'bet_tot_mini_b_soccer_win' AS `stype`,
        SUM(`mini_game_member_bet`.`take_money`) AS `s_money`
    FROM
        (`mini_game_member_bet`
        LEFT JOIN `member` ON (`mini_game_member_bet`.`member_idx` = `member`.`idx`))
    WHERE
        `mini_game_member_bet`.`calculate_dt` >= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 00:00:00')
            AND `mini_game_member_bet`.`calculate_dt` <= DATE_FORMAT(CURRENT_TIMESTAMP(), '%Y-%m-%d 23:59:59')
            AND `mini_game_member_bet`.`bet_type` = 6
            AND `mini_game_member_bet`.`bet_status` = 3
            AND `mini_game_member_bet`.`take_money` > 0
            AND `member`.`level` <> 9;
END$$
DELIMITER ;

DROP function IF EXISTS `FN_ADM_MSG_SEND_ALL`;
DELIMITER $$
CREATE FUNCTION `FN_ADM_MSG_SEND_ALL`(`$p_msg_idx` INT
) RETURNS int(11)
BEGIN

	DECLARE $ret 			VARCHAR(50);
	DECLARE $no_more_rows 		BOOL DEFAULT FALSE;

	DECLARE $db_user_idx			INTEGER DEFAULT 0;

	DECLARE cursor_1 CURSOR FOR
		SELECT idx FROM member WHERE status=1;
		
	DECLARE CONTINUE HANDLER FOR NOT FOUND
		SET $no_more_rows := true;

	OPEN cursor_1;
	LOOP1: loop
		FETCH cursor_1 INTO $db_user_idx;

		IF $no_more_rows THEN 
			CLOSE cursor_1;
			LEAVE LOOP1;
		END IF;
		
					
		INSERT INTO t_message(msg_idx,member_idx) VALUES($p_msg_idx,$db_user_idx);
		
	END loop LOOP1;
	
	SET $ret = 1000;

	RETURN $ret;
END$$

DELIMITER ;



-- data
INSERT INTO `business_type` (`id`, `low_id`, `high_id`, `name`, `create_dt`, `update_dt`) VALUES ('12', '0', '11', '하위총판', '2022-07-07 22:06:56', '2022-07-07 22:06:56');
UPDATE `business_type` SET `id` = '11', `low_id` = '12', `high_id` = '10' WHERE (`id` = '2');
UPDATE `business_type` SET `id` = '10', `low_id` = '11', `high_id` = '0' WHERE (`id` = '3');


INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('eospb5', '10001', '파워볼 홀', '1.9');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('eospb5', '10002', '파워볼 짝', '1.9');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('eospb5', '10003', '파워볼(오버)', '1.9');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('eospb5', '10004', '파워볼(언더)', '1.9');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('eospb5', '10005', '일반볼 대(81-130)', '2.75');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('eospb5', '10006', '일반볼 중(65-80)', '2.75');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('eospb5', '10007', '일반볼 소(15-64)', '2.75');

UPDATE `mini_game_bet` SET `markets_id` = '14001', `bet_price` = '1.9' WHERE (`game` = 'powerball') and (`markets_id` = '10001');
UPDATE `mini_game_bet` SET `markets_id` = '14002', `bet_price` = '1.9' WHERE (`game` = 'powerball') and (`markets_id` = '10002');
UPDATE `mini_game_bet` SET `markets_id` = '14003', `bet_price` = '1.9' WHERE (`game` = 'powerball') and (`markets_id` = '10003');
UPDATE `mini_game_bet` SET `markets_id` = '14004', `bet_price` = '1.9' WHERE (`game` = 'powerball') and (`markets_id` = '10004');
UPDATE `mini_game_bet` SET `markets_id` = '14005', `bet_price` = '2.75' WHERE (`game` = 'powerball') and (`markets_id` = '10005');
UPDATE `mini_game_bet` SET `markets_id` = '14006', `bet_price` = '2.75' WHERE (`game` = 'powerball') and (`markets_id` = '10006');
UPDATE `mini_game_bet` SET `markets_id` = '14007', `bet_price` = '2.75' WHERE (`game` = 'powerball') and (`markets_id` = '10007');
UPDATE `mini_game_bet` SET `bet_price` = '1.9' WHERE (`game` = 'pladder') and (`markets_id` = '11001');
UPDATE `mini_game_bet` SET `bet_price` = '1.9' WHERE (`game` = 'pladder') and (`markets_id` = '11002');
UPDATE `mini_game_bet` SET `bet_price` = '1.9' WHERE (`game` = 'pladder') and (`markets_id` = '11003');
UPDATE `mini_game_bet` SET `bet_price` = '1.9' WHERE (`game` = 'pladder') and (`markets_id` = '11004');
UPDATE `mini_game_bet` SET `bet_price` = '1.9' WHERE (`game` = 'pladder') and (`markets_id` = '11005');
UPDATE `mini_game_bet` SET `bet_price` = '1.9' WHERE (`game` = 'pladder') and (`markets_id` = '11006');

UPDATE `mini_game_bet_config` SET `bet_type` = '15' WHERE (`bet_type` = '3') and (`level` = '1');
UPDATE `mini_game_bet_config` SET `bet_type` = '15' WHERE (`bet_type` = '3') and (`level` = '2');
UPDATE `mini_game_bet_config` SET `bet_type` = '15' WHERE (`bet_type` = '3') and (`level` = '3');
UPDATE `mini_game_bet_config` SET `bet_type` = '15' WHERE (`bet_type` = '3') and (`level` = '4');
UPDATE `mini_game_bet_config` SET `bet_type` = '15' WHERE (`bet_type` = '3') and (`level` = '5');
UPDATE `mini_game_bet_config` SET `bet_type` = '15' WHERE (`bet_type` = '3') and (`level` = '6');
UPDATE `mini_game_bet_config` SET `bet_type` = '15' WHERE (`bet_type` = '3') and (`level` = '7');
UPDATE `mini_game_bet_config` SET `bet_type` = '15' WHERE (`bet_type` = '3') and (`level` = '8');
UPDATE `mini_game_bet_config` SET `bet_type` = '15' WHERE (`bet_type` = '3') and (`level` = '9');

INSERT INTO `mini_game_bet_config` (`bet_type`, `game`, `level`, `min`, `max`, `limit`, `reward`) VALUES ('3', 'eospb5', '1', '1', '1', '1', '0.00');
INSERT INTO `mini_game_bet_config` (`bet_type`, `game`, `level`, `min`, `max`, `limit`, `reward`) VALUES ('3', 'eospb5', '2', '1', '1', '1', '0.00');
INSERT INTO `mini_game_bet_config` (`bet_type`, `game`, `level`, `min`, `max`, `limit`, `reward`) VALUES ('3', 'eospb5', '3', '1', '1', '1', '0.00');
INSERT INTO `mini_game_bet_config` (`bet_type`, `game`, `level`, `min`, `max`, `limit`, `reward`) VALUES ('3', 'eospb5', '4', '1', '1', '1', '0.00');
INSERT INTO `mini_game_bet_config` (`bet_type`, `game`, `level`, `min`, `max`, `limit`, `reward`) VALUES ('3', 'eospb5', '5', '1', '1', '1', '0.00');
INSERT INTO `mini_game_bet_config` (`bet_type`, `game`, `level`, `min`, `max`, `limit`, `reward`) VALUES ('3', 'eospb5', '6', '1', '1', '1', '0.00');
INSERT INTO `mini_game_bet_config` (`bet_type`, `game`, `level`, `min`, `max`, `limit`, `reward`) VALUES ('3', 'eospb5', '7', '1', '1', '1', '0.00');
INSERT INTO `mini_game_bet_config` (`bet_type`, `game`, `level`, `min`, `max`, `limit`, `reward`) VALUES ('3', 'eospb5', '8', '1', '1', '1', '0.00');
INSERT INTO `mini_game_bet_config` (`bet_type`, `game`, `level`, `min`, `max`, `limit`, `reward`) VALUES ('3', 'eospb5', '9', '500', '2000000', '6000000', '0.00');


INSERT INTO `lsports_game_type` (`id`, `name`, `ko_name`, `status`, `create_dt`, `update_dt`) VALUES ('15', 'entry_powerball', '엔트리 파워볼', 'ON', '2022-05-20 00:11:59', '2022-05-20 00:12:19');
