GoodsDayWriteMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  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="com.slodon.b2b2c.dao.write.statistics.GoodsDayWriteMapper">
  4. <resultMap id="resultMap" type="com.slodon.b2b2c.statistics.pojo.GoodsDay">
  5. <id column="stats_id" property="statsId" />
  6. <result column="stats_time" property="statsTime" />
  7. <result column="web_site" property="webSite" />
  8. <result column="goods_id" property="goodsId" />
  9. <result column="goods_name" property="goodsName" />
  10. <result column="goods_image" property="goodsImage" />
  11. <result column="visitor_num" property="visitorNum" />
  12. <result column="view_num" property="viewNum" />
  13. <result column="order_submit_num" property="orderSubmitNum" />
  14. <result column="order_submit_amount" property="orderSubmitAmount" />
  15. <result column="order_pay_num" property="orderPayNum" />
  16. <result column="sale_amount" property="saleAmount" />
  17. <result column="sale_num" property="saleNum" />
  18. <result column="collection_num" property="collectionNum" />
  19. <result column="add_cart_member_num" property="addCartMemberNum" />
  20. <result column="brand_id" property="brandId" />
  21. <result column="brand_name" property="brandName" />
  22. <result column="store_id" property="storeId" />
  23. <result column="store_name" property="storeName" />
  24. <result column="goods_category_id1" property="goodsCategoryId1" />
  25. <result column="goods_category_name1" property="goodsCategoryName1" />
  26. <result column="goods_price" property="goodsPrice" />
  27. <result column="return_num" property="returnNum" />
  28. <result column="return_product_num" property="returnProductNum" />
  29. <result column="return_amount" property="returnAmount" />
  30. <result column="order_submit_member_num" property="orderSubmitMemberNum" />
  31. </resultMap>
  32. <!--除主键外的所有字段,用于插入操作-->
  33. <sql id="columns">
  34. <trim suffixOverrides=",">
  35. <if test="statsTime != null">
  36. `stats_time`,
  37. </if>
  38. <if test="webSite != null">
  39. `web_site`,
  40. </if>
  41. <if test="goodsId != null">
  42. `goods_id`,
  43. </if>
  44. <if test="goodsName != null">
  45. `goods_name`,
  46. </if>
  47. <if test="goodsImage != null">
  48. `goods_image`,
  49. </if>
  50. <if test="visitorNum != null">
  51. `visitor_num`,
  52. </if>
  53. <if test="viewNum != null">
  54. `view_num`,
  55. </if>
  56. <if test="orderSubmitNum != null">
  57. `order_submit_num`,
  58. </if>
  59. <if test="orderSubmitAmount != null">
  60. `order_submit_amount`,
  61. </if>
  62. <if test="orderPayNum != null">
  63. `order_pay_num`,
  64. </if>
  65. <if test="saleAmount != null">
  66. `sale_amount`,
  67. </if>
  68. <if test="saleNum != null">
  69. `sale_num`,
  70. </if>
  71. <if test="collectionNum != null">
  72. `collection_num`,
  73. </if>
  74. <if test="addCartMemberNum != null">
  75. `add_cart_member_num`,
  76. </if>
  77. <if test="brandId != null">
  78. `brand_id`,
  79. </if>
  80. <if test="brandName != null">
  81. `brand_name`,
  82. </if>
  83. <if test="storeId != null">
  84. `store_id`,
  85. </if>
  86. <if test="storeName != null">
  87. `store_name`,
  88. </if>
  89. <if test="goodsCategoryId1 != null">
  90. `goods_category_id1`,
  91. </if>
  92. <if test="goodsCategoryName1 != null">
  93. `goods_category_name1`,
  94. </if>
  95. <if test="goodsPrice != null">
  96. `goods_price`,
  97. </if>
  98. <if test="returnNum != null">
  99. `return_num`,
  100. </if>
  101. <if test="returnProductNum != null">
  102. `return_product_num`,
  103. </if>
  104. <if test="returnAmount != null">
  105. `return_amount`,
  106. </if>
  107. <if test="orderSubmitMemberNum != null">
  108. `order_submit_member_num`,
  109. </if>
  110. </trim>
  111. </sql>
  112. <!--按照主键值进行操作-->
  113. <sql id="pkWhere">
  114. WHERE `stats_id` = #{primaryKey}
  115. </sql>
  116. <!--操作条件-->
  117. <sql id="whereCondition">
  118. <if test="example != null">
  119. <trim prefix="WHERE" prefixOverrides="AND|OR">
  120. <if test="example.statsIdNotEquals != null">
  121. AND `stats_id` != #{example.statsIdNotEquals}
  122. </if>
  123. <if test="example.statsIdIn != null">
  124. AND `stats_id` in (${example.statsIdIn})
  125. </if>
  126. <if test="example.statsTimeAfter != null">
  127. AND `stats_time` <![CDATA[ >= ]]> #{example.statsTimeAfter}
  128. </if>
  129. <if test="example.statsTimeBefore != null">
  130. AND `stats_time` <![CDATA[ <= ]]> #{example.statsTimeBefore}
  131. </if>
  132. <if test="example.webSite != null">
  133. AND `web_site` = #{example.webSite}
  134. </if>
  135. <if test="example.goodsId != null">
  136. AND `goods_id` = #{example.goodsId}
  137. </if>
  138. <if test="example.goodsName != null">
  139. AND `goods_name` = #{example.goodsName}
  140. </if>
  141. <if test="example.goodsNameLike != null">
  142. AND `goods_name` like concat('%',#{example.goodsNameLike},'%')
  143. </if>
  144. <if test="example.goodsImage != null">
  145. AND `goods_image` = #{example.goodsImage}
  146. </if>
  147. <if test="example.visitorNum != null">
  148. AND `visitor_num` = #{example.visitorNum}
  149. </if>
  150. <if test="example.viewNum != null">
  151. AND `view_num` = #{example.viewNum}
  152. </if>
  153. <if test="example.orderSubmitNum != null">
  154. AND `order_submit_num` = #{example.orderSubmitNum}
  155. </if>
  156. <if test="example.orderSubmitAmount != null">
  157. AND `order_submit_amount` = #{example.orderSubmitAmount}
  158. </if>
  159. <if test="example.orderPayNum != null">
  160. AND `order_pay_num` = #{example.orderPayNum}
  161. </if>
  162. <if test="example.saleAmount != null">
  163. AND `sale_amount` = #{example.saleAmount}
  164. </if>
  165. <if test="example.saleNum != null">
  166. AND `sale_num` = #{example.saleNum}
  167. </if>
  168. <if test="example.collectionNum != null">
  169. AND `collection_num` = #{example.collectionNum}
  170. </if>
  171. <if test="example.addCartMemberNum != null">
  172. AND `add_cart_member_num` = #{example.addCartMemberNum}
  173. </if>
  174. <if test="example.brandId != null">
  175. AND `brand_id` = #{example.brandId}
  176. </if>
  177. <if test="example.brandName != null">
  178. AND `brand_name` = #{example.brandName}
  179. </if>
  180. <if test="example.brandNameLike != null">
  181. AND `brand_name` like concat('%',#{example.brandNameLike},'%')
  182. </if>
  183. <if test="example.storeId != null">
  184. AND `store_id` = #{example.storeId}
  185. </if>
  186. <if test="example.storeName != null">
  187. AND `store_name` = #{example.storeName}
  188. </if>
  189. <if test="example.storeNameLike != null">
  190. AND `store_name` like concat('%',#{example.storeNameLike},'%')
  191. </if>
  192. <if test="example.goodsCategoryId1 != null">
  193. AND `goods_category_id1` = #{example.goodsCategoryId1}
  194. </if>
  195. <if test="example.goodsCategoryName1 != null">
  196. AND `goods_category_name1` = #{example.goodsCategoryName1}
  197. </if>
  198. <if test="example.goodsCategoryName1Like != null">
  199. AND `goods_category_name1` like concat('%',#{example.goodsCategoryName1Like},'%')
  200. </if>
  201. <if test="example.goodsPrice != null">
  202. AND `goods_price` = #{example.goodsPrice}
  203. </if>
  204. <if test="example.returnNum != null">
  205. AND `return_num` = #{example.returnNum}
  206. </if>
  207. <if test="example.returnProductNum != null">
  208. AND `return_product_num` = #{example.returnProductNum}
  209. </if>
  210. <if test="example.returnAmount != null">
  211. AND `return_amount` = #{example.returnAmount}
  212. </if>
  213. <if test="example.orderSubmitMemberNum != null">
  214. AND `order_submit_member_num` = #{example.orderSubmitMemberNum}
  215. </if>
  216. </trim>
  217. </if>
  218. </sql>
  219. <!--排序条件-->
  220. <sql id="orderBy">
  221. ORDER BY `stats_id` DESC
  222. </sql>
  223. <sql id="orderByOther">
  224. order by ${example.orderBy}
  225. </sql>
  226. <!--分组条件-->
  227. <sql id="groupBy">
  228. group by ${example.groupBy}
  229. </sql>
  230. <!--分页条件-->
  231. <sql id="limit">
  232. <if test="size != null and size &gt; 0">
  233. limit #{startRow},#{size}
  234. </if>
  235. </sql>
  236. <!--查询符合条件的记录数-->
  237. <select id="countByExample" parameterType="com.slodon.b2b2c.statistics.example.GoodsDayExample" resultType="java.lang.Integer">
  238. SELECT
  239. COUNT(*)
  240. FROM `stats_goods_day`
  241. <include refid="whereCondition" />
  242. </select>
  243. <!--根据主键查询记录-->
  244. <select id="getByPrimaryKey" resultMap="resultMap">
  245. SELECT
  246. *
  247. FROM `stats_goods_day`
  248. <include refid="pkWhere" />
  249. </select>
  250. <!--查询符合条件的记录(所有字段)-->
  251. <select id="listByExample" resultMap="resultMap">
  252. SELECT
  253. *
  254. FROM `stats_goods_day`
  255. <include refid="whereCondition" />
  256. <if test="example.groupBy != null">
  257. <include refid="groupBy" />
  258. </if>
  259. <choose>
  260. <when test="example.orderBy != null">
  261. <include refid="orderByOther" />
  262. </when>
  263. <otherwise>
  264. <include refid="orderBy" />
  265. </otherwise>
  266. </choose>
  267. </select>
  268. <!--分页查询符合条件的记录(所有字段)-->
  269. <select id="listPageByExample" resultMap="resultMap">
  270. SELECT
  271. *
  272. FROM `stats_goods_day`
  273. <include refid="whereCondition" />
  274. <if test="example.groupBy != null">
  275. <include refid="groupBy" />
  276. </if>
  277. <choose>
  278. <when test="example.orderBy != null">
  279. <include refid="orderByOther" />
  280. </when>
  281. <otherwise>
  282. <include refid="orderBy" />
  283. </otherwise>
  284. </choose>
  285. <include refid="limit" />
  286. </select>
  287. <!--查询符合条件的记录(指定字段)-->
  288. <select id="listFieldsByExample" resultMap="resultMap">
  289. SELECT
  290. ${fields}
  291. FROM `stats_goods_day`
  292. <include refid="whereCondition" />
  293. <if test="example.groupBy != null">
  294. <include refid="groupBy" />
  295. </if>
  296. <choose>
  297. <when test="example.orderBy != null">
  298. <include refid="orderByOther" />
  299. </when>
  300. <otherwise>
  301. <include refid="orderBy" />
  302. </otherwise>
  303. </choose>
  304. </select>
  305. <!--分页查询符合条件的记录(指定字段)-->
  306. <select id="listFieldsPageByExample" resultMap="resultMap">
  307. SELECT
  308. ${fields}
  309. FROM `stats_goods_day`
  310. <include refid="whereCondition" />
  311. <if test="example.groupBy != null">
  312. <include refid="groupBy" />
  313. </if>
  314. <choose>
  315. <when test="example.orderBy != null">
  316. <include refid="orderByOther" />
  317. </when>
  318. <otherwise>
  319. <include refid="orderBy" />
  320. </otherwise>
  321. </choose>
  322. <include refid="limit" />
  323. </select>
  324. <!--根据条件删除记录,可多条删除-->
  325. <delete id="deleteByExample">
  326. DELETE FROM `stats_goods_day`
  327. <include refid="whereCondition" />
  328. </delete>
  329. <!--根据主键删除记录-->
  330. <delete id="deleteByPrimaryKey">
  331. DELETE FROM `stats_goods_day`
  332. <include refid="pkWhere" />
  333. </delete>
  334. <!--插入一条记录-->
  335. <insert id="insert" keyColumn="stats_id" keyProperty="statsId" parameterType="com.slodon.b2b2c.statistics.pojo.GoodsDay" useGeneratedKeys="true">
  336. INSERT INTO `stats_goods_day`(
  337. <include refid="columns" />
  338. )
  339. VALUES(
  340. <trim suffixOverrides=",">
  341. <if test="statsTime != null">
  342. #{statsTime},
  343. </if>
  344. <if test="webSite != null">
  345. #{webSite},
  346. </if>
  347. <if test="goodsId != null">
  348. #{goodsId},
  349. </if>
  350. <if test="goodsName != null">
  351. #{goodsName},
  352. </if>
  353. <if test="goodsImage != null">
  354. #{goodsImage},
  355. </if>
  356. <if test="visitorNum != null">
  357. #{visitorNum},
  358. </if>
  359. <if test="viewNum != null">
  360. #{viewNum},
  361. </if>
  362. <if test="orderSubmitNum != null">
  363. #{orderSubmitNum},
  364. </if>
  365. <if test="orderSubmitAmount != null">
  366. #{orderSubmitAmount},
  367. </if>
  368. <if test="orderPayNum != null">
  369. #{orderPayNum},
  370. </if>
  371. <if test="saleAmount != null">
  372. #{saleAmount},
  373. </if>
  374. <if test="saleNum != null">
  375. #{saleNum},
  376. </if>
  377. <if test="collectionNum != null">
  378. #{collectionNum},
  379. </if>
  380. <if test="addCartMemberNum != null">
  381. #{addCartMemberNum},
  382. </if>
  383. <if test="brandId != null">
  384. #{brandId},
  385. </if>
  386. <if test="brandName != null">
  387. #{brandName},
  388. </if>
  389. <if test="storeId != null">
  390. #{storeId},
  391. </if>
  392. <if test="storeName != null">
  393. #{storeName},
  394. </if>
  395. <if test="goodsCategoryId1 != null">
  396. #{goodsCategoryId1},
  397. </if>
  398. <if test="goodsCategoryName1 != null">
  399. #{goodsCategoryName1},
  400. </if>
  401. <if test="goodsPrice != null">
  402. #{goodsPrice},
  403. </if>
  404. <if test="returnNum != null">
  405. #{returnNum},
  406. </if>
  407. <if test="returnProductNum != null">
  408. #{returnProductNum},
  409. </if>
  410. <if test="returnAmount != null">
  411. #{returnAmount},
  412. </if>
  413. <if test="orderSubmitMemberNum != null">
  414. #{orderSubmitMemberNum},
  415. </if>
  416. </trim>
  417. )
  418. </insert>
  419. <!--按条件更新记录中不为空的字段-->
  420. <update id="updateByExampleSelective">
  421. UPDATE `stats_goods_day`
  422. <trim prefix="SET" suffixOverrides=",">
  423. <if test="record.statsTime != null">
  424. `stats_time` = #{record.statsTime},
  425. </if>
  426. <if test="record.webSite != null">
  427. `web_site` = #{record.webSite},`
  428. </if>
  429. <if test="record.goodsId != null">
  430. `goods_id` = #{record.goodsId},
  431. </if>
  432. <if test="record.goodsName != null">
  433. `goods_name` = #{record.goodsName},
  434. </if>
  435. <if test="record.goodsImage != null">
  436. `goods_image` = #{record.goodsImage},
  437. </if>
  438. <if test="record.visitorNum != null">
  439. `visitor_num` = #{record.visitorNum},
  440. </if>
  441. <if test="record.viewNum != null">
  442. `view_num` = #{record.viewNum},
  443. </if>
  444. <if test="record.orderSubmitNum != null">
  445. `order_submit_num` = #{record.orderSubmitNum},
  446. </if>
  447. <if test="record.orderSubmitAmount != null">
  448. `order_submit_amount` = #{record.orderSubmitAmount},
  449. </if>
  450. <if test="record.orderPayNum != null">
  451. `order_pay_num` = #{record.orderPayNum},
  452. </if>
  453. <if test="record.saleAmount != null">
  454. `sale_amount` = #{record.saleAmount},
  455. </if>
  456. <if test="record.saleNum != null">
  457. `sale_num` = #{record.saleNum},
  458. </if>
  459. <if test="record.collectionNum != null">
  460. `collection_num` = #{record.collectionNum},
  461. </if>
  462. <if test="record.addCartMemberNum != null">
  463. `add_cart_member_num` = #{record.addCartMemberNum},
  464. </if>
  465. <if test="record.brandId != null">
  466. `brand_id` = #{record.brandId},
  467. </if>
  468. <if test="record.brandName != null">
  469. `brand_name` = #{record.brandName},
  470. </if>
  471. <if test="record.storeId != null">
  472. `store_id` = #{record.storeId},
  473. </if>
  474. <if test="record.storeName != null">
  475. `store_name` = #{record.storeName},
  476. </if>
  477. <if test="record.goodsCategoryId1 != null">
  478. `goods_category_id1` = #{record.goodsCategoryId1},
  479. </if>
  480. <if test="record.goodsCategoryName1 != null">
  481. `goods_category_name1` = #{record.goodsCategoryName1},
  482. </if>
  483. <if test="record.goodsPrice != null">
  484. `goods_price` = #{record.goodsPrice},
  485. </if>
  486. <if test="record.returnNum != null">
  487. `return_num` = #{record.returnNum},
  488. </if>
  489. <if test="record.returnProductNum != null">
  490. `return_product_num` = #{record.returnProductNum},
  491. </if>
  492. <if test="record.returnAmount != null">
  493. `return_amount` = #{record.returnAmount},
  494. </if>
  495. <if test="record.orderSubmitMemberNum != null">
  496. `order_submit_member_num` = #{record.orderSubmitMemberNum},
  497. </if>
  498. </trim>
  499. <include refid="whereCondition" />
  500. </update>
  501. <!--按照主键更新记录中不为空的字段-->
  502. <update id="updateByPrimaryKeySelective">
  503. UPDATE `stats_goods_day`
  504. <trim prefix="SET" suffixOverrides=",">
  505. <if test="statsTime != null">
  506. `stats_time` = #{statsTime},
  507. </if>
  508. <if test="webSite != null">
  509. `web_site` = #{webSite},
  510. </if>
  511. <if test="goodsId != null">
  512. `goods_id` = #{goodsId},
  513. </if>
  514. <if test="goodsName != null">
  515. `goods_name` = #{goodsName},
  516. </if>
  517. <if test="goodsImage != null">
  518. `goods_image` = #{goodsImage},
  519. </if>
  520. <if test="visitorNum != null">
  521. `visitor_num` = #{visitorNum},
  522. </if>
  523. <if test="viewNum != null">
  524. `view_num` = #{viewNum},
  525. </if>
  526. <if test="orderSubmitNum != null">
  527. `order_submit_num` = #{orderSubmitNum},
  528. </if>
  529. <if test="orderSubmitAmount != null">
  530. `order_submit_amount` = #{orderSubmitAmount},
  531. </if>
  532. <if test="orderPayNum != null">
  533. `order_pay_num` = #{orderPayNum},
  534. </if>
  535. <if test="saleAmount != null">
  536. `sale_amount` = #{saleAmount},
  537. </if>
  538. <if test="saleNum != null">
  539. `sale_num` = #{saleNum},
  540. </if>
  541. <if test="collectionNum != null">
  542. `collection_num` = #{collectionNum},
  543. </if>
  544. <if test="addCartMemberNum != null">
  545. `add_cart_member_num` = #{addCartMemberNum},
  546. </if>
  547. <if test="brandId != null">
  548. `brand_id` = #{brandId},
  549. </if>
  550. <if test="brandName != null">
  551. `brand_name` = #{brandName},
  552. </if>
  553. <if test="storeId != null">
  554. `store_id` = #{storeId},
  555. </if>
  556. <if test="storeName != null">
  557. `store_name` = #{storeName},
  558. </if>
  559. <if test="goodsCategoryId1 != null">
  560. `goods_category_id1` = #{goodsCategoryId1},
  561. </if>
  562. <if test="goodsCategoryName1 != null">
  563. `goods_category_name1` = #{goodsCategoryName1},
  564. </if>
  565. <if test="goodsPrice != null">
  566. `goods_price` = #{goodsPrice},
  567. </if>
  568. <if test="returnNum != null">
  569. `return_num` = #{returnNum},
  570. </if>
  571. <if test="returnProductNum != null">
  572. `return_product_num` = #{returnProductNum},
  573. </if>
  574. <if test="returnAmount != null">
  575. `return_amount` = #{returnAmount},
  576. </if>
  577. <if test="orderSubmitMemberNum != null">
  578. `order_submit_member_num` = #{orderSubmitMemberNum},
  579. </if>
  580. </trim>
  581. WHERE `stats_id` = #{statsId}
  582. </update>
  583. </mapper>