-- ================================================================================

-- `eod_log`

-- ================================================================================


-- ----------------------------------------
-- [`table_achievement`]
-- ----------------------------------------

SELECT * FROM `eod_log`.`table_achievement`
WHERE (`user_id` = 10000000000000125) AND 
      (`general_type_code` = 904211024);



-- ----------------------------------------
-- [`table_admission`]
-- ----------------------------------------

-- 특정 사용자의 입장권 소비 경로
SELECT * FROM `eod_log`.`table_admission` 
WHERE (`user_id` = 118) AND
      (`log_time` >= '2017-03-23 11:00:00') AND (`log_time` < '2017-03-23 11:40:00') AND
      (`consume_route` = 28)
ORDER BY `log_time` DESC;


-- ----------------------------------------
-- [`table_avatar`]
-- ----------------------------------------


-- ----------------------------------------
-- [`table_billing`]
-- ----------------------------------------

-- 로그 번호로 찾기
SELECT * FROM `eod_log`.`table_billing` WHERE (`log_no` = 17651);

-- 특정 시간 대역에서 플레이어의 결제 내역
SELECT * FROM `eod_log`.`table_billing` 
WHERE (`log_time` BETWEEN '2017-03-07 00:00:00' AND '2017-07-20 23:59:59') AND
      (`user_id` = 10000000000005887)
ORDER BY `log_no` DESC;

-- 영수증 번호로 찾기
SELECT * FROM `eod_log`.`table_billing` WHERE (`order_number` = 'GPA.3334-5933-8117-03767');


SELECT * FROM `eod_log`.`table_billing` WHERE (`log_time` >= '2017-03-21 00:00:00') ORDER BY `log_time` DESC;

SELECT * FROM `eod_log`.`table_billing` WHERE (`character_id` = 50);
SELECT * FROM `eod_log`.`table_billing` WHERE (`user_id` = 11) AND (`log_time` >= '2017-03-29 00:00:00');
SELECT * FROM `eod_log`.`table_billing` WHERE (`user_id` = 5065);

SELECT * FROM `eod_log`.`table_billing` WHERE (`character_id` = 15625) ORDER BY `log_time` DESC;
SELECT * FROM `eod_log`.`table_billing` 
WHERE (`log_time` >= '2017-03-10 00:00:00')
ORDER BY `log_time` DESC;


-- 영수증 번호로 찾기
SELECT * FROM `eod_log`.`table_billing` 
WHERE (`log_time` BETWEEN '2017-07-04 22:00:00' AND '2017-07-04 23:59:59');


-- 상품 구매 횟수
SELECT COUNT(1) FROM `eod_log`.`table_billing`
WHERE (`product_code` IN(210220265,
210220266,
210220267,
210501007,
210501008,
210501009));

SELECT * FROM `eod_log`.`table_billing` WHERE (`log_time` > '2017-05-15 00:00:00') LIMIT 1000;



-- ----------------------------------------
-- [`table_daily_mission`]
-- ----------------------------------------


-- ----------------------------------------
-- [`table_equipment`]
-- ----------------------------------------

SELECT MAX(`log_no`) FROM `eod_log`.`table_equipment`;

SELECT * FROM `eod_log`.`table_equipment` WHERE (`log_time` >= '2016-10-31 21:40:00');

-- 연금술 진행한 로그
SELECT * FROM `eod_log`.`table_equipment` WHERE (`log_time` >= '2017-06-15 00:00:00') AND (`consume_route` BETWEEN 68 AND 70);

-- 연금술 변성 이용 내역
SELECT * FROM `eod_log`.`table_equipment` 
WHERE (`log_time` BETWEEN '2017-06-15 00:00:00' AND '2017-06-16 23:59:59') AND 
      (`consume_route` BETWEEN 68 AND 70);

-- NOX 등급 아이템 획득 여부
SELECT * FROM `eod_log`.`table_equipment` 
WHERE (`user_id` = 10000000000000125) AND 
      (`log_time` > '2017-07-29 22:51:12') AND 
      (`general_type_code` IN (150401011,
150501011,
150601011,
150701011,
150401012,
150501012,
150601012,
150701012,
150401013,
150501013,
150601013,
150701013,
150402011,
150502011,
150602011,
150702011,
150402012,
150502012,
150602012,
150702012,
150402013,
150502013,
150602013,
150702013,
151401011,
151501011,
151601011,
151701011,
151401012,
151501012,
151601012,
151701012,
151401013,
151501013,
151601013,
151701013,
151401014,
151501014,
151601014,
151701014,
151401015,
151501015,
151601015,
151701015,
151401016,
151501016,
151601016,
151701016,
151402011,
151502011,
151602011,
151702011,
151402012,
151502012,
151602012,
151702012,
151402013,
151502013,
151602013,
151702013,
151402014,
151502014,
151602014,
151702014,
151402015,
151502015,
151602015,
151702015,
151403011,
151503011,
151603011,
151703011,
151403012,
151503012,
151603012,
151703012,
151403013,
151503013,
151603013,
151703013,
151403014,
151503014,
151603014,
151703014,
151403015,
151503015,
151603015,
151703015,
151405011,
151505011,
151605011,
151705011,
151405012,
151505012,
151605012,
151705012,
151405013,
151505013,
151605013,
151705013,
151405014,
151505014,
151605014,
151705014,
151405015,
151505015,
151605015,
151705015,
151406011,
151506011,
151606011,
151706011,
151406012,
151506012,
151606012,
151706012,
151406013,
151506013,
151606013,
151706013,
151406014,
151506014,
151606014,
151706014,
151406015,
151506015,
151606015,
151706015,
151407011,
151507011,
151607011,
151707011,
151407012,
151507012,
151607012,
151707012,
151407013,
151507013,
151607013,
151707013,
151407014,
151507014,
151607014,
151707014,
151407015,
151507015,
151607015,
151707015,
152401011,
152501011,
152601011,
152701011,
152401012,
152501012,
152601012,
152701012,
152401013,
152501013,
152601013,
152701013,
152401014,
152501014,
152601014,
152701014,
152401015,
152501015,
152601015,
152701015,
152401016,
152501016,
152601016,
152701016,
152402011,
152502011,
152602011,
152702011,
152402012,
152502012,
152602012,
152702012,
152402013,
152502013,
152602013,
152702013,
152402014,
152502014,
152602014,
152702014,
152402015,
152502015,
152602015,
152702015,
152403011,
152503011,
152603011,
152703011,
152403012,
152503012,
152603012,
152703012,
152403013,
152503013,
152603013,
152703013,
152403014,
152503014,
152603014,
152703014,
152403015,
152503015,
152603015,
152703015,
152405011,
152505011,
152605011,
152705011,
152405012,
152505012,
152605012,
152705012,
152405013,
152505013,
152605013,
152705013,
152405014,
152505014,
152605014,
152705014,
152405015,
152505015,
152605015,
152705015,
152406011,
152506011,
152606011,
152706011,
152406012,
152506012,
152606012,
152706012,
152406013,
152506013,
152606013,
152706013,
152406014,
152506014,
152606014,
152706014,
152406015,
152506015,
152606015,
152706015,
152407011,
152507011,
152607011,
152707011,
152407012,
152507012,
152607012,
152707012,
152407013,
152507013,
152607013,
152707013,
152407014,
152507014,
152607014,
152707014,
152407015,
152507015,
152607015,
152707015,
153401011,
153501011,
153601011,
153701011,
153401012,
153501012,
153601012,
153701012,
153401013,
153501013,
153601013,
153701013,
153401014,
153501014,
153601014,
153701014,
153401015,
153501015,
153601015,
153701015,
153401016,
153501016,
153601016,
153701016,
153402011,
153502011,
153602011,
153702011,
153402012,
153502012,
153602012,
153702012,
153402013,
153502013,
153602013,
153702013,
153402014,
153502014,
153602014,
153702014,
153402015,
153502015,
153602015,
153702015,
153403011,
153503011,
153603011,
153703011,
153403012,
153503012,
153603012,
153703012,
153403013,
153503013,
153603013,
153703013,
153403014,
153503014,
153603014,
153703014,
153403015,
153503015,
153603015,
153703015,
153405011,
153505011,
153605011,
153705011,
153405012,
153505012,
153605012,
153705012,
153405013,
153505013,
153605013,
153705013,
153405014,
153505014,
153605014,
153705014,
153405015,
153505015,
153605015,
153705015,
153406011,
153506011,
153606011,
153706011,
153406012,
153506012,
153606012,
153706012,
153406013,
153506013,
153606013,
153706013,
153406014,
153506014,
153606014,
153706014,
153406015,
153506015,
153606015,
153706015,
153407011,
153507011,
153607011,
153707011,
153407012,
153507012,
153607012,
153707012,
153407013,
153507013,
153607013,
153707013,
153407014,
153507014,
153607014,
153707014,
153407015,
153507015,
153607015,
153707015,
154401011,
154501011,
154601011,
154701011,
154401012,
154501012,
154601012,
154701012,
154401013,
154501013,
154601013,
154701013,
154401014,
154501014,
154601014,
154701014,
154401015,
154501015,
154601015,
154701015,
154401016,
154501016,
154601016,
154701016,
154402011,
154502011,
154602011,
154702011,
154402012,
154502012,
154602012,
154702012,
154402013,
154502013,
154602013,
154702013,
154402014,
154502014,
154602014,
154702014,
154402015,
154502015,
154602015,
154702015,
154403011,
154503011,
154603011,
154703011,
154403012,
154503012,
154603012,
154703012,
154403013,
154503013,
154603013,
154703013,
154403014,
154503014,
154603014,
154703014,
154403015,
154503015,
154603015,
154703015,
154405011,
154505011,
154605011,
154705011,
154405012,
154505012,
154605012,
154705012,
154405013,
154505013,
154605013,
154705013,
154405014,
154505014,
154605014,
154705014,
154405015,
154505015,
154605015,
154705015,
154406011,
154506011,
154606011,
154706011,
154406012,
154506012,
154606012,
154706012,
154406013,
154506013,
154606013,
154706013,
154406014,
154506014,
154606014,
154706014,
154406015,
154506015,
154606015,
154706015,
154407011,
154507011,
154607011,
154707011,
154407012,
154507012,
154607012,
154707012,
154407013,
154507013,
154607013,
154707013,
154407014,
154507014,
154607014,
154707014,
154407015,
154507015,
154607015,
154707015) AND 
      (`get_route` = 16));


-- 특정 사용자의 아이템 획득 경로
SELECT * FROM `eod_log`.`table_equipment` 
WHERE (`log_time` BETWEEN '2017-07-25 08:11:20' AND '2017-07-25 08:13:25') AND
      (`user_id` = 10000000000008715)
ORDER BY `log_no` DESC;

-- 특정 캐릭터의 아이템 획득 경로
SELECT * FROM `eod_log`.`table_equipment` 
WHERE (`character_id` = 29727) AND 
      (`get_route` = 4) AND 
      (`log_time` >= '2017-03-14 00:00:00');


-- 연금술 변성 이용 내역
SELECT * FROM `eod_log`.`table_equipment` 
WHERE (`log_time` BETWEEN '2017-06-15 00:00:00' AND '2017-06-23 23:59:59') AND 
      (`consume_route` = 69);
      
-- 연금술 변성 횟수 내역
SELECT 
    `user_id`, 
    `character_id`, 
    COUNT(1) AS `operationCount`
FROM `eod_log`.`table_equipment` 
WHERE (`log_time` BETWEEN '2017-06-15 00:00:00' AND '2017-06-23 23:59:59') AND 
      (`consume_route` = 69)
GROUP BY `user_id`;
      
      
-- 연금술 변환 이용 내역
SELECT * FROM `eod_log`.`table_equipment` 
WHERE (`log_time` BETWEEN '2017-06-15 00:00:00' AND '2017-06-23 23:59:59') AND 
      (`consume_route` = 70);
      
-- 연금술 변환 횟수 내역
SELECT 
    `user_id`, 
    `character_id`, 
    COUNT(1) AS `operationCount`
FROM `eod_log`.`table_equipment` 
WHERE (`log_time` BETWEEN '2017-06-15 00:00:00' AND '2017-06-23 23:59:59') AND 
      (`consume_route` = 70)
GROUP BY `user_id`;


-- 아이템 강화 내역
SELECT * FROM `eod_log`.`table_equipment`
WHERE (`log_time` BETWEEN '2017-08-29 20:00:00' AND '2017-08-30 15:00:00') AND
      (`get_route` = 19)
ORDER BY `user_id`, `character_id`;


	  
-- ----------------------------------------
-- [`table_friendship_point`]
-- ----------------------------------------



-- ----------------------------------------
-- [`table_gem`]
-- ----------------------------------------

-- 특정 플레이어의 젬 획득 내역
SELECT * FROM `eod_log`.`table_gem` 
WHERE (`log_time` BETWEEN '2017-07-17 00:00:00' AND '2017-07-17 23:39:59') AND 
      (`user_id` = 33117)
ORDER BY `log_no` DESC;

SELECT 
    `log_no`,
    `log_time`,
    `user_id`,
    `character_id`,
    `amount`
FROM `eod_log`.`table_gem` 
WHERE (`log_time` BETWEEN '2017-03-07 00:00:00' AND '2017-03-20 18:39:59') AND
      (`get_route` = 50)
ORDER BY `log_no` DESC;


-- 특정 플레이어의 젬 획득 내역
SELECT * FROM `eod_log`.`table_gem` 
WHERE (`user_id` = 157) AND 
      (`log_time` >= '2017-06-08 00:00:00') AND (`log_time` <= '2017-06-08 19:39:59')
ORDER BY `log_no` DESC;


-- 특정 플레이어의 젬 소모 내역
SELECT * FROM `eod_log`.`table_gem` 
WHERE (`user_id` = 21) AND 
      (`log_time` >= '2017-04-10 00:00:00') AND (`log_time` <= '2017-04-11 23:59:59') AND
      (`consume_route` = 30);
      
      
SELECT * FROM `eod_log`.`table_gem` 
WHERE (`log_time` >= '2017-03-28 14:00:00') AND (`log_time` <= '2017-03-29 23:59:59') AND
      (`consume_route` = 2) AND 
      (`amount` = 100)
ORDER BY `log_no` DESC;



-- ----------------------------------------
-- [`table_gold`]
-- ----------------------------------------

-- 골드 소모 내역
SELECT * FROM `eod_log`.`table_gold` 
WHERE (`log_time` >= '2017-08-29 20:00:00') AND (`log_time` <= '2017-08-30 23:59:59') AND
      (`consume_route` = 19);
      
SELECT * FROM `eod_log`.`table_item` 
WHERE (`log_time` >= '2017-08-29 20:00:00') AND (`log_time` <= '2017-08-30 23:59:59') AND
      (`consume_route` = 19);


-- ----------------------------------------
-- [`table_guardian_stone`]
-- ----------------------------------------



-- ----------------------------------------
-- [`table_item`]
-- ----------------------------------------

-- 특정 플레이어의 재화 획득 내역
SELECT * FROM `eod_log`.`table_item` 
WHERE (`log_time` BETWEEN '2017-07-18 19:00:00' AND '2017-07-18 19:03:59') AND
      (`user_id` = 43990)
ORDER BY `log_no` DESC;


SELECT * FROM `eod_log`.`table_item` 
WHERE (`user_id` = 41885) AND 
      (`log_time` BETWEEN '2017-05-13 00:00:00' AND '2017-05-14 23:59:59') AND
      (`general_type_code` = 156113006)
ORDER BY `log_no` DESC;


SELECT COUNT(1) FROM `eod_log`.`table_item` 
WHERE (`log_time` BETWEEN '2017-07-01 00:00:00' AND '2017-07-09 23:59:59') AND 
      (`general_type_code` = 156113015);
      
      
-- 강화 컨텐츠 이용 횟수
SELECT 
    `user_id`,
    `character_id`,
    COUNT(1) AS `operation_count`
FROM `eod_log`.`table_item`
WHERE (`log_time` BETWEEN '2017-07-19 00:00:00' AND '2017-07-25 23:59:59') AND
      (`general_type_code` = 150000101) AND
      (`consume_route` = 19)
GROUP BY `character_id`
ORDER BY `user_id`;


-- 합성 컨텐츠 이용 횟수
SELECT 
    `user_id`,
    `character_id`,
    COUNT(1) AS `operation_count`
FROM `eod_log`.`table_equipment`
WHERE (`log_time` BETWEEN '2017-07-19 00:00:00' AND '2017-07-25 23:59:59') AND
      (`consume_route` = 20)
GROUP BY `character_id`
ORDER BY `user_id`;


-- 승급 컨텐츠 이용 횟수
SELECT 
    `character_id`,
    COUNT(1) AS `operation_count`
FROM `eod_log`.`table_item`
WHERE (`log_time` BETWEEN '2017-07-19 00:00:00' AND '2017-07-25 23:59:59') AND
      (`general_type_code` IN (160000601, 160000602, 160000603)) AND
      (`consume_route` = 21)
GROUP BY `character_id`
ORDER BY `character_id`;



-- ----------------------------------------
-- [`table_monthly_mission`]
-- ----------------------------------------


-- ----------------------------------------
-- [`table_rift_stone`]
-- ----------------------------------------


-- ----------------------------------------
-- [`table_ruby`]
-- ----------------------------------------


-- ----------------------------------------
-- [`table_servant`]
-- ----------------------------------------


-- ----------------------------------------
-- [`table_stage_arena_async`]
-- ----------------------------------------
SELECT * FROM `eod_log`.`table_stage_arena_async`
WHERE (`user_id` = 10000000000049612) AND
      (`log_time` BETWEEN '2017-07-10 00:00:00' AND '2017-07-12 23:59:59');


-- ----------------------------------------
-- [`table_stage_arena_async_reward`]
-- ----------------------------------------

SELECT * FROM `eod_log`.`table_stage_arena_async_reward`
WHERE (`log_time` >= '2017-07-09 00:00:00') AND 
      (`user_id` IN(20000000000043278)) 
ORDER BY `log_no` DESC;


SELECT * FROM `eod_log`.`table_stage_arena_async_reward`
WHERE (`log_time` > '2017-04-24 00:00:00') 
ORDER BY `log_no` DESC
LIMIT 1000;


-- ----------------------------------------
-- [`table_stage_elite`]
-- ----------------------------------------



-- ----------------------------------------
-- [`table_stage_guardian_raid`]
-- ----------------------------------------



-- ----------------------------------------
-- [`table_guild_war`]
-- ----------------------------------------



-- ----------------------------------------
-- [`table_stage_normal`]
-- ----------------------------------------



-- ----------------------------------------
-- [`table_stage_rift`]
-- ----------------------------------------



-- ----------------------------------------
-- [`table_stage_transcendence`]
-- ----------------------------------------

-- 특정 기간 내에 초월 던전을 완료한 횟수
SELECT 
    `user_id`, 
    COUNT(1) AS clearCount
FROM `eod_log`.`table_stage_transcendence`
WHERE (`log_time` BETWEEN '2017-06-20 00:00:00' AND '2017-06-20 23:59:59') AND
      (`is_clear` = 1)
GROUP BY `user_id`;


-- ----------------------------------------
-- [`table_stage_weekly`]
-- ----------------------------------------
SELECT * FROM `eod_log`.`table_stage_weekly`
WHERE (`user_id` = 33665) AND
      (`log_time` BETWEEN '2017-06-19 00:00:00' AND '2017-06-19 23:59:59');


-- ----------------------------------------
-- [`table_weekly_mission`]
-- ----------------------------------------

SELECT * FROM `eod_log`.`table_weekly_mission`
WHERE (`user_id` = 31475) AND 
      (`log_time` BETWEEN '2017-03-07 00:00:00' AND '2017-03-30 23:59:59') AND
      (`general_type_code` = 702111001) AND (`get_reward` = 1)
ORDER BY `log_no` DESC;


SELECT * FROM `eod_log`.`table_monthly_mission`
WHERE (`user_id` = 31475) AND 
      (`log_time` BETWEEN '2017-03-07 00:00:00' AND '2017-03-30 23:59:59')
ORDER BY `log_no` DESC;