无关风月
2024-10-23 ee2bf95f3472a4179ee0fc7c8e4e2a35e1214bc8
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml
@@ -44,9 +44,18 @@
        id, code, app_user_id, order_type, goods_id, coupon_id, purchase_quantity, app_user_address_id, order_amount, app_coupon_id, coupon_discount_amount, vip_discount, vip_discount_amount, payment_amount, payment_status, payment_type, serial_number, remark, status, express_company, express_number, consigner_id, consigner_time, receiving_time, cancellation_time, cancellation_id, refund_code, refund_amount, refund_status, refund_serial_number, refund_time, create_time, del_flag
    </sql>
    <select id="activityStatistics" resultType="com.ruoyi.order.api.vo.TActivityStatisticslVO">
        select t9.code ,t9.order_amount as orderAmount,
        t9.coupon_discount_amount as couponDiscountAmount,
        t9.vip_discount_amount as vipDiscountAmount,
        t9.payment_amount as paymentAmount,
        t9.create_time as createTime,
        1 as orderType
        from t_charging_order t9
        where t9.id = 0 limit 1
        <if test="req.orderType == null or req.orderType == 1">
        <if test="req.type == null or req.type == 1 or req.type == 2">
        select t1.code ,t1.order_amount as orderAmount,
            union all
            select t1.code ,t1.order_amount as orderAmount,
               t1.coupon_discount_amount as couponDiscountAmount,
               t1.vip_discount_amount as vipDiscountAmount,
               t1.payment_amount as paymentAmount,
@@ -98,13 +107,13 @@
                and t2.code  LIKE CONCAT('%',#{req.code},'%')
            </if>
            <if test="req.type != null and req.type != '' and req.type == 1">
                and t2.coupon_discount_amount  IS NOT NULL and t2.coupon_discount_amount  != 0
                and (t2.coupon_discount_amount  > 0)
            </if>
            <if test="req.type != null and req.type != '' and req.type == 2">
                and t2.vip_discount_amount  IS NOT NULL and t2.vip_discount_amount  != 0
                and ( t2.vip_discount_amount  > 0)
            </if>
            <if test="req.type == null ">
                and t2.vip_discount_amount  IS NOT NULL and t2.vip_discount_amount  != 0 and t2.coupon_discount_amount  IS NOT NULL and t2.coupon_discount_amount  != 0
                and (t2.vip_discount_amount  > 0 or t2.coupon_discount_amount  > 0)
            </if>
            <if test="null != req.userIds and req.userIds.size()>0" >
                and t2.app_user_id in
@@ -115,7 +124,6 @@
            <if test="req.endTime != null and req.endTime != '' and req.startTime != null and req.startTime != ''">
                AND (t2.create_time between CONCAT(#{req.startTime},':00') and CONCAT(#{req.endTime},':59'))
            </if>
            and t2.refund_status !=2
            and t2.payment_status =2
            AND t2.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
        </if>