1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+ <mapper namespace =" self.springcloud.dao.ProductInfoMapper" >
4
+ <resultMap id =" BaseResultMap" type =" self.springcloud.domain.ProductInfo" >
5
+ <id column =" product_id" property =" productId" jdbcType =" VARCHAR" />
6
+ <result column =" product_name" property =" productName" jdbcType =" VARCHAR" />
7
+ <result column =" product_price" property =" productPrice" jdbcType =" DECIMAL" />
8
+ <result column =" product_stock" property =" productStock" jdbcType =" INTEGER" />
9
+ <result column =" product_description" property =" productDescription" jdbcType =" VARCHAR" />
10
+ <result column =" product_icon" property =" productIcon" jdbcType =" VARCHAR" />
11
+ <result column =" product_status" property =" productStatus" jdbcType =" TINYINT" />
12
+ <result column =" category_type" property =" categoryType" jdbcType =" INTEGER" />
13
+ <result column =" create_time" property =" createTime" jdbcType =" TIMESTAMP" />
14
+ <result column =" update_time" property =" updateTime" jdbcType =" TIMESTAMP" />
15
+ </resultMap >
16
+ <sql id =" Base_Column_List" >
17
+ product_id, product_name, product_price, product_stock, product_description, product_icon,
18
+ product_status, category_type, create_time, update_time
19
+ </sql >
20
+ <select id =" selectByPrimaryKey" resultMap =" BaseResultMap" parameterType =" java.lang.String" >
21
+ select
22
+ <include refid =" Base_Column_List" />
23
+ from product_info
24
+ where product_id = #{productId,jdbcType=VARCHAR}
25
+ </select >
26
+ <delete id =" deleteByPrimaryKey" parameterType =" java.lang.String" >
27
+ delete from product_info
28
+ where product_id = #{productId,jdbcType=VARCHAR}
29
+ </delete >
30
+ <insert id =" insert" parameterType =" self.springcloud.domain.ProductInfo" >
31
+ insert into product_info (product_id, product_name, product_price,
32
+ product_stock, product_description, product_icon,
33
+ product_status, category_type, create_time,
34
+ update_time)
35
+ values (#{productId,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, #{productPrice,jdbcType=DECIMAL},
36
+ #{productStock,jdbcType=INTEGER}, #{productDescription,jdbcType=VARCHAR}, #{productIcon,jdbcType=VARCHAR},
37
+ #{productStatus,jdbcType=TINYINT}, #{categoryType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
38
+ #{updateTime,jdbcType=TIMESTAMP})
39
+ </insert >
40
+ <insert id =" insertSelective" parameterType =" self.springcloud.domain.ProductInfo" >
41
+ insert into product_info
42
+ <trim prefix =" (" suffix =" )" suffixOverrides =" ," >
43
+ <if test =" productId != null" >
44
+ product_id,
45
+ </if >
46
+ <if test =" productName != null" >
47
+ product_name,
48
+ </if >
49
+ <if test =" productPrice != null" >
50
+ product_price,
51
+ </if >
52
+ <if test =" productStock != null" >
53
+ product_stock,
54
+ </if >
55
+ <if test =" productDescription != null" >
56
+ product_description,
57
+ </if >
58
+ <if test =" productIcon != null" >
59
+ product_icon,
60
+ </if >
61
+ <if test =" productStatus != null" >
62
+ product_status,
63
+ </if >
64
+ <if test =" categoryType != null" >
65
+ category_type,
66
+ </if >
67
+ <if test =" createTime != null" >
68
+ create_time,
69
+ </if >
70
+ <if test =" updateTime != null" >
71
+ update_time,
72
+ </if >
73
+ </trim >
74
+ <trim prefix =" values (" suffix =" )" suffixOverrides =" ," >
75
+ <if test =" productId != null" >
76
+ #{productId,jdbcType=VARCHAR},
77
+ </if >
78
+ <if test =" productName != null" >
79
+ #{productName,jdbcType=VARCHAR},
80
+ </if >
81
+ <if test =" productPrice != null" >
82
+ #{productPrice,jdbcType=DECIMAL},
83
+ </if >
84
+ <if test =" productStock != null" >
85
+ #{productStock,jdbcType=INTEGER},
86
+ </if >
87
+ <if test =" productDescription != null" >
88
+ #{productDescription,jdbcType=VARCHAR},
89
+ </if >
90
+ <if test =" productIcon != null" >
91
+ #{productIcon,jdbcType=VARCHAR},
92
+ </if >
93
+ <if test =" productStatus != null" >
94
+ #{productStatus,jdbcType=TINYINT},
95
+ </if >
96
+ <if test =" categoryType != null" >
97
+ #{categoryType,jdbcType=INTEGER},
98
+ </if >
99
+ <if test =" createTime != null" >
100
+ #{createTime,jdbcType=TIMESTAMP},
101
+ </if >
102
+ <if test =" updateTime != null" >
103
+ #{updateTime,jdbcType=TIMESTAMP},
104
+ </if >
105
+ </trim >
106
+ </insert >
107
+ <update id =" updateByPrimaryKeySelective" parameterType =" self.springcloud.domain.ProductInfo" >
108
+ update product_info
109
+ <set >
110
+ <if test =" productName != null" >
111
+ product_name = #{productName,jdbcType=VARCHAR},
112
+ </if >
113
+ <if test =" productPrice != null" >
114
+ product_price = #{productPrice,jdbcType=DECIMAL},
115
+ </if >
116
+ <if test =" productStock != null" >
117
+ product_stock = #{productStock,jdbcType=INTEGER},
118
+ </if >
119
+ <if test =" productDescription != null" >
120
+ product_description = #{productDescription,jdbcType=VARCHAR},
121
+ </if >
122
+ <if test =" productIcon != null" >
123
+ product_icon = #{productIcon,jdbcType=VARCHAR},
124
+ </if >
125
+ <if test =" productStatus != null" >
126
+ product_status = #{productStatus,jdbcType=TINYINT},
127
+ </if >
128
+ <if test =" categoryType != null" >
129
+ category_type = #{categoryType,jdbcType=INTEGER},
130
+ </if >
131
+ <if test =" createTime != null" >
132
+ create_time = #{createTime,jdbcType=TIMESTAMP},
133
+ </if >
134
+ <if test =" updateTime != null" >
135
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
136
+ </if >
137
+ </set >
138
+ where product_id = #{productId,jdbcType=VARCHAR}
139
+ </update >
140
+ <update id =" updateByPrimaryKey" parameterType =" self.springcloud.domain.ProductInfo" >
141
+ update product_info
142
+ set product_name = #{productName,jdbcType=VARCHAR},
143
+ product_price = #{productPrice,jdbcType=DECIMAL},
144
+ product_stock = #{productStock,jdbcType=INTEGER},
145
+ product_description = #{productDescription,jdbcType=VARCHAR},
146
+ product_icon = #{productIcon,jdbcType=VARCHAR},
147
+ product_status = #{productStatus,jdbcType=TINYINT},
148
+ category_type = #{categoryType,jdbcType=INTEGER},
149
+ create_time = #{createTime,jdbcType=TIMESTAMP},
150
+ update_time = #{updateTime,jdbcType=TIMESTAMP}
151
+ where product_id = #{productId,jdbcType=VARCHAR}
152
+ </update >
153
+ </mapper >
0 commit comments