|
|
|
@@ -150,49 +150,14 @@ |
|
|
|
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 |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findListOfOrderedByDateForBUser" parameterType="map" resultMap="BVoResultMap"> |
|
|
|
select <include refid="allBUserOrderedCouponOrderColumns" /> |
|
|
|
from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu |
|
|
|
where o.id = co.order_id |
|
|
|
and o.merchant_id = #{merchantId} |
|
|
|
and co.coupon_id = c.id |
|
|
|
and cu.id = co.c_user_id |
|
|
|
<if test="startDate != null"> |
|
|
|
AND co.create_date > #{startDate,jdbcType=TIMESTAMP} |
|
|
|
</if> |
|
|
|
<if test="endDate != null"> |
|
|
|
AND co.create_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
|
</if> |
|
|
|
order by co.create_date desc |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findListOfVerifiedByDateForBUser" parameterType="map" resultMap="BVoResultMap"> |
|
|
|
select <include refid="allBUserVerifiedCouponOrderColumns" /> |
|
|
|
from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu,wx_merchant_b_user bu |
|
|
|
where o.id = co.order_id |
|
|
|
and o.merchant_id = #{merchantId} |
|
|
|
and co.coupon_id = c.id |
|
|
|
and cu.id = co.c_user_id |
|
|
|
and bu.id = co.b_user_id |
|
|
|
<if test="startDate != null"> |
|
|
|
AND co.update_date > #{startDate,jdbcType=TIMESTAMP} |
|
|
|
</if> |
|
|
|
<if test="endDate != null"> |
|
|
|
AND co.update_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
|
</if> |
|
|
|
AND co.coupon_order_status = '1' |
|
|
|
order by co.update_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap"> |
|
|
|
select <include refid="allAdminCouponOrderColumns" /> |
|
|
|
from wx_coupon_order co |
|
|
|
inner JOIN wx_order o on o.id = co.order_id |
|
|
|
inner JOIN wx_coupon c on co.coupon_id = c.id |
|
|
|
inner JOIN wx_c_user cu on cu.id = co.c_user_id |
|
|
|
left JOIN wx_merchant m on o.merchant_id = m.id |
|
|
|
left join wx_merchant_b_user bu on co.b_user_id = bu.id |
|
|
|
left JOIN wx_merchant_b_user bu on co.b_user_id = bu.id |
|
|
|
left JOIN wx_merchant m on bu.merchant_id = m.id |
|
|
|
where 1 = 1 |
|
|
|
<if test=" null != id "> |
|
|
|
and co.id = #{id} |
|
|
|
@@ -222,6 +187,41 @@ |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findListOfOrderedByDateForBUser" parameterType="map" resultMap="BVoResultMap"> |
|
|
|
select <include refid="allBUserOrderedCouponOrderColumns" /> |
|
|
|
from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu |
|
|
|
where o.id = co.order_id |
|
|
|
and o.merchant_id = #{merchantId} |
|
|
|
and co.coupon_id = c.id |
|
|
|
and cu.id = co.c_user_id |
|
|
|
<if test="startDate != null"> |
|
|
|
AND co.create_date > #{startDate,jdbcType=TIMESTAMP} |
|
|
|
</if> |
|
|
|
<if test="endDate != null"> |
|
|
|
AND co.create_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
|
</if> |
|
|
|
order by co.create_date desc |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findListOfVerifiedByDateForBUser" parameterType="map" resultMap="BVoResultMap"> |
|
|
|
select <include refid="allBUserVerifiedCouponOrderColumns" /> |
|
|
|
from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu,wx_merchant_b_user bu |
|
|
|
where o.id = co.order_id |
|
|
|
and o.merchant_id = #{merchantId} |
|
|
|
and co.coupon_id = c.id |
|
|
|
and cu.id = co.c_user_id |
|
|
|
and bu.id = co.b_user_id |
|
|
|
<if test="startDate != null"> |
|
|
|
AND co.update_date > #{startDate,jdbcType=TIMESTAMP} |
|
|
|
</if> |
|
|
|
<if test="endDate != null"> |
|
|
|
AND co.update_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
|
</if> |
|
|
|
AND co.coupon_order_status = '1' |
|
|
|
order by co.update_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findListOfOrderedByDate" parameterType="map" resultMap="BaseResultMap"> |
|
|
|
select <include refid="allCouponOrderColumns" /> |
|
|
|
from wx_coupon_order co,wx_order o |
|
|
|
|