BuyerOrderGoodsMapper.xml 2.17 KB
<?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.yoho.order.dal.BuyerOrderGoodsMapper">
    <resultMap id="BaseResultMap" type="com.yoho.order.model.BuyerOrderGoods">
      <result column="id" property="id" jdbcType="INTEGER" />
      <result column="uid" property="uid" jdbcType="INTEGER" />
      <result column="order_code" property="orderCode" jdbcType="BIGINT" />
      <result column="skup" property="skup" jdbcType="INTEGER" />
      <result column="goods_price" property="goodsPrice" jdbcType="DECIMAL" />
      <result column="goods_amount" property="goodsAmount" jdbcType="DECIMAL" />
      <result column="coupon_cut_amount" property="couponCutAmount" jdbcType="DECIMAL" />
      <result column="activity_cut_amount" property="activityCutAmount" jdbcType="DECIMAL" />
      <result column="tariff_amount" jdbcType="DECIMAL" property="tariffAmount" />
      <result column="cut_tariff_amount" jdbcType="DECIMAL" property="cutTariffAmount" />
      <result column="deposit_amount" jdbcType="DECIMAL" property="depositAmount" />
      <result column="cut_promotion_amount" jdbcType="DECIMAL" property="cutPromotionAmount" />
    </resultMap>
    
    <sql id="Base_Column_List">
        id, uid, order_code, skup, goods_price, goods_amount, coupon_cut_amount,activity_cut_amount, tariff_amount, cut_tariff_amount, deposit_amount,cut_promotion_amount
    </sql>

    <select id="selectById" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from buyer_order_goods where id = #{id}
    </select>
    
    <select id="selectByOrderCode" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />  
        from buyer_order_goods
        where order_code in 
        <foreach collection="orderCodeList" item="orderCode" open="(" close=")" separator=",">
          #{orderCode}
        </foreach>
    </select>


    <select id="selectByOrderCodeOne" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from buyer_order_goods
        where order_code = #{orderCode} limit 1
    </select>
    

</mapper>