ActivityBaseInfoMapper.sql

    1. SELECT
    2. a.activity_id,
    3. a.id AS activity_round_id,
    4. a.round_num,
    5. a.round_start_time,
    6. a.round_end_time,
    7. a.reward_time,
    8. b.start_time AS activity_start_time,
    9. b.end_time AS activity_end_time,
    10. b.draw_reward_type,
    11. b.max_lottery_code,
    12. b.bean_transfer_num,
    13. c.activity_type_key,
    14. d.activity_template_key,
    15. -- >是在xml中的转义
    16. IF ( a.reward_time - CURRENT_TIMESTAMP () > 0, (a.reward_time - CURRENT_TIMESTAMP ()) DIV 1000, 0 ) AS
    17. reward_countdown_time,
    18. CASE WHEN (a.draw_status = 2) THEN 1 WHEN (CURRENT_TIMESTAMP () < a.reward_time) THEN 0 ELSE 2 END AS
    19. activity_reward_status,
    20. e.global_num AS quota_num,
    21. f.thumb AS activity_image,
    22. f.`name` AS activity_title,
    23. f.price AS goods_origin_price,
    24. f.prize_display_price AS prize_display_price
    25. FROM
    26. jmf_activity_round a
    27. LEFT JOIN jmf_activity_base_info b ON a.activity_id = b.id
    28. LEFT JOIN jmf_activity_type c ON b.activity_type_id = c.id
    29. LEFT JOIN jmf_activity_template d ON b.activity_template_id = d.id
    30. LEFT JOIN jmf_activity_reward_level e ON e.activity_round_id = a.id
    31. LEFT JOIN jmf_activity_reward_prize f ON f.activity_round_id = a.id