<?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.kxs.stat.biz.mapper.KxsMerchantTradeMapper">

    <resultMap type="com.kxs.stat.api.model.KxsMerchantTrade" id="KxsMerchantTradeMap">
        <result column="id" property="id"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="del_flag" property="delFlag"/>
        <result column="version" property="version"/>
        <result column="trade_date" property="tradeDate"/>
        <result column="trade_month" property="tradeMonth"/>
        <result column="trade_amt" property="tradeAmt"/>
        <result column="merchant_id" property="merchantId"/>
        <result column="brand_id" property="brandId"/>

    </resultMap>
    <update id="automaticTableCreationTasks">
        CREATE TABLE IF NOT EXISTS `${tableName}` LIKE kxs_merchant_trade;
    </update>
    <select id="mchTradeInListOfDay" resultType="com.kxs.stat.api.model.KxsMerchantTrade">
        select
            *
        from
            `${tableName}`
        where
            del_flag = 0
            and merchant_id = #{mchId}
            and trade_date in
            <foreach collection="times" item="time" index="index" open="(" close=")" separator=",">
                #{time}
            </foreach>
    </select>


</mapper>
