SellerOrderMapper.xml
3.18 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?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.SellerOrderMapper">
<resultMap id="BaseResultMap" type="com.yoho.order.model.SellerOrder">
<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="client_type" property="clientType" jdbcType="TINYINT" />
<result column="payment" property="payment" jdbcType="TINYINT" />
<result column="income" property="income" jdbcType="DECIMAL" />
<result column="earnest_money" property="earnestMoney" jdbcType="DECIMAL" />
<result column="status" property="status" jdbcType="TINYINT" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, uid, order_code, skup, client_type, payment, income, earnest_money,
status, create_time, update_time
</sql>
<select id="selectById" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from seller_order where id = #{id}
</select>
<select id="selectBySkups" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from seller_order where skup in
<foreach collection="skupList" item="skup" open="(" close=")" separator=",">
#{skup}
</foreach>
</select>
<select id="selectBySkup" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from seller_order where skup = #{skup}
</select>
<select id="selectByOrderCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from seller_order where order_code = #{orderCode}
</select>
<update id="updateOrderGoodsNameAndImg" parameterType="com.yoho.product.model.ProductNameAndImgReq">
UPDATE
seller_order_goods sog
SET sog.image_url = #{imgUrl},
sog.product_name = #{productName}
WHERE
(sog.image_url != #{imgUrl} OR sog.product_name != #{productName} )
AND sog.attributes NOT IN ( 5, 6 )
AND sog.is_del = 1
AND sog.status in (0,1)
AND sog.storage_id IN
<foreach collection="storages" close=")" open="(" item="item" separator=",">
#{item}
</foreach>
LIMIT 100
</update>
<select id="countByOrderGoodsNameAndImg" parameterType="com.yoho.product.model.ProductNameAndImgReq" resultType="int">
SELECT
count(1)
FROM seller_order_goods sog
WHERE
(sog.image_url != #{imgUrl} OR sog.product_name != #{productName} )
AND sog.attributes NOT IN ( 5, 6 )
AND sog.is_del = 1
AND sog.status in (0,1)
AND sog.storage_id IN
<foreach collection="storages" close=")" open="(" item="item" separator=",">
#{item}
</foreach>
</select>
</mapper>