CommonMapper.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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.gree.mall.contest.commonmapper.CommonMapper">
  4. <select id="amityList" resultType="com.gree.mall.contest.bean.common.AmityUrlVO">
  5. select
  6. a.*
  7. from amity_url a
  8. ${ex.query}
  9. AND a.del = 0
  10. <if test="ex.orderBy == null or ex.orderBy ==''">
  11. order by a.create_time desc
  12. </if>
  13. ${ex.orderBy}
  14. </select>
  15. <select id="carouselMapList" resultType="com.gree.mall.contest.bean.common.CarouselMapVO">
  16. SELECT
  17. ${ex.selected}
  18. FROM carousel_map a
  19. ${ex.query}
  20. <if test="ex.orderBy == null or ex.orderBy ==''">
  21. ORDER BY a.create_time DESC
  22. </if>
  23. ${ex.orderBy}
  24. </select>
  25. <select id="notifyList" resultType="com.gree.mall.contest.bean.manage.NotifyVO">
  26. SELECT
  27. ${ex.selected}
  28. FROM notify a
  29. ${ex.query}
  30. <if test="ex.orderBy == null or ex.orderBy ==''">
  31. ORDER BY a.create_time DESC
  32. </if>
  33. ${ex.orderBy}
  34. </select>
  35. <select id="notifyReadList" resultType="com.gree.mall.contest.bean.manage.NotifyRecordVO">
  36. SELECT
  37. ${ex.selected}
  38. FROM notify_record a
  39. ${ex.query}
  40. <if test="ex.orderBy == null or ex.orderBy ==''">
  41. ORDER BY a.create_time DESC
  42. </if>
  43. ${ex.orderBy}
  44. </select>
  45. <select id="topPopList" resultType="com.gree.mall.contest.bean.manage.UserTopPopVO">
  46. SELECT
  47. ${ex.selected}
  48. FROM user_top_pop a
  49. ${ex.query}
  50. <if test="ex.orderBy == null or ex.orderBy ==''">
  51. ORDER BY a.create_time DESC
  52. </if>
  53. ${ex.orderBy}
  54. </select>
  55. <select id="queryTopPopVaildRecord" resultType="com.gree.mall.contest.plus.entity.UserTopPop">
  56. SELECT
  57. *
  58. FROM
  59. user_top_pop
  60. WHERE
  61. status = 'OK'
  62. AND #{curDate} BETWEEN start_date AND end_date
  63. <if test="popIds != null and popIds.size > 0">
  64. AND id IN
  65. <foreach item="item" index="index" collection="popIds" open="(" separator="," close=")">
  66. #{item}
  67. </foreach>
  68. </if>
  69. ORDER BY send_time DESC
  70. </select>
  71. <select id="pageApply" resultType="com.gree.mall.contest.bean.merchant.WebsitApplyVO">
  72. SELECT
  73. ${ex.selected}
  74. FROM websit_apply a
  75. ${ex.query}
  76. <if test="ex.orderBy == null or ex.orderBy ==''">
  77. ORDER BY a.create_time DESC
  78. </if>
  79. ${ex.orderBy}
  80. </select>
  81. <select id="MerchantPage" resultType="com.gree.mall.contest.bean.merchant.MerchantVO">
  82. SELECT
  83. ${ex.selected}
  84. FROM merchant a
  85. ${ex.query}
  86. <if test="serviceProviderId != null and serviceProviderId !=''">
  87. AND a.id = #{serviceProviderId}
  88. </if>
  89. <if test="ex.orderBy == null or ex.orderBy ==''">
  90. ORDER BY a.create_time DESC
  91. </if>
  92. ${ex.orderBy}
  93. </select>
  94. <select id="listMerchantRegion" resultType="com.gree.mall.contest.bean.merchant.MerchantRegionVO">
  95. select
  96. ${ex.selected}
  97. from merchant a
  98. join admin_websit_region b on a.id=b.admin_websit_id
  99. ${ex.query}
  100. <if test="serviceProviderId != null and serviceProviderId !=''">
  101. and a.id = #{serviceProviderId}
  102. </if>
  103. group by b.id
  104. order by a.create_time desc
  105. </select>
  106. <select id="platformStorePage" resultType="com.gree.mall.contest.bean.store.PlatformStoreVO">
  107. SELECT
  108. ${ex.selected}
  109. FROM platform_store a
  110. ${ex.query}
  111. <if test="ex.orderBy == null or ex.orderBy ==''">
  112. ORDER BY a.create_time DESC
  113. </if>
  114. ${ex.orderBy}
  115. </select>
  116. <select id="queryGoodsCategoryByOrderId" resultType="com.gree.mall.contest.plus.entity.GoodsCategory">
  117. select c.* from order_detail a
  118. join goods b on a.goods_id = b.goods_id
  119. join goods_category c on c.category_id = b.category_id
  120. where a.order_id=#{orderId}
  121. </select>
  122. <select id="queryOrderTaxExcelMsg" resultType="com.gree.mall.contest.bean.tax.OrderTaxExcelBean">
  123. SELECT
  124. ot.* ,
  125. GROUP_CONCAT(gc.name) as categoryNames,
  126. a.pay_time
  127. from order_tax ot
  128. left join order_info a on a.order_id = ot.order_id
  129. LEFT JOIN order_detail od on od.order_id=ot.order_id
  130. LEFT JOIN goods g on g.goods_id=od.goods_id
  131. LEFT JOIN goods_category gc on gc.category_id=g.category_id
  132. <where>
  133. gc.category_id is not null
  134. <if test="status != null">
  135. and ot.status = #{status}
  136. </if>
  137. <if test="orderId != null">
  138. and ot.order_id like concat('%',#{orderId},'%')
  139. </if>
  140. <if test="companyWechatIds != null and companyWechatIds.size > 0">
  141. and ot.company_wechat_id in
  142. <foreach item="item" index="index" collection="companyWechatIds" open="(" separator="," close=")">
  143. #{item}
  144. </foreach>
  145. </if>
  146. <if test="adminWebsitIds != null and adminWebsitIds.size > 0">
  147. and ot.websit_id in
  148. <foreach item="item" index="index" collection="adminWebsitIds" open="(" separator="," close=")">
  149. #{item}
  150. </foreach>
  151. </if>
  152. </where>
  153. GROUP BY ot.order_tax_id
  154. ORDER BY ot.create_time DESC
  155. </select>
  156. </mapper>