GoodsWeekReadMapper.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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.read.statistics.GoodsWeekReadMapper">
  4. <resultMap id="resultMap" type="com.slodon.b2b2c.statistics.pojo.GoodsWeek">
  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="pkWhere">
  34. WHERE `stats_id` = #{primaryKey}
  35. </sql>
  36. <!--操作条件-->
  37. <sql id="whereCondition">
  38. <if test="example != null">
  39. <trim prefix="WHERE" prefixOverrides="AND|OR">
  40. <if test="example.statsIdNotEquals != null">
  41. AND `stats_id` != #{example.statsIdNotEquals}
  42. </if>
  43. <if test="example.statsIdIn != null">
  44. AND `stats_id` in (${example.statsIdIn})
  45. </if>
  46. <if test="example.statsTimeAfter != null">
  47. AND `stats_time` <![CDATA[ >= ]]> #{example.statsTimeAfter}
  48. </if>
  49. <if test="example.statsTimeBefore != null">
  50. AND `stats_time` <![CDATA[ <= ]]> #{example.statsTimeBefore}
  51. </if>
  52. <if test="example.webSite != null">
  53. AND `web_site` = #{example.webSite}
  54. </if>
  55. <if test="example.goodsId != null">
  56. AND `goods_id` = #{example.goodsId}
  57. </if>
  58. <if test="example.goodsIdIn != null">
  59. AND `goods_id` in (${example.goodsIdIn})
  60. </if>
  61. <if test="example.goodsName != null">
  62. AND `goods_name` = #{example.goodsName}
  63. </if>
  64. <if test="example.goodsNameLike != null">
  65. AND `goods_name` like concat('%',#{example.goodsNameLike},'%')
  66. </if>
  67. <if test="example.goodsImage != null">
  68. AND `goods_image` = #{example.goodsImage}
  69. </if>
  70. <if test="example.visitorNum != null">
  71. AND `visitor_num` = #{example.visitorNum}
  72. </if>
  73. <if test="example.viewNum != null">
  74. AND `view_num` = #{example.viewNum}
  75. </if>
  76. <if test="example.orderSubmitNum != null">
  77. AND `order_submit_num` = #{example.orderSubmitNum}
  78. </if>
  79. <if test="example.orderSubmitAmount != null">
  80. AND `order_submit_amount` = #{example.orderSubmitAmount}
  81. </if>
  82. <if test="example.orderPayNum != null">
  83. AND `order_pay_num` = #{example.orderPayNum}
  84. </if>
  85. <if test="example.saleAmount != null">
  86. AND `sale_amount` = #{example.saleAmount}
  87. </if>
  88. <if test="example.saleNum != null">
  89. AND `sale_num` = #{example.saleNum}
  90. </if>
  91. <if test="example.collectionNum != null">
  92. AND `collection_num` = #{example.collectionNum}
  93. </if>
  94. <if test="example.addCartMemberNum != null">
  95. AND `add_cart_member_num` = #{example.addCartMemberNum}
  96. </if>
  97. <if test="example.brandId != null">
  98. AND `brand_id` = #{example.brandId}
  99. </if>
  100. <if test="example.brandName != null">
  101. AND `brand_name` = #{example.brandName}
  102. </if>
  103. <if test="example.brandNameLike != null">
  104. AND `brand_name` like concat('%',#{example.brandNameLike},'%')
  105. </if>
  106. <if test="example.storeId != null">
  107. AND `store_id` = #{example.storeId}
  108. </if>
  109. <if test="example.storeName != null">
  110. AND `store_name` = #{example.storeName}
  111. </if>
  112. <if test="example.storeNameLike != null">
  113. AND `store_name` like concat('%',#{example.storeNameLike},'%')
  114. </if>
  115. <if test="example.goodsCategoryId1 != null">
  116. AND `goods_category_id1` = #{example.goodsCategoryId1}
  117. </if>
  118. <if test="example.goodsCategoryName1 != null">
  119. AND `goods_category_name1` = #{example.goodsCategoryName1}
  120. </if>
  121. <if test="example.goodsCategoryName1Like != null">
  122. AND `goods_category_name1` like concat('%',#{example.goodsCategoryName1Like},'%')
  123. </if>
  124. <if test="example.goodsPrice != null">
  125. AND `goods_price` = #{example.goodsPrice}
  126. </if>
  127. <if test="example.returnNum != null">
  128. AND `return_num` = #{example.returnNum}
  129. </if>
  130. <if test="example.returnProductNum != null">
  131. AND `return_product_num` = #{example.returnProductNum}
  132. </if>
  133. <if test="example.returnAmount != null">
  134. AND `return_amount` = #{example.returnAmount}
  135. </if>
  136. <if test="example.orderSubmitMemberNum != null">
  137. AND `order_submit_member_num` = #{example.orderSubmitMemberNum}
  138. </if>
  139. </trim>
  140. </if>
  141. </sql>
  142. <!--排序条件-->
  143. <sql id="orderBy">
  144. ORDER BY `stats_id` DESC
  145. </sql>
  146. <sql id="orderByOther">
  147. order by ${example.orderBy}
  148. </sql>
  149. <!--分组条件-->
  150. <sql id="groupBy">
  151. group by ${example.groupBy}
  152. </sql>
  153. <!--分页条件-->
  154. <sql id="limit">
  155. <if test="size != null and size &gt; 0">
  156. limit #{startRow},#{size}
  157. </if>
  158. </sql>
  159. <!--查询符合条件的记录数-->
  160. <select id="countByExample" parameterType="com.slodon.b2b2c.statistics.example.GoodsWeekExample" resultType="java.lang.Integer">
  161. SELECT
  162. COUNT(*)
  163. FROM `stats_goods_week`
  164. <include refid="whereCondition" />
  165. </select>
  166. <!--根据主键查询记录-->
  167. <select id="getByPrimaryKey" resultMap="resultMap">
  168. SELECT
  169. *
  170. FROM `stats_goods_week`
  171. <include refid="pkWhere" />
  172. </select>
  173. <!--查询符合条件的记录(所有字段)-->
  174. <select id="listByExample" resultMap="resultMap">
  175. SELECT
  176. *
  177. FROM `stats_goods_week`
  178. <include refid="whereCondition" />
  179. <if test="example.groupBy != null">
  180. <include refid="groupBy" />
  181. </if>
  182. <choose>
  183. <when test="example.orderBy != null">
  184. <include refid="orderByOther" />
  185. </when>
  186. <otherwise>
  187. <include refid="orderBy" />
  188. </otherwise>
  189. </choose>
  190. </select>
  191. <!--分页查询符合条件的记录(所有字段)-->
  192. <select id="listPageByExample" resultMap="resultMap">
  193. SELECT
  194. *
  195. FROM `stats_goods_week`
  196. <include refid="whereCondition" />
  197. <if test="example.groupBy != null">
  198. <include refid="groupBy" />
  199. </if>
  200. <choose>
  201. <when test="example.orderBy != null">
  202. <include refid="orderByOther" />
  203. </when>
  204. <otherwise>
  205. <include refid="orderBy" />
  206. </otherwise>
  207. </choose>
  208. <include refid="limit" />
  209. </select>
  210. <!--查询符合条件的记录(指定字段)-->
  211. <select id="listFieldsByExample" resultMap="resultMap">
  212. SELECT
  213. ${fields}
  214. FROM `stats_goods_week`
  215. <include refid="whereCondition" />
  216. <if test="example.groupBy != null">
  217. <include refid="groupBy" />
  218. </if>
  219. <choose>
  220. <when test="example.orderBy != null">
  221. <include refid="orderByOther" />
  222. </when>
  223. <otherwise>
  224. <include refid="orderBy" />
  225. </otherwise>
  226. </choose>
  227. </select>
  228. <!--分页查询符合条件的记录(指定字段)-->
  229. <select id="listFieldsPageByExample" resultMap="resultMap">
  230. SELECT
  231. ${fields}
  232. FROM `stats_goods_week`
  233. <include refid="whereCondition" />
  234. <if test="example.groupBy != null">
  235. <include refid="groupBy" />
  236. </if>
  237. <choose>
  238. <when test="example.orderBy != null">
  239. <include refid="orderByOther" />
  240. </when>
  241. <otherwise>
  242. <include refid="orderBy" />
  243. </otherwise>
  244. </choose>
  245. <include refid="limit" />
  246. </select>
  247. </mapper>