<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.system.app.mapper.AppGameScheduleMapper">

    <update id="updateByIdDel">
        UPDATE nm_game_schedule SET del_flag=1 WHERE id=#{id}
    </update>
    <select id="getListVo" resultType="org.jeecg.modules.app.vo.AppGameScheduleVO">
        SELECT
        id,
        game_id,
        NAME,
        start_time,
        end_time,
        arrange,
        CASE
        WHEN NOW() <![CDATA[ < ]]> start_time THEN '未开始' WHEN NOW() <![CDATA[ >= ]]> end_time THEN
        '已结束' ELSE '进行中'
        END AS startStatus
        FROM
        nm_game_schedule
        <where>
            del_flag = 0
            <if test="gameId != null and gameId != ''">
                and game_id = #{gameId}
            </if>
        </where>
    </select>
</mapper>