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


UPDATE `mini_game_bet_config` SET `game` = 'eospb5' WHERE (`bet_type` = '3') and (`level` = '1');
UPDATE `mini_game_bet_config` SET `game` = 'eospb5' WHERE (`bet_type` = '3') and (`level` = '2');
UPDATE `mini_game_bet_config` SET `game` = 'eospb5' WHERE (`bet_type` = '3') and (`level` = '3');
UPDATE `mini_game_bet_config` SET `game` = 'eospb5' WHERE (`bet_type` = '3') and (`level` = '5');
UPDATE `mini_game_bet_config` SET `game` = 'eospb5' WHERE (`bet_type` = '3') and (`level` = '4');
UPDATE `mini_game_bet_config` SET `game` = 'eospb5' WHERE (`bet_type` = '3') and (`level` = '6');
UPDATE `mini_game_bet_config` SET `game` = 'eospb5' WHERE (`bet_type` = '3') and (`level` = '7');
UPDATE `mini_game_bet_config` SET `game` = 'eospb5' WHERE (`bet_type` = '3') and (`level` = '8');
UPDATE `mini_game_bet_config` SET `game` = 'eospb5' WHERE (`bet_type` = '3') and (`level` = '9');
/*UPDATE `mini_game_bet_config` SET `game` = 'powerball' WHERE (`bet_type` = '7') and (`level` = '1');
UPDATE `mini_game_bet_config` SET `game` = 'powerball' WHERE (`bet_type` = '7') and (`level` = '2');
UPDATE `mini_game_bet_config` SET `game` = 'powerball' WHERE (`bet_type` = '7') and (`level` = '3');
UPDATE `mini_game_bet_config` SET `game` = 'powerball' WHERE (`bet_type` = '7') and (`level` = '4');
UPDATE `mini_game_bet_config` SET `game` = 'powerball' WHERE (`bet_type` = '7') and (`level` = '5');
UPDATE `mini_game_bet_config` SET `game` = 'powerball' WHERE (`bet_type` = '7') and (`level` = '6');
UPDATE `mini_game_bet_config` SET `game` = 'powerball' WHERE (`bet_type` = '7') and (`level` = '7');
UPDATE `mini_game_bet_config` SET `game` = 'powerball' WHERE (`bet_type` = '7') and (`level` = '8');
UPDATE `mini_game_bet_config` SET `game` = 'powerball' WHERE (`bet_type` = '7') and (`level` = '9');*/

INSERT INTO `lsports_game_type` (`id`, `name`, `ko_name`, `status`, `create_dt`, `update_dt`) VALUES ('14', 'sports_two', '스포츠 2폴더', 'ON', '2022-05-20 00:11:59', '2022-05-20 00:12:19');
INSERT INTO `lsports_game_type` (`id`, `name`, `ko_name`, `status`) VALUES ('15', 'powerball', '파워볼', 'ON');
UPDATE `lsports_game_type` SET `name` = 'eos powerball', `ko_name` = 'eos 파워볼' WHERE (`id` = '5');

UPDATE `mini_game_bet` SET `game` = 'eospb5' WHERE (`game` = 'powerball') and (`markets_id` = '10001');
UPDATE `mini_game_bet` SET `game` = 'eospb5' WHERE (`game` = 'powerball') and (`markets_id` = '10002');
UPDATE `mini_game_bet` SET `game` = 'eospb5' WHERE (`game` = 'powerball') and (`markets_id` = '10004');
UPDATE `mini_game_bet` SET `game` = 'eospb5' WHERE (`game` = 'powerball') and (`markets_id` = '10003');
UPDATE `mini_game_bet` SET `game` = 'eospb5' WHERE (`game` = 'powerball') and (`markets_id` = '10006');
UPDATE `mini_game_bet` SET `game` = 'eospb5' WHERE (`game` = 'powerball') and (`markets_id` = '10005');
UPDATE `mini_game_bet` SET `game` = 'eospb5' WHERE (`game` = 'powerball') and (`markets_id` = '10007');


INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('powerball', '14001', '파워볼 홀', '1.9');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('powerball', '14002', '파워볼 짝', '1.9');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('powerball', '14003', '파워볼(오버)', '1.9');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('powerball', '14004', '파워볼(언더)', '1.9');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('powerball', '14005', '일반볼 대(81-130)', '2.75');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('powerball', '14006', '일반볼 중(65-80)', '2.75');
INSERT INTO `mini_game_bet` (`game`, `markets_id`, `markets_name`, `bet_price`) VALUES ('powerball', '14007', '일반볼 소(15-64)', '2.75');


-- 카테고리 데이터
INSERT INTO `category_rule` (`category`, `sub_category`, `title`, `content`) VALUES ('3', '5', '엔트리 파워볼', '파워볼<br><br>');
UPDATE `category_rule` SET `title` = 'EOS 파워볼' WHERE (`category` = '3') and (`sub_category` = '1');
UPDATE `category_rule` SET `content` = '엔트리 파워볼<br><br> [게임안내]<br><br>\r  \r  * 매일 00:03 부터 1회차가 시작되며 5분마다 1회차씩 1일 총 288회차 게임이 진행됩니다.<br><br>\r  \r  * 해당 종목은 조합베팅 불가하며 오직 단폴더 베팅만 가능합니다.<br><br>\r  \r  * 파워볼게임은 동행복권(www.dhlottery.co.kr)이 인정하는 경기 결과대로 반영됩니다.<br><br>\r  \r  * 동행복권 결과에 따라 처리되며, 무효시 적특처리(1.0배)됩니다.<br><br>\r  (다음회차 결과값 발표후 이전회차에 대한 무효처리시 취소 처리하지 않으며, 기존 결과값으로 처리됩니다.)<br><br>\r  \r  * 동행복권 홈페이지 점검이나, 접속불가 현상으로 게임이 진행되지 않을경우 적/특(1.0배)됩니다.<br><br><br>\r  \r  [게임방법]<br><br>\r  \r  *파워볼 홀/짝<br><br>\r  \r  파워볼의 추첨 후 숫자가 홀수인지, 짝수인지 선택합니다.<br><br>\r  \r  *파워볼 숫자<br><br>\r  \r  파워볼의 추첨 후 숫자가 0~4 구간인지 5~9 구간인지 선택합니다.<br><br>\r  \r  * 대, 중, 소<br><br>\r  \r  일반볼의 추첨 후 합산된 결과를 대,중,소의 구간중 선택합니다.<br><br>' WHERE (`category` = '3') and (`sub_category` = '5');
UPDATE `category_rule` SET `content` = 'EOS 파워볼<br><br>\r \r [게임안내]<br><br>\r \r * 매일 00:03 부터 1회차가 시작되며 5분마다 1회차씩 1일 총 288회차 게임이 진행됩니다.<br><br>\r \r * 해당 종목은 조합베팅 불가하며 오직 단폴더 베팅만 가능합니다.<br><br>\r \r * 파워볼게임은 동행복권(www.dhlottery.co.kr)이 인정하는 경기 결과대로 반영됩니다.<br><br>\r \r * 동행복권 결과에 따라 처리되며, 무효시 적특처리(1.0배)됩니다.<br><br>\r (다음회차 결과값 발표후 이전회차에 대한 무효처리시 취소 처리하지 않으며, 기존 결과값으로 처리됩니다.)<br><br>\r \r * 동행복권 홈페이지 점검이나, 접속불가 현상으로 게임이 진행되지 않을경우 적/특(1.0배)됩니다.<br><br><br>\r \r [게임방법]<br><br>\r \r *파워볼 홀/짝<br><br>\r \r 파워볼의 추첨 후 숫자가 홀수인지, 짝수인지 선택합니다.<br><br>\r \r *파워볼 숫자<br><br>\r \r 파워볼의 추첨 후 숫자가 0~4 구간인지 5~9 구간인지 선택합니다.<br><br>\r \r * 대, 중, 소<br><br>\r \r 일반볼의 추첨 후 합산된 결과를 대,중,소의 구간중 선택합니다.<br><br>' WHERE (`category` = '3') and (`sub_category` = '1');


/*
USE `mydb`;
CREATE 
     OR REPLACE ALGORITHM = UNDEFINED 
    DEFINER = `kadminwin`@`%` 
    SQL SECURITY DEFINER
VIEW `day_bet_mini` AS
    SELECT 
        'bet_tot_mini_eos_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_eos_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_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` = 15
            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` = 15
            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;
*/