<?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.WmOrderAttachGoodsDao">

    <resultMap id="OrderMap" type="com.zm.order.tool.server.model.WmOrderAttachGoods">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
        <result column="order_id" jdbcType="BIGINT" property="orderId"/>
        <result column="store_id" jdbcType="BIGINT" property="storeId"/>
        <result column="user_id" jdbcType="BIGINT" property="userId"/>
        <result column="material_id" jdbcType="BIGINT" property="materialId"/>
        <result column="qty" jdbcType="INTEGER" property="qty"/>
        <result column="price" jdbcType="VARCHAR" property="price"/>
        <result column="order_goods_id" jdbcType="BIGINT" property="orderGoodsId"/>
        <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
        <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
        <result column="code" jdbcType="VARCHAR" property="code"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
    </resultMap>

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

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

    <sql id="cols_exclude_id">
        order_no, order_id, store_id, user_id, material_id, qty, price, order_goods_id, created_at, updated_at, code, name
    </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>