<?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.liquidnet.service.candy.mapper.CandyCouponRelateMapper">
    <resultMap id="Rst_CandyCouponRelateDto" type="com.liquidnet.service.candy.dto.CandyCouponRelateDto">
        <result column="coupon_id" jdbcType="VARCHAR" property="couponId"/>
        <result column="scope" jdbcType="SMALLINT" property="scope"/>
        <result column="busi_id" jdbcType="VARCHAR" property="busiId"/>
        <result column="title" jdbcType="VARCHAR" property="busiName"/>
    </resultMap>

    <select id="selectMultiForRoadshowName" resultMap="Rst_CandyCouponRelateDto">
        select distinct ccr.coupon_id,ccr.scope,ccr.busi_id,krs.title
        from candy_coupon_relate ccr
                 left join kylin_road_shows krs on ccr.busi_id=krs.road_shows_id and ccr.scope=1
        where ccr.coupon_id in
        <foreach collection='couponIdList' item='id' open='(' separator=',' close=')'>
            #{id}
        </foreach>
          and ccr.state=1
    </select>
</mapper>
