<?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="com.jumeirah.common.mapper.StrokeDiscountMapper">

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,
        city_outset_id,
        city_outset_name,
        city_arrive_id,
        city_arrive_name,
        seat_num,
        plain_type_id,
        plain_type_name,
        outset_time,
        return_time,
        status,
        create_time,
        update_time,
        remarks,
        money,
        mc_id
    </sql>

    <select id="getStrokeDiscountById" resultType="com.jumeirah.common.vo.StrokeDiscountQueryVo">
        select
        <include refid="Base_Column_List"/>
        from stroke_discount where id = #{id}
    </select>

    <select id="getStrokeDiscountPageList" parameterType="com.jumeirah.common.param.StrokeDiscountPageParam"
            resultType="com.jumeirah.common.vo.StrokeDiscountQueryVo">
        select
            ctco.city_name_cn as city_outset_name,
            ctca.city_name_cn as city_arrive_name,
            sd.*
        from stroke_discount sd
        INNER JOIN city_three_code ctco ON ctco.id = sd.city_outset_id
        INNER JOIN city_three_code ctca ON ctca.id = sd.city_arrive_id
    </select>

</mapper>
