SellerOrderGoodsMapper.xml
2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?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="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" />
</resultMap>
<sql id="Base_Column_List">
id, uid, product_id, product_name, storage_id, depot_no, size_id, size_name, color_id,
color_name, goods_price, status, image_id, image_url
</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>
</mapper>