<?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.zm.order.tool.server.tempdb.MomoDao">

    <resultMap id="ResultMap" type="com.zm.order.tool.server.model.Momo">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="user_id" jdbcType="BIGINT" property="userId"/>
        <result column="store_name" jdbcType="VARCHAR" property="storeName"/>
        <result column="thrid_store_id" jdbcType="BIGINT" property="thridStoreId"/>
        <result column="store_id" jdbcType="BIGINT" property="storeId"/>
        <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
        <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
        <result column="actual_amount" jdbcType="DECIMAL" property="actualAmount"/>
        <result column="is_refund" jdbcType="INTEGER" property="isRefund"/>
        <result column="item_name" jdbcType="VARCHAR" property="itemName"/>
        <result column="cost_price" jdbcType="DECIMAL" property="costPrice"/>
        <result column="item_price" jdbcType="DECIMAL" property="itemPrice"/>
        <result column="num" jdbcType="DECIMAL" property="num"/>
        <result column="total_item_actual_amount" jdbcType="DECIMAL" property="totalItemActualAmount"/>
        <result column="pay_amount" jdbcType="DECIMAL" property="payAmount"/>
        <result column="pay_type_txt" jdbcType="VARCHAR" property="payTypeRemark"/>
        <result column="order_type_txt" jdbcType="VARCHAR" property="orderTypeTxt"/>
        <result column="type_txt" jdbcType="VARCHAR" property="typeTxt"/>
        <result column="pay_type_remark" jdbcType="VARCHAR" property="payTypeRemark"/>
    </resultMap>

    <sql id="tb">
        momo
    </sql>

    <sql id="cols_all">
        id,
        user_id,
        thrid_store_id,
        store_name,
        store_id,
        order_no,
        created_at,
        actual_amount,
        is_refund,
        item_name,
        cost_price,
        item_price,
        num,
        total_item_actual_amount,
        pay_amount,
        pay_type_txt,
        order_type_txt,
        type_txt,
        pay_type_remark
    </sql>

    <select id="selectList" parameterType="map" resultMap="ResultMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        <where>
            order_no in
            <foreach collection="orderNoList" item="orderNo" index="index" open="(" close=")" separator=",">
                #{orderNo}
            </foreach>
        </where>
    </select>
</mapper>