ProductPriceMapper.xml
6.35 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?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.search.dal.ProductPriceMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ProductPrice">
<id column="product_skn" property="productSkn" jdbcType="INTEGER" />
<result column="retail_price" property="retailPrice" jdbcType="DECIMAL" />
<result column="sales_price" property="salesPrice" jdbcType="DECIMAL" />
<result column="current_price" property="currentPrice" jdbcType="DECIMAL" />
<result column="purchase_price" property="purchasePrice" jdbcType="DECIMAL" />
<result column="vip_discount_type" property="vipDiscountType" jdbcType="INTEGER" />
<result column="current_vip_discount_type" property="currentVipDiscountType" jdbcType="INTEGER" />
<result column="vip_discount" property="vipDiscount" jdbcType="DECIMAL" />
<result column="vip_price" property="vipPrice" jdbcType="DECIMAL" />
<result column="vip1_price" property="vip1Price" jdbcType="DECIMAL" />
<result column="vip2_price" property="vip2Price" jdbcType="DECIMAL" />
<result column="vip3_price" property="vip3Price" jdbcType="DECIMAL" />
<result column="student_price" property="studentPrice" jdbcType="DECIMAL" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="student_coin_rate" property="studentCoinRate" jdbcType="DECIMAL" />
<result column="lastReducePriceTime" property="lastReducePriceTime" jdbcType="INTEGER" />
<result column="product_vip_status" property="productVipStatus" jdbcType="INTEGER" />
<result column="basic_price" property="basicPrice" jdbcType="DECIMAL" />
<result column="purchase_discount" property="purchaseDiscount" jdbcType="DECIMAL" />
</resultMap>
<sql id="Base_Column_List">
product_skn,retail_price, sales_price,current_price, purchase_price,
vip_discount_type, current_vip_discount_type, vip_discount, vip_price,
vip1_price, vip2_price,
vip3_price,student_price,
update_time,student_coin_rate,lastReducePriceTime,
product_vip_status,basic_price,purchase_discount
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer" timeout="20000">
select
<include refid="Base_Column_List" />
from product_price
where product_skn = #{productSkn,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"
timeout="20000">
delete from product_price
where product_skn =
#{productSkn,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.search.dal.model.ProductPrice"
timeout="20000">
insert ignore into product_price (
retail_price, sales_price,current_price, purchase_price,
vip_discount_type, current_vip_discount_type, vip_discount, vip_price,
vip1_price, vip2_price, vip3_price,student_price,
product_skn, update_time, student_coin_rate,lastReducePriceTime,
product_vip_status,basic_price,purchase_discount
)values (
#{retailPrice,jdbcType=DECIMAL},#{salesPrice,jdbcType=DECIMAL},#{currentPrice,jdbcType=DECIMAL},
#{purchasePrice,jdbcType=DECIMAL},#{vipDiscountType,jdbcType=INTEGER},#{currentVipDiscountType,jdbcType=INTEGER},
#{vipDiscount,jdbcType=DECIMAL}, #{vipPrice,jdbcType=DECIMAL},
#{vip1Price,jdbcType=DECIMAL},
#{vip2Price,jdbcType=DECIMAL},#{vip3Price,jdbcType=DECIMAL},#{studentPrice,jdbcType=DECIMAL},
#{productSkn,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}
,#{studentCoinRate,jdbcType=DECIMAL},#{lastReducePriceTime,jdbcType=INTEGER},
#{productVipStatus,jdbcType=INTEGER},#{basicPrice,jdbcType=DECIMAL},#{purchaseDiscount,jdbcType=DECIMAL}
)
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ProductPrice"
timeout="20000">
update product_price
<set>
<if test="retailPrice != null">
retail_price = #{retailPrice,jdbcType=DECIMAL},
</if>
<if test="salesPrice != null">
sales_price = #{salesPrice,jdbcType=DECIMAL},
</if>
<if test="currentPrice != null">
current_price = #{currentPrice,jdbcType=DECIMAL},
</if>
<if test="purchasePrice != null">
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
</if>
<if test="vipDiscountType != null">
vip_discount_type = #{vipDiscountType,jdbcType=INTEGER},
</if>
<if test="currentVipDiscountType != null">
current_vip_discount_type = #{currentVipDiscountType,jdbcType=INTEGER},
</if>
<if test="vipDiscount != null">
vip_discount = #{vipDiscount,jdbcType=DECIMAL},
</if>
<if test="vipPrice != null">
vip_price = #{vipPrice,jdbcType=DECIMAL},
</if>
<if test="vip1Price != null">
vip1_price = #{vip1Price,jdbcType=DECIMAL},
</if>
<if test="vip2Price != null">
vip2_price = #{vip2Price,jdbcType=DECIMAL},
</if>
<if test="vip3Price != null">
vip3_price = #{vip3Price,jdbcType=DECIMAL},
</if>
<if test="studentPrice != null">
student_price = #{studentPrice,jdbcType=DECIMAL},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=INTEGER},
</if>
<if test="studentCoinRate != null">
student_coin_rate = #{studentCoinRate,jdbcType=DECIMAL},
</if>
<if test="lastReducePriceTime != null">
lastReducePriceTime = #{lastReducePriceTime,jdbcType=INTEGER},
</if>
<if test="productVipStatus != null">
product_vip_status = #{productVipStatus,jdbcType=INTEGER},
</if>
<if test="basicPrice != null">
basic_price = #{basicPrice,jdbcType=DECIMAL},
</if>
<if test="purchaseDiscount != null">
purchase_discount = #{purchaseDiscount,jdbcType=DECIMAL},
</if>
</set>
where product_skn = #{productSkn,jdbcType=INTEGER}
</update>
<select id="selectCount" resultType="java.lang.Integer" timeout="20000">
SELECT count(1) FROM product_price
</select>
<select id="selectPageLists" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List" />
from product_price limit #{offset},#{pageSize}
</select>
<select id="selectBySknList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from product_price where product_skn in
<foreach item="item" index="index" collection="list" open="("
separator="," close=")">
#{item}
</foreach>
</select>
</mapper>