|
|
|
@@ -177,17 +177,10 @@ |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="countCouponConditionType1" parameterType="com.iformall.domain.po.WxOrder" resultType="java.lang.Integer"> |
|
|
|
select count(*) from wx_order o,wx_coupon c |
|
|
|
where o.product_id = c.id |
|
|
|
and c.conditions is not null |
|
|
|
/*and JSON_EXTRACT(c.conditions, '$.type') = 1*/ |
|
|
|
select count(1) from wx_order o where o.`tenant_id` = #{tenantId} |
|
|
|
<if test=" null != cUserId "> |
|
|
|
and o.c_user_id = #{cUserId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and o.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and o.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
@@ -205,6 +198,13 @@ |
|
|
|
#{sItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != couponIds "> |
|
|
|
and o.product_id in |
|
|
|
<foreach collection="couponIds" index="index" item="couponIdItem" open="(" separator="," close=")"> |
|
|
|
#{couponIdItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
@@ -285,14 +285,6 @@ |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="allCUserOrderDetailColumns"> |
|
|
|
o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, |
|
|
|
c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date,c.gift_list, |
|
|
|
co.id as coupon_order_id,co.coupon_order_status,c.support_transfer,c.subsidy_num,o.compose_order_type,o.compose_order_id,o.parent_order_id, |
|
|
|
o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address`,co.`shipping_status`,co.`delivery_info` |
|
|
|
</sql> |
|
|
|
|
|
|
|
<update id="updateStatusByPressCouponId" parameterType="com.iformall.domain.po.WxOrder"> |
|
|
|
update wx_order set order_status=#{orderStatus} |
|
|
|
where product_id=#{productId} |
|
|
|
@@ -327,6 +319,61 @@ |
|
|
|
</if> |
|
|
|
</update> |
|
|
|
|
|
|
|
<select id="findListOfCUser" parameterType="com.iformall.domain.po.WxOrder" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, |
|
|
|
o.compose_order_type,o.compose_order_id,o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address`,o.parent_order_id |
|
|
|
|
|
|
|
from wx_order o |
|
|
|
where o.order_status in (0,1,2,3,4,5) |
|
|
|
<if test="cUserId != null"> |
|
|
|
and o.c_user_id = #{cUserId} |
|
|
|
</if> |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and o.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and o.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != composeOrderId "> |
|
|
|
and o.`compose_order_id` = #{composeOrderId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentOrderId "> |
|
|
|
and o.`parent_order_id` = #{parentOrderId} |
|
|
|
</if> |
|
|
|
<if test="orderStatus != null"> |
|
|
|
AND o.order_status = #{orderStatus} |
|
|
|
</if> |
|
|
|
<if test=" null != payVendor "> |
|
|
|
and o.pay_vendor = #{payVendor} |
|
|
|
</if> |
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectDetailOfCUser" parameterType="com.iformall.domain.po.WxOrder" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, |
|
|
|
o.compose_order_type,o.compose_order_id,o.parent_order_id,o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address` |
|
|
|
FROM wx_order o where o.`tenant_id` = #{tenantId} |
|
|
|
<if test="cUserId != null"> |
|
|
|
and o.c_user_id = #{cUserId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and o.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != composeOrderId "> |
|
|
|
and o.`compose_order_id` = #{composeOrderId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != parentOrderId "> |
|
|
|
and o.`parent_order_id` = #{parentOrderId} |
|
|
|
</if> |
|
|
|
<if test="id != null"> |
|
|
|
and o.id = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
<resultMap id="CVoListMap" type="com.iformall.domain.vo.WxOrderCouponVo"> |
|
|
|
|
|
|
|
@@ -385,106 +432,6 @@ |
|
|
|
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<resultMap id="CVoResultMap" type="com.iformall.domain.vo.WxOrderCouponVo"> |
|
|
|
|
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> |
|
|
|
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> |
|
|
|
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> |
|
|
|
<result column="coupon_channel_id" jdbcType="BIGINT" property="couponChannelId"/> |
|
|
|
<result column="product_id" jdbcType="BIGINT" property="productId"/> |
|
|
|
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/> |
|
|
|
<result column="payment" jdbcType="INTEGER" property="payment"/> |
|
|
|
<result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime"/> |
|
|
|
<result column="freight_price" jdbcType="INTEGER" property="freightPrice"/> |
|
|
|
<result column="order_status" jdbcType="INTEGER" property="orderStatus"/> |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> |
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> |
|
|
|
|
|
|
|
<result column="type" jdbcType="INTEGER" property="type"/> |
|
|
|
<result column="pay_vendor" jdbcType="INTEGER" property="payVendor"/> |
|
|
|
<result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> |
|
|
|
<result column="title" jdbcType="VARCHAR" property="title"/> |
|
|
|
<result column="sub_title" jdbcType="VARCHAR" property="subTitle"/> |
|
|
|
<result column="sale_price" jdbcType="INTEGER" property="salePrice"/> |
|
|
|
<result column="use_price" jdbcType="INTEGER" property="usePrice"/> |
|
|
|
<result column="detail" jdbcType="VARCHAR" property="detail"/> |
|
|
|
<result column="price" jdbcType="INTEGER" property="price"/> |
|
|
|
<result column="tail_price" jdbcType="INTEGER" property="tailPrice"/> |
|
|
|
<result column="orig_price" jdbcType="INTEGER" property="origPrice"/> |
|
|
|
<result column="unit" jdbcType="INTEGER" property="unit"/> |
|
|
|
<result column="remark" jdbcType="VARCHAR" property="remark"/> |
|
|
|
<result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/> |
|
|
|
<result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/> |
|
|
|
<result column="gift_list" jdbcType="VARCHAR" property="giftList"></result> |
|
|
|
<result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"></result> |
|
|
|
|
|
|
|
<result column="pick_start_date" jdbcType="TIMESTAMP" property="pickStartDate"/> |
|
|
|
<result column="pick_end_date" jdbcType="TIMESTAMP" property="pickEndDate"/> |
|
|
|
|
|
|
|
<result column="coupon_order_id" jdbcType="BIGINT" property="couponOrderId"/> |
|
|
|
<result column="coupon_order_status" jdbcType="INTEGER" property="couponOrderStatus"/> |
|
|
|
<result column="send_channel_type" jdbcType="INTEGER" property="sendChannelType" /> |
|
|
|
<result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/> |
|
|
|
|
|
|
|
<result column="compose_order_type" jdbcType="INTEGER" property="composeOrderType" /> |
|
|
|
<result column="compose_order_id" jdbcType="BIGINT" property="composeOrderId" /> |
|
|
|
<result column="coupon_number" jdbcType="INTEGER" property="couponNumber"/> |
|
|
|
<result column="parent_order_id" jdbcType="BIGINT" property="parentOrderId" /> |
|
|
|
|
|
|
|
<result column="shipping_type" jdbcType="INTEGER" property="shippingType"/> |
|
|
|
<result column="shipping_address" jdbcType="VARCHAR" property="shippingAddress"/> |
|
|
|
<result column="shipping_status" jdbcType="INTEGER" property="shippingStatus"/> |
|
|
|
<result column="delivery_info" jdbcType="VARCHAR" property="deliveryInfo"/> |
|
|
|
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <sql id="allCUserOrderListColumns"> |
|
|
|
o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.`freight_price`,o.order_status,o.create_date,o.update_date, |
|
|
|
c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.valid_start_date,c.valid_end_date, |
|
|
|
cal.channel_type as send_channel_type |
|
|
|
</sql> --> |
|
|
|
|
|
|
|
<sql id="allCUserOrderListColumns"> |
|
|
|
o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, |
|
|
|
c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date, |
|
|
|
o.compose_order_type,o.compose_order_id, |
|
|
|
o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address`,o.parent_order_id |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findListOfCUser" parameterType="com.iformall.domain.po.WxOrder" resultMap="CVoResultMap"> |
|
|
|
select |
|
|
|
<include refid="allCUserOrderListColumns"/> |
|
|
|
from wx_coupon c,wx_order o |
|
|
|
left join wx_coupon_order co on co.order_id = o.id |
|
|
|
<!-- left join wx_coupon_action_log cal on cal.coupon_order_id = co.id --> |
|
|
|
where o.product_id = c.id and o.order_status in (0,1,2,3,4,5) |
|
|
|
<if test="cUserId != null"> |
|
|
|
and o.c_user_id = #{cUserId} |
|
|
|
</if> |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and o.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and o.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != composeOrderId "> |
|
|
|
and o.`compose_order_id` = #{composeOrderId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentOrderId "> |
|
|
|
and o.`parent_order_id` = #{parentOrderId} |
|
|
|
</if> |
|
|
|
<if test="orderStatus != null"> |
|
|
|
AND o.order_status = #{orderStatus} |
|
|
|
</if> |
|
|
|
<if test=" null != payVendor "> |
|
|
|
and o.pay_vendor = #{payVendor} |
|
|
|
</if> |
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="listGoodsCAsPage" parameterType="com.iformall.domain.po.WxOrder" resultMap="CVoListMap"> |
|
|
|
select * from( |
|
|
|
|
|
|
|
@@ -571,37 +518,6 @@ |
|
|
|
order by a.create_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectDetailOfCUser" parameterType="com.iformall.domain.po.WxOrder" resultMap="CVoResultMap"> |
|
|
|
select |
|
|
|
<include refid="allCUserOrderDetailColumns"/> |
|
|
|
FROM wx_order o |
|
|
|
left join wx_coupon c ON o.product_id = c.id |
|
|
|
left join wx_coupon_order co on o.id = co.order_id |
|
|
|
where o.product_id = c.id |
|
|
|
<if test="cUserId != null"> |
|
|
|
and o.c_user_id = #{cUserId} |
|
|
|
</if> |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and o.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and o.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != composeOrderId "> |
|
|
|
and o.`compose_order_id` = #{composeOrderId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != parentOrderId "> |
|
|
|
and o.`parent_order_id` = #{parentOrderId} |
|
|
|
</if> |
|
|
|
<if test="id != null"> |
|
|
|
and o.id = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="dayMicroPayAmountList" parameterType="map" resultType="map"> |
|
|
|
select count(*) as count, IFNULL(sum(o.payment), 0) as total_price |
|
|
|
from wx_order o |
|
|
|
|