SellerOrderGoodsMapper.xml 2.97 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.SellerOrderGoodsMapper">
    <resultMap id="BaseResultMap" type="com.yoho.order.model.SellerOrderGoods">
      <result column="id" property="id" jdbcType="INTEGER" />
      <result column="region" property="region" jdbcType="INTEGER" />
      <result column="uid" property="uid" jdbcType="INTEGER" />
      <result column="product_id" property="productId" jdbcType="INTEGER" />
      <result column="product_name" property="productName" jdbcType="VARCHAR" />
      <result column="storage_id" property="storageId" jdbcType="INTEGER" />
      <result column="depot_no" property="depotNo" jdbcType="INTEGER" />
      <result column="size_id" property="sizeId" jdbcType="INTEGER" />
      <result column="size_name" property="sizeName" jdbcType="VARCHAR" />
      <result column="color_id" property="colorId" jdbcType="SMALLINT" />
      <result column="color_name" property="colorName" jdbcType="VARCHAR" />
      <result column="goods_price" property="goodsPrice" jdbcType="DECIMAL" />
      <result column="status" property="status" jdbcType="TINYINT" />
      <result column="image_id" property="imageId" jdbcType="INTEGER" />
      <result column="image_url" property="imageUrl" jdbcType="VARCHAR" />
      <result column="region" property="region" jdbcType="INTEGER" />
      <result column="attributes" property="attributes" jdbcType="INTEGER" />
    </resultMap>

    <sql id="Base_Column_List">
        id, region, uid, product_id, product_name, storage_id, depot_no, size_id, size_name, color_id, 
        color_name, goods_price, status, image_id, image_url, attributes
    </sql>

    <select id="selectByIds" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" /> 
        from seller_order_goods where id in 
        <foreach collection="idList" item="id" open="(" close=")" separator=",">
          #{id}
        </foreach>
    </select>



    <select id="selectCountCanCell" resultType="java.lang.Integer" >
        select count(id)
        from seller_order_goods where uid = #{uid,jdbcType=INTEGER} and is_del = 1 and status = 1
    </select>

    
  <update id="updateSizeId">
    update seller_order_goods set size_id=#{newSizeId} where size_id in
    <foreach item="item" index="index" collection="oldSizeIdList" open="(" separator="," close=")">
      #{item}
    </foreach>
  </update>

  <select id="selectOrderGoodsBySkup" resultMap="BaseResultMap">
      select <include refid="Base_Column_List" />
      from seller_order_goods where id = #{skup}
  </select>
  
  <select id="selectBySkupsAndDepotNo" resultMap="BaseResultMap">
      select <include refid="Base_Column_List" />
      from seller_order_goods where depot_no=#{depotNo} 
      and id in 
      <foreach item="item" index="index" collection="skupList" open="(" separator="," close=")">
      #{item}
      </foreach>
  </select>
</mapper>