選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 

519 行
20 KiB

  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.iformall.mapper.WxCouponOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponOrder">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  7. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  8. <result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
  9. <result column="b_user_id" jdbcType="BIGINT" property="bUserId" />
  10. <result column="order_id" jdbcType="BIGINT" property="orderId" />
  11. <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" />
  12. <result column="coupon_order_status" jdbcType="INTEGER" property="couponOrderStatus" />
  13. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  14. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  15. <result column="coupon_price" jdbcType="INTEGER" property="couponPrice" />
  16. </resultMap>
  17. <sql id="allColumns">
  18. `id`,`tenant_id`,`coupon_id`,`c_user_id`,`b_user_id`,`order_id`,`expired_time`,`coupon_order_status`,`create_date`,`update_date`,`coupon_price`
  19. </sql>
  20. <sql id="dynamicWhereConditions">
  21. where 1 = 1
  22. <if test=" null != id ">
  23. and `id` = #{id}
  24. </if>
  25. <if test=" null != tenantId ">
  26. and `tenant_id` = #{tenantId}
  27. </if>
  28. <if test=" null != couponId ">
  29. and `coupon_id` = #{couponId}
  30. </if>
  31. <if test=" null != cUserId ">
  32. and `c_user_id` = #{cUserId}
  33. </if>
  34. <if test=" null != bUserId ">
  35. and `b_user_id` = #{bUserId}
  36. </if>
  37. <if test=" null != orderId ">
  38. and `order_id` = #{orderId}
  39. </if>
  40. <if test=" null != expiredTime ">
  41. and `expired_time` = #{expiredTime}
  42. </if>
  43. <if test=" null != couponOrderStatus ">
  44. and `coupon_order_status` = #{couponOrderStatus}
  45. </if>
  46. <if test=" null != createDate ">
  47. and `create_date` = #{createDate}
  48. </if>
  49. <if test=" null != updateDate ">
  50. and `update_date` = #{updateDate}
  51. </if>
  52. <if test=" null != couponPrice ">
  53. and `coupon_price` = #{couponPrice}
  54. </if>
  55. <if test=" null != ids ">
  56. and id in
  57. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  58. #{idItem}
  59. </foreach>
  60. </if>
  61. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  62. </sql>
  63. <select id="findList" parameterType="com.iformall.domain.po.WxCouponOrder" resultMap="BaseResultMap">
  64. select <include refid="allColumns" /> from wx_coupon_order
  65. <include refid="dynamicWhereConditions" />
  66. </select>
  67. <select id="countList" parameterType="com.iformall.domain.po.WxCouponOrder" resultType="java.lang.Integer">
  68. select count(*) from wx_coupon_order
  69. <include refid="dynamicWhereConditions" />
  70. </select>
  71. <resultMap id="BVoResultMap" type="com.iformall.domain.vo.WxCouponOrderBVo">
  72. <id column="id" jdbcType="BIGINT" property="id" />
  73. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  74. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  75. <result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
  76. <result column="b_user_id" jdbcType="BIGINT" property="bUserId" />
  77. <result column="order_id" jdbcType="BIGINT" property="orderId" />
  78. <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" />
  79. <result column="coupon_order_status" jdbcType="INTEGER" property="couponOrderStatus" />
  80. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  81. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  82. <result column="coupon_price" jdbcType="INTEGER" property="couponPrice" />
  83. <result column="type" jdbcType="INTEGER" property="type" />
  84. <result column="title" jdbcType="VARCHAR" property="title" />
  85. <result column="sale_price" jdbcType="INTEGER" property="salePrice" />
  86. <result column="use_price" jdbcType="INTEGER" property="usePrice" />
  87. <result column="price" jdbcType="INTEGER" property="price" />
  88. <result column="name" jdbcType="VARCHAR" property="bUserName" />
  89. <result column="phone" jdbcType="VARCHAR" property="cUserPhone" />
  90. </resultMap>
  91. <sql id="allBUserVerifiedCouponOrderColumns">
  92. co.id,co.tenant_id,co.coupon_id,co.c_user_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,
  93. c.type,c.title,c.sale_price,c.use_price,c.price,
  94. bu.name,cu.phone
  95. </sql>
  96. <sql id="allBUserOrderedCouponOrderColumns">
  97. co.id,co.tenant_id,co.coupon_id,co.c_user_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,
  98. c.type,c.title,c.sale_price,c.use_price,c.price,
  99. cu.phone
  100. </sql>
  101. <sql id="allCouponOrderColumns">
  102. co.id,co.tenant_id,co.coupon_id,co.c_user_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price
  103. </sql>
  104. <select id="findListOfOrderedByDateForBUser" parameterType="map" resultMap="BVoResultMap">
  105. select <include refid="allBUserOrderedCouponOrderColumns" />
  106. from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu
  107. where o.id = co.order_id
  108. and o.merchant_id = #{merchantID}
  109. and co.coupon_id = c.id
  110. and cu.id = co.c_user_id
  111. <if test="startDate != null">
  112. AND co.create_date &gt; #{startDate,jdbcType=TIMESTAMP}
  113. </if>
  114. <if test="endDate != null">
  115. AND co.create_date &lt; #{endDate,jdbcType=TIMESTAMP}
  116. </if>
  117. order by co.create_date desc
  118. </select>
  119. <select id="findListOfVerifiedByDateForBUser" parameterType="map" resultMap="BVoResultMap">
  120. select <include refid="allBUserVerifiedCouponOrderColumns" />
  121. from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu,wx_merchant_b_user bu
  122. where o.id = co.order_id
  123. and o.merchant_id = #{merchantID}
  124. and co.coupon_id = c.id
  125. and cu.id = co.c_user_id
  126. and bu.id = co.b_user_id
  127. <if test="startDate != null">
  128. AND co.update_date &gt; #{startDate,jdbcType=TIMESTAMP}
  129. </if>
  130. <if test="endDate != null">
  131. AND co.update_date &lt; #{endDate,jdbcType=TIMESTAMP}
  132. </if>
  133. AND co.coupon_order_status = '1'
  134. order by co.update_date desc
  135. </select>
  136. <select id="findListOfAdmin" parameterType="com.iformall.domain.po.WxCouponOrder" resultMap="BVoResultMap">
  137. select <include refid="allBUserOrderedCouponOrderColumns" />
  138. from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu
  139. where o.id = co.order_id
  140. and co.coupon_id = c.id
  141. and cu.id = co.c_user_id
  142. <if test=" null != id ">
  143. and co.id = #{id}
  144. </if>
  145. <if test=" null != tenantId ">
  146. and co.tenant_id = #{tenantId}
  147. </if>
  148. <if test=" null != couponId ">
  149. and co.coupon_id = #{couponId}
  150. </if>
  151. <if test=" null != cUserId ">
  152. and co.c_user_id = #{cUserId}
  153. </if>
  154. <if test=" null != bUserId ">
  155. and co.b_user_id = #{bUserId}
  156. </if>
  157. <if test=" null != orderId ">
  158. and co.order_id = #{orderId}
  159. </if>
  160. <if test=" null != expiredTime ">
  161. and co.expired_time = #{expiredTime}
  162. </if>
  163. <if test=" null != couponOrderStatus ">
  164. and co.coupon_order_status = #{couponOrderStatus}
  165. </if>
  166. <if test=" null != createDate ">
  167. and co.create_date = #{createDate}
  168. </if>
  169. <if test=" null != updateDate ">
  170. and co.update_date = #{updateDate}
  171. </if>
  172. <if test=" null != couponPrice ">
  173. and co.coupon_price = #{couponPrice}
  174. </if>
  175. <if test=" null != ids ">
  176. and id in
  177. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  178. #{idItem}
  179. </foreach>
  180. </if>
  181. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  182. </select>
  183. <select id="findListOfOrderedByDate" parameterType="map" resultMap="BaseResultMap">
  184. select <include refid="allCouponOrderColumns" />
  185. from wx_coupon_order co,wx_order o
  186. where o.id = co.order_id
  187. and o.merchant_id = #{merchantID}
  188. <if test="startDate != null">
  189. AND co.create_date &gt; #{startDate,jdbcType=TIMESTAMP}
  190. </if>
  191. <if test="endDate != null">
  192. AND co.create_date &lt; #{endDate,jdbcType=TIMESTAMP}
  193. </if>
  194. </select>
  195. <select id="findListOfVerifiedByDate" parameterType="map" resultMap="BaseResultMap">
  196. select <include refid="allCouponOrderColumns" />
  197. from wx_coupon_order co,wx_order o
  198. where o.id = co.order_id
  199. and o.merchant_id = #{merchantID}
  200. <if test="startDate != null">
  201. AND co.update_date &gt; #{startDate,jdbcType=TIMESTAMP}
  202. </if>
  203. <if test="endDate != null">
  204. AND co.update_date &lt; #{endDate,jdbcType=TIMESTAMP}
  205. </if>
  206. AND co.coupon_order_status = '1'
  207. </select>
  208. <sql id="allCUserCouponOrderListColumns">
  209. c.id,c.expired_time,c.coupon_order_status,c.create_date,c.update_date,c.coupon_price,
  210. co.cover_img,co.title,co.sub_title,co.sale_price,co.use_price,co.price,
  211. m.name
  212. </sql>
  213. <sql id="allCUserCouponOrderDetailColumns">
  214. c.id,c.tenant_id,c.coupon_id,c.c_user_id,c.b_user_id,c.order_id,c.expired_time,c.coupon_order_status,c.create_date,c.update_date,c.coupon_price,
  215. co.merchant_id,co.type,co.cover_img,co.title,co.sub_title,co.sale_price,co.use_price,co.price,co.detail,co.remark,
  216. m.img_url,m.name,m.link_phone,m.status,
  217. s.addr,s.shop_number,s.baidu_poi,
  218. mb.building_name,mf.floor_name
  219. </sql>
  220. <resultMap id="CVoResultMap" type="com.iformall.domain.vo.WxCouponOrderCVo">
  221. <id column="id" jdbcType="BIGINT" property="id" />
  222. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  223. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  224. <result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
  225. <result column="b_user_id" jdbcType="BIGINT" property="bUserId" />
  226. <result column="order_id" jdbcType="BIGINT" property="orderId" />
  227. <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" />
  228. <result column="coupon_order_status" jdbcType="INTEGER" property="couponOrderStatus" />
  229. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  230. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  231. <result column="coupon_price" jdbcType="INTEGER" property="couponPrice" />
  232. <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
  233. <result column="type" jdbcType="INTEGER" property="type" />
  234. <result column="cover_img" jdbcType="VARCHAR" property="coverImg" />
  235. <result column="title" jdbcType="VARCHAR" property="title" />
  236. <result column="sub_title" jdbcType="VARCHAR" property="subTitle" />
  237. <result column="sale_price" jdbcType="INTEGER" property="salePrice" />
  238. <result column="use_price" jdbcType="INTEGER" property="usePrice" />
  239. <result column="detail" jdbcType="VARCHAR" property="detail" />
  240. <result column="price" jdbcType="INTEGER" property="price" />
  241. <result column="remark" jdbcType="VARCHAR" property="remark" />
  242. <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl" />
  243. <result column="name" jdbcType="VARCHAR" property="merchantName" />
  244. <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone" />
  245. <result column="status" jdbcType="VARCHAR" property="merchantStatus" />
  246. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  247. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  248. <result column="building_name" jdbcType="VARCHAR" property="buildingName" />
  249. <result column="floor_name" jdbcType="VARCHAR" property="floorName" />
  250. <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
  251. </resultMap>
  252. <select id="findListOfCUser" parameterType="com.iformall.domain.vo.WxCouponOrderCVo" resultMap="CVoResultMap">
  253. select <include refid="allCUserCouponOrderListColumns" />
  254. from wx_coupon_order c,wx_coupon co,wx_merchant m
  255. where 1=1
  256. and c.coupon_id = co.id
  257. and co.merchant_id = m.id
  258. <if test="cUserId != null">
  259. and c.c_user_id = #{cUserId}
  260. </if>
  261. <if test="tenantId != null">
  262. and c.tenant_id = #{tenantId}
  263. </if>
  264. <if test="type != null">
  265. and co.type = #{type}
  266. </if>
  267. <if test="type == null">
  268. and co.type &lt; 5
  269. </if>
  270. <if test="couponOrderStatus != null">
  271. AND c.coupon_order_status = #{couponOrderStatus}
  272. </if>
  273. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  274. </select>
  275. <select id="selectDetailOfUser" parameterType="map" resultMap="CVoResultMap">
  276. select <include refid="allCUserCouponOrderDetailColumns" />
  277. from wx_coupon_order c,wx_coupon co,wx_merchant m
  278. left join wx_merchant_shop ms on ms.merchant_id = m.id and ms.is_del = 0
  279. left join wx_shop s on ms.shop_id = s.id
  280. left join wx_mall_building mb on s.building = mb.id
  281. left join wx_mall_floor mf on s.floor = mf.id
  282. where c.coupon_id = co.id
  283. and co.merchant_id = m.id
  284. <if test="cUserId != null">
  285. and c.c_user_id = #{cUserId}
  286. </if>
  287. <if test="merchantId != null">
  288. and co.merchant_id = #{merchantId}
  289. </if>
  290. <if test="tenantId != null">
  291. and c.tenant_id = #{tenantId}
  292. </if>
  293. <if test="couponOrderId != null">
  294. and c.id = #{couponOrderId}
  295. </if>
  296. </select>
  297. <select id="findCountByDateLimit" resultType="java.lang.Integer">
  298. select COUNT(*) FROM wx_coupon_order where tenant_id = #{tenantId} and create_date &gt;= #{startTime} and create_date &lt;= #{endTime}
  299. </select>
  300. <select id="couponDataMap" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap">
  301. SELECT DATE_FORMAT(create_date,'%m/%d') as createTime
  302. ,COUNT(DISTINCT c_user_id) as couponUserCount,count(*) as couponCount
  303. ,(select Count(*) from wx_coupon_order c where coupon_order_status=1 AND DATE_FORMAT(create_date,'%m/%d')=createTime and tenant_id=#{tenantId} AND c.update_date &gt;= #{startTime} and c.update_date &lt;= #{endTime}) as verifyCount
  304. ,(select Count(DISTINCT c_user_id) from wx_coupon_order d where coupon_order_status=1 AND DATE_FORMAT(create_date,'%m/%d')=createTime and tenant_id=#{tenantId} AND d.update_date &gt;= #{startTime} and d.update_date &lt;= #{endTime}) as verifyUserCount
  305. from wx_coupon_order where tenant_id=#{tenantId} AND create_date &gt;= #{startTime} and create_date &lt;= #{endTime} GROUP BY createTime
  306. </select>
  307. <select id="couponDataList" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap">
  308. SELECT DATE_FORMAT(wx_coupon_order.create_date,'%Y-%m-%d') as createTime,wx_coupon_order.coupon_id as couponId
  309. ,COUNT(DISTINCT c_user_id) as couponUserCount,count(*) as couponCount
  310. ,(select Count(coupon_id) from wx_coupon_order c where coupon_order_status=1 AND DATE_FORMAT(create_date,'%Y-%m-%d')=createTime and tenant_id=#{tenantId} and c.coupon_id=couponId AND c.update_date &gt;= #{startTime} and c.update_date &lt;= #{endTime}) as verifyCount
  311. ,(select Count(DISTINCT c_user_id) from wx_coupon_order d where coupon_order_status=1 AND d.coupon_id=couponId AND DATE_FORMAT(create_date,'%Y-%m-%d')=createTime and tenant_id=#{tenantId} and d.coupon_id=couponId AND d.update_date &gt;= #{startTime} and d.update_date &lt;= #{endTime}) as verifyUserCount
  312. from wx_coupon_order join wx_coupon on wx_coupon_order.coupon_id=wx_coupon.id where wx_coupon_order.tenant_id=#{tenantId} AND wx_coupon_order.create_date &gt;= #{startTime} and wx_coupon_order.create_date &lt;= #{endTime}
  313. <if test="couponType != null">
  314. AND wx_coupon.type = #{couponType}
  315. </if>
  316. GROUP BY createTime,couponId
  317. order by createTime desc
  318. </select>
  319. <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="hashmap">
  320. SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as xTime
  321. ,COUNT(DISTINCT c_user_id) as userCount,count(*) as couponCount
  322. ,(select Count(*) from wx_coupon_order c where coupon_order_status=1 AND DATE_FORMAT(create_date,'%Y-%m-%d')=xTime and tenant_id=#{tenantId}
  323. <if test="startTime != null">
  324. AND c.update_date &gt;= #{startTime}
  325. </if>
  326. <if test="endTime != null">
  327. and c.update_date &lt;= #{endTime}
  328. </if>
  329. ) as verifyCount
  330. ,(select Count(DISTINCT c_user_id) from wx_coupon_order d where coupon_order_status=1 AND DATE_FORMAT(create_date,'%Y-%m-%d')=xTime and tenant_id=#{tenantId} AND d.update_date &gt;= #{startTime} and d.update_date &lt;= #{endTime}) as verifyUserCount
  331. from wx_coupon_order where tenant_id=#{tenantId}
  332. <if test="startTime != null">
  333. AND create_date &gt;= #{startTime}
  334. </if>
  335. <if test="endTime != null">
  336. and create_date &lt;= #{endTime}
  337. </if>
  338. GROUP BY xTime
  339. </select>
  340. <select id="queryPriceTotalGroup" resultType="com.iformall.domain.vo.CUserDateAmountVo" >
  341. SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as xTime,SUM(coupon_price) as price from wx_coupon_order
  342. where tenant_id=#{tenantId} AND create_date &gt;= #{startTime} and create_date &lt; #{endTime} GROUP BY xTime
  343. </select>
  344. <select id="queryPriceTotal" resultType="java.lang.Integer" >
  345. SELECT SUM(coupon_price) from wx_coupon_order
  346. where tenant_id=#{tenantId} AND create_date &gt;= #{startTime} and create_date &lt; #{endTime}
  347. </select>
  348. <update id="offExpiredCouponOrderByValidDate">
  349. update wx_coupon_order SET coupon_order_status = 2, update_date = now()
  350. where expired_time &lt; now() and coupon_price = 0 and coupon_order_status = 0
  351. </update>
  352. <select id="findExpiredCouponOrderByValidDate" parameterType="com.iformall.domain.po.WxCouponOrder" resultMap="BaseResultMap">
  353. select <include refid="allColumns" /> from wx_coupon_order
  354. where expired_time &lt; now() and coupon_price &gt; 0 and coupon_order_status = 0
  355. </select>
  356. <sql id="allCUserCouponOrderCarListColumns">
  357. c.id,c.expired_time,c.coupon_order_status,c.create_date,c.update_date,c.coupon_price,
  358. co.cover_img,co.title,co.sub_title,co.sale_price,co.use_price,co.price,m.id as merchant_id,
  359. m.name,json_extract(car.vendor_params,'$.id') as coupon_free_id
  360. </sql>
  361. <resultMap id="CCarVoResultMap" type="com.iformall.domain.vo.WxCouponOrderCarCVo">
  362. <id column="id" jdbcType="BIGINT" property="id" />
  363. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  364. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  365. <result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
  366. <result column="b_user_id" jdbcType="BIGINT" property="bUserId" />
  367. <result column="order_id" jdbcType="BIGINT" property="orderId" />
  368. <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" />
  369. <result column="coupon_order_status" jdbcType="INTEGER" property="couponOrderStatus" />
  370. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  371. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  372. <result column="coupon_price" jdbcType="INTEGER" property="couponPrice" />
  373. <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
  374. <result column="type" jdbcType="INTEGER" property="type" />
  375. <result column="cover_img" jdbcType="VARCHAR" property="coverImg" />
  376. <result column="title" jdbcType="VARCHAR" property="title" />
  377. <result column="sub_title" jdbcType="VARCHAR" property="subTitle" />
  378. <result column="sale_price" jdbcType="INTEGER" property="salePrice" />
  379. <result column="use_price" jdbcType="INTEGER" property="usePrice" />
  380. <result column="detail" jdbcType="VARCHAR" property="detail" />
  381. <result column="price" jdbcType="INTEGER" property="price" />
  382. <result column="remark" jdbcType="VARCHAR" property="remark" />
  383. <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl" />
  384. <result column="name" jdbcType="VARCHAR" property="merchantName" />
  385. <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone" />
  386. <result column="status" jdbcType="VARCHAR" property="merchantStatus" />
  387. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  388. <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
  389. <result column="building_name" jdbcType="VARCHAR" property="buildingName" />
  390. <result column="floor_name" jdbcType="VARCHAR" property="floorName" />
  391. <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
  392. <result column="coupon_free_id" jdbcType="INTEGER" property="couponFreeId"/>
  393. </resultMap>
  394. <select id="findCarListOfCUser" parameterType="com.iformall.domain.vo.WxCouponOrderCarCVo" resultMap="CCarVoResultMap">
  395. select <include refid="allCUserCouponOrderCarListColumns" />
  396. from wx_coupon_order c,wx_coupon co,wx_merchant m, wx_coupon_car car
  397. where 1=1
  398. and c.coupon_id = co.id
  399. and c.coupon_id = car.id
  400. and co.merchant_id = m.id
  401. <if test="cUserId != null">
  402. and c.c_user_id = #{cUserId}
  403. </if>
  404. <if test="tenantId != null">
  405. and c.tenant_id = #{tenantId}
  406. </if>
  407. <if test="type != null">
  408. and co.type = #{type}
  409. </if>
  410. <if test="couponOrderStatus != null">
  411. AND c.coupon_order_status = #{couponOrderStatus}
  412. </if>
  413. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  414. </select>
  415. </mapper>