<?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.cy.WmOrderGiveGoodsDao">

    <resultMap id="OrderMap" type="com.zm.order.tool.server.model.WmOrderGiveGoods">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="store_id" jdbcType="BIGINT" property="storeId"/>
        <result column="user_id" jdbcType="BIGINT" property="userId"/>
        <result column="order_id" jdbcType="BIGINT" property="orderId"/>
        <result column="external_id" jdbcType="BIGINT" property="externalId"/>
        <result column="entity_id" jdbcType="VARCHAR" property="entityId"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="num" jdbcType="INTEGER" property="num"/>
        <result column="order_goods_id" jdbcType="BIGINT" property="orderGoodsId"/>
        <result column="spec" jdbcType="VARCHAR" property="spec"/>
        <result column="property" jdbcType="VARCHAR" property="property"/>
        <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
        <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
        <result column="group_id" jdbcType="BIGINT" property="groupId"/>
        <result column="is_mashup" jdbcType="INTEGER" property="isMashup"/>
        <result column="price" jdbcType="DECIMAL" property="price"/>
        <result column="trade_mark" jdbcType="VARCHAR" property="tradeMark"/>
        <result column="product_no" jdbcType="VARCHAR" property="productNo"/>
        <result column="barcode" jdbcType="VARCHAR" property="barcode"/>
        <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
        <result column="group_trade_mark" jdbcType="VARCHAR" property="groupTradeMark"/>
        <result column="original_price" jdbcType="DECIMAL" property="originalPrice"/>
        <result column="image" jdbcType="VARCHAR" property="image"/>
        <result column="pack_amount" jdbcType="DECIMAL" property="packAmount"/>
        <result column="packingMark" jdbcType="VARCHAR" property="packingMark"/>
    </resultMap>

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

    <sql id="cols_all">
        id,
        <include refid="cols_exclude_id"/>
    </sql>

    <sql id="cols_exclude_id">
        store_id,
        user_id,
        order_id,
        external_id,
        entity_id,
        name,
        num,
        order_goods_id,
        spec,
        property,
        created_at,
        updated_at,
        group_id,
        is_mashup,
        price,
        trade_mark,
        product_no,
        barcode,
        order_no,
        group_trade_mark,
        original_price,
        image,
        pack_amount,
        packingMark
    </sql>

    <select id="selectList" parameterType="map" resultMap="OrderMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        <where>
            order_goods_id in
            <foreach collection="list" item="orderGoodsId" index="index" open="(" close=")" separator=",">
                #{orderGoodsId}
            </foreach>
        </where>

    </select>

</mapper>