xuhy
2024-10-25 ab9eb0f1fcd3a20f7b1ec90fb63e9a8cb7f7792a
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TChargingOrderMapper.xml
@@ -121,12 +121,12 @@
        title,
        `status`,
        order_amount,
        payment_amount ,
        order_amount as payment_amount ,
        create_time,
        end_time,
        pay_time,
        refund_status,
        (payment_amount-refund_amount) as final_amount,
        (order_amount) as final_amount,
        del_flag,
        app_user_id
        FROM
@@ -372,7 +372,7 @@
    </select>
    <select id="countAll" resultType="java.util.Map">
        select sum(electrovalence) as electrovalence,sum(service_charge) as service_charge,ROUND(sum(order_amount) * 0.0006, 2) as commission_amount,sum(sharing_amount) as sharing_amount
        select sum(electrovalence) as electrovalence,sum(service_charge) as service_charge,ROUND(sum(electrovalence+service_charge) * 0.0006, 2) as commission_amount,sum(sharing_amount) as sharing_amount
        from t_charging_order
        where create_time &gt;= #{sixBefore} and del_flag = 0 and recharge_payment_status = 2
    </select>
@@ -791,12 +791,14 @@
        GROUP BY vehicle_use
    </select>
    <select id="carUserBrand" resultType="java.util.Map">
        SELECT
            count(1) as counts,vehicle_brand
        from charging_pile_account.t_app_user_car
                where  del_flag = 0
        where  del_flag = 0
        GROUP BY vehicle_brand
        ORDER BY counts DESC
            limit 5
    </select>
    <select id="countLocalCar" resultType="java.util.Map">
        SELECT
@@ -947,16 +949,16 @@
        SELECT
            FORMAT(SUM(TIME_TO_SEC(TIMEDIFF(co.end_time, co.start_time)) /
                       <if test="statisticsQueryDto.dayType == 1">
                           86400
                           864
                       </if>
                   <if test="statisticsQueryDto.dayType == 2">
                       604800
                       6048
                   </if>
                   <if test="statisticsQueryDto.dayType == 3">
                       2592000
                       25920
                   </if>
                   <if test="statisticsQueryDto.dayType == 4">
                       31536000
                       315360
                   </if>
                   <if test="statisticsQueryDto.dayType == 5">
                       (86400*(SELECT TIMESTAMPDIFF(DAY, #{statisticsQueryDto.startTime}, #{statisticsQueryDto.endTime}) +1 AS days_difference
@@ -1297,7 +1299,7 @@
                LEFT JOIN `charging_pile_service`.`t_charging_gun` tc ON co.charging_gun_id = tc.id
                LEFT JOIN `charging_pile_service`.`t_charging_pile` cp ON tc.charging_pile_id = cp.id
        <where>
            cp.type = 1
            cp.type = 1 and co.need_elec != 0
            <if test="siteIds != null and siteIds.size() > 0">
                and co.site_id IN
                <foreach collection="siteIds" item="siteId" open="(" separator="," close=")">
@@ -1317,12 +1319,11 @@
                AND YEAR( co.create_time ) = YEAR(CURDATE() )
            </if>
            <if test="statisticsQueryDto.dayType == 5">
                <if test="statisticsQueryDto.startTime != null">
                    and DATE(co.create_time) >= #{statisticsQueryDto.startTime}
                </if>
                <if test="statisticsQueryDto.endTime != null">
                    and DATE(co.create_time)  &lt;= #{statisticsQueryDto.endTime}
                </if>
            </if>
        </where>
        GROUP BY