|
3 | 3 | <mapper namespace="com.bookshop.dao.BooksMapper"> |
4 | 4 | <resultMap id="BaseResultMap" type="com.bookshop.modle.Books"> |
5 | 5 | <id column="b_id" jdbcType="VARCHAR" property="bId" /> |
| 6 | + <result column="b_pic" jdbcType="VARCHAR" property="bPic" /> |
6 | 7 | <result column="b_name" jdbcType="VARCHAR" property="bName" /> |
7 | 8 | <result column="b_description" jdbcType="VARCHAR" property="bDescription" /> |
8 | 9 | <result column="b_price" jdbcType="REAL" property="bPrice" /> |
|
13 | 14 | <result column="b_add_time" jdbcType="TIMESTAMP" property="bAddTime" /> |
14 | 15 | <result column="b_service" jdbcType="VARCHAR" property="bService" /> |
15 | 16 | <result column="b_sale_num" jdbcType="INTEGER" property="bSaleNum" /> |
| 17 | + <result column="b_state" jdbcType="INTEGER" property="bState" /> |
16 | 18 | </resultMap> |
17 | 19 | <sql id="Example_Where_Clause"> |
18 | 20 | <where> |
|
73 | 75 | </where> |
74 | 76 | </sql> |
75 | 77 | <sql id="Base_Column_List"> |
76 | | - b_id, b_name, b_description, b_price, b_discount, b_author, b_press, b_press_time, |
77 | | - b_add_time, b_service, b_sale_num |
| 78 | + b_id, b_pic, b_name, b_description, b_price, b_discount, b_author, b_press, b_press_time, |
| 79 | + b_add_time, b_service, b_sale_num, b_state |
78 | 80 | </sql> |
79 | 81 | <select id="selectByExample" parameterType="com.bookshop.modle.BooksExample" resultMap="BaseResultMap"> |
80 | 82 | select |
|
107 | 109 | </if> |
108 | 110 | </delete> |
109 | 111 | <insert id="insert" parameterType="com.bookshop.modle.Books"> |
110 | | - insert into books (b_id, b_name, b_description, |
111 | | - b_price, b_discount, b_author, |
112 | | - b_press, b_press_time, b_add_time, |
113 | | - b_service, b_sale_num) |
114 | | - values (#{bId,jdbcType=VARCHAR}, #{bName,jdbcType=VARCHAR}, #{bDescription,jdbcType=VARCHAR}, |
115 | | - #{bPrice,jdbcType=REAL}, #{bDiscount,jdbcType=INTEGER}, #{bAuthor,jdbcType=VARCHAR}, |
116 | | - #{bPress,jdbcType=VARCHAR}, #{bPressTime,jdbcType=DATE}, #{bAddTime,jdbcType=TIMESTAMP}, |
117 | | - #{bService,jdbcType=VARCHAR}, #{bSaleNum,jdbcType=INTEGER}) |
| 112 | + insert into books (b_id, b_pic, b_name, |
| 113 | + b_description, b_price, b_discount, |
| 114 | + b_author, b_press, b_press_time, |
| 115 | + b_add_time, b_service, b_sale_num, |
| 116 | + b_state) |
| 117 | + values (#{bId,jdbcType=VARCHAR}, #{bPic,jdbcType=VARCHAR}, #{bName,jdbcType=VARCHAR}, |
| 118 | + #{bDescription,jdbcType=VARCHAR}, #{bPrice,jdbcType=REAL}, #{bDiscount,jdbcType=INTEGER}, |
| 119 | + #{bAuthor,jdbcType=VARCHAR}, #{bPress,jdbcType=VARCHAR}, #{bPressTime,jdbcType=DATE}, |
| 120 | + #{bAddTime,jdbcType=TIMESTAMP}, #{bService,jdbcType=VARCHAR}, #{bSaleNum,jdbcType=INTEGER}, |
| 121 | + #{bState,jdbcType=INTEGER}) |
118 | 122 | </insert> |
119 | 123 | <insert id="insertSelective" parameterType="com.bookshop.modle.Books"> |
120 | 124 | insert into books |
121 | 125 | <trim prefix="(" suffix=")" suffixOverrides=","> |
122 | 126 | <if test="bId != null"> |
123 | 127 | b_id, |
124 | 128 | </if> |
| 129 | + <if test="bPic != null"> |
| 130 | + b_pic, |
| 131 | + </if> |
125 | 132 | <if test="bName != null"> |
126 | 133 | b_name, |
127 | 134 | </if> |
|
152 | 159 | <if test="bSaleNum != null"> |
153 | 160 | b_sale_num, |
154 | 161 | </if> |
| 162 | + <if test="bState != null"> |
| 163 | + b_state, |
| 164 | + </if> |
155 | 165 | </trim> |
156 | 166 | <trim prefix="values (" suffix=")" suffixOverrides=","> |
157 | 167 | <if test="bId != null"> |
158 | 168 | #{bId,jdbcType=VARCHAR}, |
| 169 | + </if> |
| 170 | + <if test="bPic != null"> |
| 171 | + #{bPic,jdbcType=VARCHAR}, |
159 | 172 | </if> |
160 | 173 | <if test="bName != null"> |
161 | 174 | #{bName,jdbcType=VARCHAR}, |
|
187 | 200 | <if test="bSaleNum != null"> |
188 | 201 | #{bSaleNum,jdbcType=INTEGER}, |
189 | 202 | </if> |
| 203 | + <if test="bState != null"> |
| 204 | + #{bState,jdbcType=INTEGER}, |
| 205 | + </if> |
190 | 206 | </trim> |
191 | 207 | </insert> |
192 | 208 | <select id="countByExample" parameterType="com.bookshop.modle.BooksExample" resultType="java.lang.Long"> |
|
200 | 216 | <set> |
201 | 217 | <if test="record.bId != null"> |
202 | 218 | b_id = #{record.bId,jdbcType=VARCHAR}, |
| 219 | + </if> |
| 220 | + <if test="record.bPic != null"> |
| 221 | + b_pic = #{record.bPic,jdbcType=VARCHAR}, |
203 | 222 | </if> |
204 | 223 | <if test="record.bName != null"> |
205 | 224 | b_name = #{record.bName,jdbcType=VARCHAR}, |
|
231 | 250 | <if test="record.bSaleNum != null"> |
232 | 251 | b_sale_num = #{record.bSaleNum,jdbcType=INTEGER}, |
233 | 252 | </if> |
| 253 | + <if test="record.bState != null"> |
| 254 | + b_state = #{record.bState,jdbcType=INTEGER}, |
| 255 | + </if> |
234 | 256 | </set> |
235 | 257 | <if test="_parameter != null"> |
236 | 258 | <include refid="Update_By_Example_Where_Clause" /> |
|
239 | 261 | <update id="updateByExample" parameterType="map"> |
240 | 262 | update books |
241 | 263 | set b_id = #{record.bId,jdbcType=VARCHAR}, |
| 264 | + b_pic = #{record.bPic,jdbcType=VARCHAR}, |
242 | 265 | b_name = #{record.bName,jdbcType=VARCHAR}, |
243 | 266 | b_description = #{record.bDescription,jdbcType=VARCHAR}, |
244 | 267 | b_price = #{record.bPrice,jdbcType=REAL}, |
|
248 | 271 | b_press_time = #{record.bPressTime,jdbcType=DATE}, |
249 | 272 | b_add_time = #{record.bAddTime,jdbcType=TIMESTAMP}, |
250 | 273 | b_service = #{record.bService,jdbcType=VARCHAR}, |
251 | | - b_sale_num = #{record.bSaleNum,jdbcType=INTEGER} |
| 274 | + b_sale_num = #{record.bSaleNum,jdbcType=INTEGER}, |
| 275 | + b_state = #{record.bState,jdbcType=INTEGER} |
252 | 276 | <if test="_parameter != null"> |
253 | 277 | <include refid="Update_By_Example_Where_Clause" /> |
254 | 278 | </if> |
255 | 279 | </update> |
256 | 280 | <update id="updateByPrimaryKeySelective" parameterType="com.bookshop.modle.Books"> |
257 | 281 | update books |
258 | 282 | <set> |
| 283 | + <if test="bPic != null"> |
| 284 | + b_pic = #{bPic,jdbcType=VARCHAR}, |
| 285 | + </if> |
259 | 286 | <if test="bName != null"> |
260 | 287 | b_name = #{bName,jdbcType=VARCHAR}, |
261 | 288 | </if> |
|
286 | 313 | <if test="bSaleNum != null"> |
287 | 314 | b_sale_num = #{bSaleNum,jdbcType=INTEGER}, |
288 | 315 | </if> |
| 316 | + <if test="bState != null"> |
| 317 | + b_state = #{bState,jdbcType=INTEGER}, |
| 318 | + </if> |
289 | 319 | </set> |
290 | 320 | where b_id = #{bId,jdbcType=VARCHAR} |
291 | 321 | </update> |
292 | 322 | <update id="updateByPrimaryKey" parameterType="com.bookshop.modle.Books"> |
293 | 323 | update books |
294 | | - set b_name = #{bName,jdbcType=VARCHAR}, |
| 324 | + set b_pic = #{bPic,jdbcType=VARCHAR}, |
| 325 | + b_name = #{bName,jdbcType=VARCHAR}, |
295 | 326 | b_description = #{bDescription,jdbcType=VARCHAR}, |
296 | 327 | b_price = #{bPrice,jdbcType=REAL}, |
297 | 328 | b_discount = #{bDiscount,jdbcType=INTEGER}, |
|
300 | 331 | b_press_time = #{bPressTime,jdbcType=DATE}, |
301 | 332 | b_add_time = #{bAddTime,jdbcType=TIMESTAMP}, |
302 | 333 | b_service = #{bService,jdbcType=VARCHAR}, |
303 | | - b_sale_num = #{bSaleNum,jdbcType=INTEGER} |
| 334 | + b_sale_num = #{bSaleNum,jdbcType=INTEGER}, |
| 335 | + b_state = #{bState,jdbcType=INTEGER} |
304 | 336 | where b_id = #{bId,jdbcType=VARCHAR} |
305 | 337 | </update> |
306 | 338 |
|
|
0 commit comments