<?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.qs.mp.channel.mapper.ChannelGoodsOrderItemMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.qs.mp.channel.domain.ChannelGoodsOrderItem">
        <id column="item_id" property="itemId" />
        <result column="channel_id" property="channelId" />
        <result column="order_id" property="orderId" />
        <result column="goods_id" property="goodsId" />
        <result column="sku_id" property="skuId" />
        <result column="properties" property="properties" />
        <result column="title" property="title" />
        <result column="pic_url" property="picUrl" />
        <result column="goods_num" property="goodsNum" />
        <result column="supplier_id" property="supplierId" />
        <result column="created_time" property="createdTime" />
        <result column="updated_time" property="updatedTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        item_id, channel_id, order_id, goods_id, sku_id, properties, title, pic_url, goods_num, supplier_id, created_time, updated_time
    </sql>
    <select id="selectChannelGoodsOrderItemVOList"
            resultType="com.qs.mp.channel.domain.vo.ChannelGoodsOrderItemVO">
        select t1.*,t2.title,t2.purchase_price,t2.purchase_cost
        from mp_channel_goods_order_item t1
        left join mp_goods t2 on t1.goods_id = t2.goods_id
        ${ew.customSqlSegment}
    </select>

</mapper>