|
|
@@ -92,35 +92,109 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="BVoResultMap" type="com.simple.domain.vo.WxCouponOrderBVo"> |
|
|
|
|
|
|
|
|
|
|
|
<id column="id" jdbcType="BIGINT" property="id" /> |
|
|
|
|
|
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" /> |
|
|
|
|
|
<result column="coupon_id" jdbcType="BIGINT" property="couponId" /> |
|
|
|
|
|
<result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> |
|
|
|
|
|
<result column="b_user_id" jdbcType="BIGINT" property="bUserId" /> |
|
|
|
|
|
<result column="order_id" jdbcType="BIGINT" property="orderId" /> |
|
|
|
|
|
<result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" /> |
|
|
|
|
|
<result column="coupon_order_status" jdbcType="INTEGER" property="couponOrderStatus" /> |
|
|
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> |
|
|
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> |
|
|
|
|
|
<result column="coupon_price" jdbcType="INTEGER" property="couponPrice" /> |
|
|
|
|
|
|
|
|
|
|
|
<result column="type" jdbcType="INTEGER" property="type" /> |
|
|
|
|
|
<result column="title" jdbcType="VARCHAR" property="title" /> |
|
|
|
|
|
<result column="sale_price" jdbcType="INTEGER" property="salePrice" /> |
|
|
|
|
|
<result column="use_price" jdbcType="INTEGER" property="usePrice" /> |
|
|
|
|
|
<result column="price" jdbcType="INTEGER" property="price" /> |
|
|
|
|
|
|
|
|
|
|
|
<result column="name" jdbcType="VARCHAR" property="bUserName" /> |
|
|
|
|
|
<result column="phone" jdbcType="VARCHAR" property="cUserPhone" /> |
|
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="allBUserVerifiedCouponOrderColumns"> |
|
|
|
|
|
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, |
|
|
|
|
|
c.type,c.title,c.sale_price,c.use_price,c.price, |
|
|
|
|
|
bu.name,cu.phone |
|
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="allBUserUnverifiedCouponOrderColumns"> |
|
|
|
|
|
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, |
|
|
|
|
|
c.type,c.title,c.sale_price,c.use_price,c.price, |
|
|
|
|
|
cu.phone |
|
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
<sql id="allCouponOrderColumns"> |
|
|
<sql id="allCouponOrderColumns"> |
|
|
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 |
|
|
|
|
|
|
|
|
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> |
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
<select id="findListOfUnverifiedByDateForBUser" parameterType="map" resultMap="BVoResultMap"> |
|
|
|
|
|
select <include refid="allBUserUnverifiedCouponOrderColumns" /> |
|
|
|
|
|
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="startDate != null"> |
|
|
|
|
|
AND co.create_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
|
|
|
</if> |
|
|
|
|
|
AND co.coupon_order_status = '0' |
|
|
|
|
|
|
|
|
|
|
|
</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="startDate != null"> |
|
|
|
|
|
AND co.update_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
|
|
|
</if> |
|
|
|
|
|
AND co.coupon_order_status = '1' |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="findListOfUnverifiedByDate" parameterType="map" resultMap="BaseResultMap"> |
|
|
<select id="findListOfUnverifiedByDate" parameterType="map" resultMap="BaseResultMap"> |
|
|
select <include refid="allCouponOrderColumns" /> from wx_coupon_order c,wx_order o |
|
|
|
|
|
where o.id = c.order_id and o.merchant_id = #{merchantID} |
|
|
|
|
|
|
|
|
select <include refid="allCouponOrderColumns" /> |
|
|
|
|
|
from wx_coupon_order co,wx_order o |
|
|
|
|
|
where o.id = co.order_id |
|
|
|
|
|
and o.merchant_id = #{merchantID} |
|
|
<if test="startDate != null"> |
|
|
<if test="startDate != null"> |
|
|
AND c.create_date > #{startDate,jdbcType=TIMESTAMP} |
|
|
|
|
|
|
|
|
AND co.create_date > #{startDate,jdbcType=TIMESTAMP} |
|
|
</if> |
|
|
</if> |
|
|
<if test="startDate != null"> |
|
|
<if test="startDate != null"> |
|
|
AND c.create_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
|
|
|
|
|
|
AND co.create_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
</if> |
|
|
</if> |
|
|
AND c.coupon_order_status = '0' |
|
|
|
|
|
|
|
|
AND co.coupon_order_status = '0' |
|
|
|
|
|
|
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="findListOfVerifiedByDate" parameterType="map" resultMap="BaseResultMap"> |
|
|
<select id="findListOfVerifiedByDate" parameterType="map" resultMap="BaseResultMap"> |
|
|
select <include refid="allCouponOrderColumns" /> from wx_coupon_order c,wx_order o |
|
|
|
|
|
where o.id = c.order_id and o.merchant_id = #{merchantID} |
|
|
|
|
|
|
|
|
select <include refid="allCouponOrderColumns" /> |
|
|
|
|
|
from wx_coupon_order co,wx_order o |
|
|
|
|
|
where o.id = co.order_id |
|
|
|
|
|
and o.merchant_id = #{merchantID} |
|
|
<if test="startDate != null"> |
|
|
<if test="startDate != null"> |
|
|
AND c.update_date > #{startDate,jdbcType=TIMESTAMP} |
|
|
|
|
|
|
|
|
AND co.update_date > #{startDate,jdbcType=TIMESTAMP} |
|
|
</if> |
|
|
</if> |
|
|
<if test="startDate != null"> |
|
|
<if test="startDate != null"> |
|
|
AND c.update_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
|
|
|
|
|
|
AND co.update_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
</if> |
|
|
</if> |
|
|
AND c.coupon_order_status = '1' |
|
|
|
|
|
|
|
|
AND co.coupon_order_status = '1' |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|