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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.qs.mp.channel.domain.ChannelGoodsSettleOrderItem">
        <id column="item_id" property="itemId" />
        <result column="channel_id" property="channelId" />
        <result column="order_id" property="orderId" />
        <result column="channel_goods_id" property="channelGoodsId" />
        <result column="title" property="title" />
        <result column="pic_url" property="picUrl" />
        <result column="quantity" property="quantity" />
        <result column="created_time" property="createdTime" />
        <result column="updated_time" property="updatedTime" />
        <result column="purchase_cost" property="purchaseCost" />
        <result column="verify_qty" property="verifyQty" />
        <result column="remain_qty" property="remainQty" />
        <result column="settle_qty" property="settleQty" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        item_id, channel_id, order_id, channel_goods_id, title, pic_url, goods_num, created_time, updated_time, purchase_cost, verify_qty, remain_qty, settle_qty
    </sql>
    <select id="listSettleOrderItemVO" resultType="com.qs.mp.channel.domain.vo.ChannelGoodsSettleOrderItemVO">
        select t1.*,t2.properties,t2.goods_id,t2.order_id as purchaseOrderId
        from mp_channel_goods_settle_order_item t1
        left join mp_channel_goods t2 on t1.channel_goods_id = t2.id
            ${ew.customSqlSegment}
    </select>

</mapper>