2024-05-23 17:24:41 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
< !DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace= "com.ruoyi.system.mapper.EtOrderMapper" >
<resultMap type= "EtOrder" id= "EtOrderResult" >
<result property= "orderId" column= "order_id" />
<result property= "areaId" column= "area_id" />
<result property= "orderNo" column= "order_no" />
<result property= "outTradeNo" column= "out_trade_no" />
<result property= "userId" column= "user_id" />
<result property= "ruleId" column= "rule_id" />
2024-09-04 21:45:18 +08:00
<result property= "couponId" column= "coupon_id" />
2024-09-06 17:00:13 +08:00
<result property= "logId" column= "log_id" />
2024-05-23 17:24:41 +08:00
<result property= "deviceMac" column= "device_mac" />
<result property= "sn" column= "sn" />
2024-06-25 09:25:38 +08:00
<result property= "vehicleNum" column= "vehicle_num" />
2024-05-23 17:24:41 +08:00
<result property= "payTime" column= "pay_time" />
<result property= "paid" column= "paid" />
<result property= "payType" column= "pay_type" />
<result property= "type" column= "type" />
<result property= "totalFee" column= "total_fee" />
2024-06-13 17:47:25 +08:00
<result property= "payFee" column= "pay_fee" />
2024-05-23 17:24:41 +08:00
<result property= "dispatchFee" column= "dispatch_fee" />
<result property= "manageFee" column= "manage_fee" />
<result property= "ridingFee" column= "riding_fee" />
<result property= "appointmentFee" column= "appointment_fee" />
<result property= "mark" column= "mark" />
<result property= "duration" column= "duration" />
<result property= "distance" column= "distance" />
<result property= "status" column= "status" />
<result property= "createTime" column= "create_time" />
<result property= "appointmentStartTime" column= "appointment_start_time" />
<result property= "appointmentEndTime" column= "appointment_end_time" />
2024-05-29 18:18:40 +08:00
<result property= "appointmentTimeout" column= "appointment_timeout" />
2024-05-23 17:24:41 +08:00
<result property= "unlockTime" column= "unlock_time" />
<result property= "returnTime" column= "return_time" />
<result property= "ruleEndTime" column= "rule_end_time" />
<result property= "returnType" column= "return_type" />
<result property= "tripRoute" column= "trip_route" />
<result property= "tripRouteStr" column= "trip_route_str" />
2024-07-03 21:18:16 +08:00
<result property= "cycle" column= "cycle" />
2024-07-08 14:18:58 +08:00
<result property= "depositDeduction" column= "deposit_deduction" />
2024-07-13 14:12:47 +08:00
<result property= "videoUrl" column= "video_url" />
2024-07-20 18:34:58 +08:00
<result property= "uploadTime" column= "upload_time" />
2024-07-13 14:12:47 +08:00
<result property= "deductionAmount" column= "deduction_amount" />
<result property= "audioFiles" column= "audio_files" />
2024-07-17 09:34:09 +08:00
<result property= "usedSn" column= "used_sn" />
<result property= "changeReason" column= "change_reason" />
2024-08-07 10:25:15 +08:00
<result property= "locking" column= "locking" />
2024-09-04 08:43:06 +08:00
<result property= "autoRefundDeposit" column= "auto_refund_deposit" />
<result property= "freeRideTime" column= "free_ride_time" />
<result property= "rentalUnit" column= "rental_unit" />
<result property= "ridingRule" column= "riding_rule" />
<result property= "ridingRuleJson" column= "riding_rule_json" />
<result property= "chargingCycle" column= "charging_cycle" />
<result property= "chargingCycleValue" column= "charging_cycle_value" />
<result property= "cappedAmount" column= "capped_amount" />
2024-09-09 08:43:13 +08:00
<result property= "handlingCharge" column= "handling_charge" />
<result property= "platformServiceFee" column= "platform_service_fee" />
<result property= "operatorDividend" column= "operator_dividend" />
2024-09-14 11:24:58 +08:00
<result property= "payChannel" column= "pay_channel" />
2024-09-28 11:24:01 +08:00
<result property= "cost" column= "cost" />
2024-05-23 17:24:41 +08:00
</resultMap>
<sql id= "selectEtOrderVo" >
2024-09-06 17:00:13 +08:00
select order_id, area_id, order_no, out_trade_no, user_id, rule_id, coupon_id,log_id
2024-06-13 17:47:25 +08:00
device_mac, sn, pay_time, paid, pay_type, type, total_fee, pay_fee, dispatch_fee,
2024-05-23 17:24:41 +08:00
manage_fee, riding_fee, appointment_fee, mark, duration, distance, status,
2024-07-13 14:12:47 +08:00
create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time,
2024-09-04 08:43:06 +08:00
rule_end_time, return_type, AsText(trip_route) trip_route,trip_route_str,cycle,deposit_deduction,video_url,
upload_time,deduction_amount,audio_files,used_sn,change_reason,locking,auto_refund_deposit,free_ride_time,
2024-09-28 11:24:01 +08:00
rental_unit,riding_rule,riding_rule_json,charging_cycle,charging_cycle_value,capped_amount,handling_charge, platform_service_fee, pay_channel,cost,
2024-09-14 11:24:58 +08:00
operator_dividend from et_order
2024-05-23 17:24:41 +08:00
</sql>
2024-08-25 17:27:02 +08:00
<sql id= "selectEtOrderVoNoRoute" >
2024-09-06 17:00:13 +08:00
select order_id, area_id, order_no, out_trade_no, user_id, rule_id, coupon_id,log_id
2024-08-25 17:27:02 +08:00
device_mac, sn, pay_time, paid, pay_type, type, total_fee, pay_fee, dispatch_fee,
manage_fee, riding_fee, appointment_fee, mark, duration, distance, status,
create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time,
2024-09-14 11:24:58 +08:00
rule_end_time, return_type, cycle,deposit_deduction,video_url,upload_time,deduction_amount,audio_files,
used_sn,change_reason,locking,auto_refund_deposit,free_ride_time,
2024-09-28 11:24:01 +08:00
rental_unit,riding_rule,riding_rule_json,charging_cycle,charging_cycle_value,capped_amount,handling_charge, platform_service_fee, pay_channel,cost,
2024-09-14 11:24:58 +08:00
operator_dividend from et_order
2024-08-25 17:27:02 +08:00
</sql>
2024-05-23 17:24:41 +08:00
<select id= "selectEtOrderList" parameterType= "EtOrder" resultMap= "EtOrderResult" >
SELECT
2024-06-03 12:23:23 +08:00
o.order_id,
o.area_id,
oa.area_name AS area,
2024-07-08 14:18:58 +08:00
oa.is_deposit_deduction isDepositDeduction,
2024-06-03 12:23:23 +08:00
u.user_name AS userName,
u.phonenumber AS phonenumber,
2024-07-09 14:18:54 +08:00
u.real_name AS realName,
2024-06-03 12:23:23 +08:00
o.order_no,
o.out_trade_no,
o.user_id,
o.rule_id,
2024-09-04 21:45:18 +08:00
o.coupon_id,
2024-09-06 17:00:13 +08:00
o.log_id,
2024-06-03 12:23:23 +08:00
o.device_mac,
o.sn,
2024-06-25 09:25:38 +08:00
de.vehicle_num,
2024-06-03 12:23:23 +08:00
o.pay_time,
o.paid,
o.pay_type,
2024-09-20 22:20:52 +08:00
o.deposit_deduction,
2024-09-28 11:24:01 +08:00
o.riding_rule_json,
2024-06-03 12:23:23 +08:00
o.type,
COALESCE(o.total_fee, 0) AS total_fee,
2024-06-13 17:47:25 +08:00
COALESCE(o.pay_fee, 0) AS pay_fee,
2024-06-03 12:23:23 +08:00
COALESCE(o.dispatch_fee, 0) AS dispatch_fee,
COALESCE(o.manage_fee, 0) AS manage_fee,
COALESCE(o.riding_fee, 0) AS riding_fee,
COALESCE(o.appointment_fee, 0) AS appointment_fee,
o.mark,
o.duration,
o.distance,
o.status,
o.create_time,
o.appointment_start_time,
o.appointment_end_time,
o.appointment_timeout,
o.unlock_time,
o.return_time,
o.rule_end_time,
o.return_type,
AsText(o.trip_route),
2024-07-13 14:12:47 +08:00
o.trip_route_str,
o.video_url,
2024-07-20 18:34:58 +08:00
o.upload_time,
2024-07-13 14:12:47 +08:00
o.deduction_amount,
2024-07-17 09:34:09 +08:00
o.audio_files,
o.used_sn,
2024-08-07 10:25:15 +08:00
o.change_reason,
2024-09-09 08:43:13 +08:00
o.locking,
o.handling_charge,
o.platform_service_fee,
2024-09-14 11:24:58 +08:00
o.operator_dividend,
2024-09-28 11:24:01 +08:00
o.pay_channel,
o.cost
2024-05-23 17:24:41 +08:00
FROM
et_order o
LEFT JOIN
et_operating_area oa ON o.area_id = oa.area_id
LEFT JOIN
2024-06-25 09:25:38 +08:00
et_device de ON de.sn = o.sn
LEFT JOIN
2024-05-23 17:24:41 +08:00
et_user u ON u.user_id = o.user_id
2024-06-01 14:25:02 +08:00
LEFT join et_area_dept ad on ad.area_id = oa.area_id
LEFT join sys_dept d on d.dept_id = ad.dept_id
2024-05-31 21:52:08 +08:00
where 1 = 1
<if test= "orderNo != null and orderNo != ''" > and o.order_no like concat('%', #{orderNo}, '%')</if>
<if test= "area != null and area != ''" > and oa.area_name like concat('%', #{area}, '%')</if>
2024-06-25 09:25:38 +08:00
<if test= "areaId != null" > and o.area_id = #{areaId}</if>
2024-09-27 15:23:10 +08:00
<if test= "deptId != null" > and d.dept_id = #{deptId}</if>
2024-05-31 21:52:08 +08:00
<if test= "userName != null and userName != ''" > and u.user_name like concat('%', #{userName}, '%')</if>
<if test= "phonenumber != null and phonenumber != ''" > and u.phonenumber like concat('%', #{phonenumber}, '%')</if>
2024-06-01 14:25:02 +08:00
<if test= "userId != null and userId != ''" > and o.user_id = #{userId}</if>
2024-05-31 21:52:08 +08:00
<if test= "deviceMac != null and deviceMac != ''" > and o.device_mac like concat('%', #{deviceMac}, '%')</if>
2024-07-08 14:18:58 +08:00
<if test= "vehicleNum != null and vehicleNum != ''" > and de.vehicle_num like concat('%', #{vehicleNum }, '%')</if>
2024-05-31 21:52:08 +08:00
<if test= "sn != null and sn != ''" > and o.sn like concat('%', #{sn}, '%')</if>
<if test= "type != null and type != ''" > and o.type = #{type}</if>
<if test= "status != null and status != ''" > and o.status = #{status}</if>
<if test= "paid != null and paid != ''" > and o.paid = #{paid}</if>
2024-08-07 20:13:16 +08:00
<if test= "payType != null and payType != ''" > and o.pay_type = #{payType}</if>
2024-05-31 21:52:08 +08:00
<if test= "params.beginTime != null and params.beginTime != ''" > <!-- 开始时间检索 -->
AND date_format(o.create_time,'%y%m%d') > = date_format(#{params.beginTime},'%y%m%d')
</if>
<if test= "params.endTime != null and params.endTime != ''" > <!-- 结束时间检索 -->
AND date_format(o.create_time,'%y%m%d') < = date_format(#{params.endTime},'%y%m%d')
</if>
<if test= "startTime != null and startTime != ''" > <!-- 开始时间检索 -->
AND date_format(o.create_time,'%y%m%d') > = date_format(#{startTime},'%y%m%d')
</if>
<if test= "endTime != null and endTime != ''" > <!-- 结束时间检索 -->
AND date_format(o.create_time,'%y%m%d') < = date_format(#{endTime},'%y%m%d')
</if>
<if test= "statusList != null" >
AND o.status IN
<foreach item= "item" index= "index" collection= "statusList" open= "(" separator= "," close= ")" >
#{item}
</foreach>
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
2024-06-06 22:07:28 +08:00
order by o.create_time desc
2024-05-23 17:24:41 +08:00
</select>
2024-08-30 17:51:58 +08:00
<select id= "selectEtOrderListNoRoute" parameterType= "EtOrder" resultMap= "EtOrderResult" >
SELECT
o.order_id,
o.area_id,
oa.area_name AS area,
oa.is_deposit_deduction isDepositDeduction,
u.user_name AS userName,
u.phonenumber AS phonenumber,
u.real_name AS realName,
o.order_no,
o.out_trade_no,
o.user_id,
o.rule_id,
2024-09-04 21:45:18 +08:00
o.coupon_id,
2024-09-06 17:00:13 +08:00
o.log_id,
2024-08-30 17:51:58 +08:00
o.device_mac,
o.sn,
de.vehicle_num,
o.pay_time,
o.paid,
o.pay_type,
o.type,
COALESCE(o.total_fee, 0) AS total_fee,
COALESCE(o.pay_fee, 0) AS pay_fee,
COALESCE(o.dispatch_fee, 0) AS dispatch_fee,
COALESCE(o.manage_fee, 0) AS manage_fee,
COALESCE(o.riding_fee, 0) AS riding_fee,
COALESCE(o.appointment_fee, 0) AS appointment_fee,
o.mark,
o.duration,
o.distance,
o.status,
o.create_time,
o.appointment_start_time,
o.appointment_end_time,
o.appointment_timeout,
o.unlock_time,
o.return_time,
o.rule_end_time,
o.return_type,
o.video_url,
o.upload_time,
o.deduction_amount,
o.deposit_deduction,
o.audio_files,
o.used_sn,
o.change_reason,
2024-09-09 08:43:13 +08:00
o.locking,
o.handling_charge,
o.platform_service_fee,
2024-09-14 11:24:58 +08:00
o.operator_dividend,
2024-09-28 11:24:01 +08:00
o.pay_channel,
o.cost
2024-08-30 17:51:58 +08:00
FROM
et_order o
LEFT JOIN
et_operating_area oa ON o.area_id = oa.area_id
LEFT JOIN
et_device de ON de.sn = o.sn
LEFT JOIN
et_user u ON u.user_id = o.user_id
LEFT join et_area_dept ad on ad.area_id = oa.area_id
LEFT join sys_dept d on d.dept_id = ad.dept_id
where 1 = 1
<if test= "orderNo != null and orderNo != ''" > and o.order_no like concat('%', #{orderNo}, '%')</if>
<if test= "area != null and area != ''" > and oa.area_name like concat('%', #{area}, '%')</if>
<if test= "areaId != null" > and o.area_id = #{areaId}</if>
<if test= "userName != null and userName != ''" > and u.user_name like concat('%', #{userName}, '%')</if>
<if test= "phonenumber != null and phonenumber != ''" > and u.phonenumber like concat('%', #{phonenumber}, '%')</if>
<if test= "userId != null and userId != ''" > and o.user_id = #{userId}</if>
<if test= "deviceMac != null and deviceMac != ''" > and o.device_mac like concat('%', #{deviceMac}, '%')</if>
<if test= "vehicleNum != null and vehicleNum != ''" > and de.vehicle_num like concat('%', #{vehicleNum }, '%')</if>
<if test= "sn != null and sn != ''" > and o.sn like concat('%', #{sn}, '%')</if>
<if test= "type != null and type != ''" > and o.type = #{type}</if>
<if test= "status != null and status != ''" > and o.status = #{status}</if>
<if test= "paid != null and paid != ''" > and o.paid = #{paid}</if>
<if test= "payType != null and payType != ''" > and o.pay_type = #{payType}</if>
<if test= "params.beginTime != null and params.beginTime != ''" > <!-- 开始时间检索 -->
AND date_format(o.create_time,'%y%m%d') > = date_format(#{params.beginTime},'%y%m%d')
</if>
<if test= "params.endTime != null and params.endTime != ''" > <!-- 结束时间检索 -->
AND date_format(o.create_time,'%y%m%d') < = date_format(#{params.endTime},'%y%m%d')
</if>
<if test= "startTime != null and startTime != ''" > <!-- 开始时间检索 -->
AND date_format(o.create_time,'%y%m%d') > = date_format(#{startTime},'%y%m%d')
</if>
<if test= "endTime != null and endTime != ''" > <!-- 结束时间检索 -->
AND date_format(o.create_time,'%y%m%d') < = date_format(#{endTime},'%y%m%d')
</if>
<if test= "statusList != null" >
AND o.status IN
<foreach item= "item" index= "index" collection= "statusList" open= "(" separator= "," close= ")" >
#{item}
</foreach>
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by o.create_time desc
</select>
2024-09-28 08:48:58 +08:00
<select id= "selectEtOrderListNoRoute2" parameterType= "EtOrderQuery" resultMap= "EtOrderResult" >
SELECT
o.order_id,
o.area_id,
oa.area_name AS area,
oa.is_deposit_deduction isDepositDeduction,
u.user_name AS userName,
u.phonenumber AS phonenumber,
u.real_name AS realName,
o.order_no,
o.out_trade_no,
o.user_id,
o.rule_id,
o.coupon_id,
o.log_id,
o.device_mac,
o.sn,
de.vehicle_num,
o.pay_time,
o.paid,
o.pay_type,
o.type,
COALESCE(o.total_fee, 0) AS total_fee,
COALESCE(o.pay_fee, 0) AS pay_fee,
COALESCE(o.dispatch_fee, 0) AS dispatch_fee,
COALESCE(o.manage_fee, 0) AS manage_fee,
COALESCE(o.riding_fee, 0) AS riding_fee,
COALESCE(o.appointment_fee, 0) AS appointment_fee,
o.mark,
o.duration,
o.distance,
o.status,
o.create_time,
o.appointment_start_time,
o.appointment_end_time,
o.appointment_timeout,
o.unlock_time,
o.return_time,
o.rule_end_time,
o.return_type,
o.video_url,
o.upload_time,
o.deduction_amount,
o.deposit_deduction,
o.audio_files,
o.used_sn,
o.change_reason,
o.locking,
o.handling_charge,
o.platform_service_fee,
o.operator_dividend,
2024-09-28 11:24:01 +08:00
o.pay_channel,
o.cost
2024-09-28 08:48:58 +08:00
FROM
et_order o
LEFT JOIN
et_operating_area oa ON o.area_id = oa.area_id
LEFT JOIN
et_device de ON de.sn = o.sn
LEFT JOIN
et_user u ON u.user_id = o.user_id
LEFT join et_area_dept ad on ad.area_id = oa.area_id
LEFT join sys_dept d on d.dept_id = ad.dept_id
where 1 = 1
<if test= "userName != null and userName != ''" > and u.user_name like concat('%', #{userName}, '%')</if>
<if test= "type != null and type != ''" > and o.type = #{type}</if>
<if test= "status != null and status != ''" > and o.status = #{status}</if>
<if test= "paid != null and paid != ''" > and o.paid = #{paid}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by o.create_time desc
</select>
2024-05-23 17:24:41 +08:00
<select id= "selectEtOrderByOrderId" parameterType= "Long" resultMap= "EtOrderResult" >
2024-06-19 19:31:59 +08:00
select o.order_id,
o.area_id,
o.order_no,
o.out_trade_no,
oa.area_name AS area,
u.user_name AS userName,
u.phonenumber AS phonenumber,
o.rule_id,
2024-09-04 21:45:18 +08:00
o.coupon_id,
2024-09-06 17:00:13 +08:00
o.log_id,
2024-06-19 19:31:59 +08:00
o.device_mac,
o.sn,
o.pay_time,
o.paid,
o.pay_type,
2024-07-13 14:12:47 +08:00
o.video_url,
2024-07-20 18:34:58 +08:00
o.upload_time,
2024-07-13 14:12:47 +08:00
o.deduction_amount,
o.audio_files,
2024-06-19 19:31:59 +08:00
o.type, COALESCE(o.total_fee, 0) AS total_fee,
COALESCE(o.pay_fee, 0) AS pay_fee,
COALESCE(o.dispatch_fee, 0) AS dispatch_fee,
COALESCE(o.manage_fee, 0) AS manage_fee,
COALESCE(o.riding_fee, 0) AS riding_fee,
COALESCE(o.appointment_fee, 0) AS appointment_fee,
o.mark,
o.duration,
o.distance,
o.status,
o.create_time,
o.appointment_start_time,
o.appointment_end_time,
o.appointment_timeout,
o.unlock_time,
o.return_time,
o.rule_end_time,
o.return_type,
2024-09-14 11:24:58 +08:00
o.pay_channel,
2024-06-19 19:31:59 +08:00
AsText(o.trip_route) trip_route,
2024-09-13 22:23:23 +08:00
o.trip_route_str,
o.rental_unit,
o.riding_rule,
o.riding_rule_json,
o.charging_cycle,
o.charging_cycle_value,
o.capped_amount,
o.handling_charge,
o.platform_service_fee,
2024-09-28 11:24:01 +08:00
o.operator_dividend,
o.cost
2024-09-13 22:23:23 +08:00
from et_order o
2024-06-19 19:31:59 +08:00
LEFT JOIN et_user u ON u.user_id = o.user_id
LEFT JOIN et_operating_area oa ON o.area_id = oa.area_id
2024-05-23 17:24:41 +08:00
where order_id = #{orderId}
</select>
<select id= "selectEtOrderByOrderNo" parameterType= "String" resultMap= "EtOrderResult" >
<include refid= "selectEtOrderVo" />
where order_no = #{orderNo}
</select>
<select id= "selectEtOrderByOutTradeNo" parameterType= "String" resultMap= "EtOrderResult" >
<include refid= "selectEtOrderVo" />
where out_trade_no = #{outTradeNo}
</select>
<select id= "isInOrder" resultMap= "EtOrderResult" parameterType= "Long" >
<include refid= "selectEtOrderVo" />
<where >
<if test= "orderNo != null and orderNo != ''" > and order_no != #{orderNo}</if>
2024-07-17 09:34:09 +08:00
and user_id = #{userId} and status !=4 and status !=5 and status !=6 and status !=7 and type = 1
2024-05-23 17:24:41 +08:00
</where>
</select>
2024-08-07 10:25:15 +08:00
<select id= "isInAuditOrder" resultMap= "EtOrderResult" parameterType= "Long" >
<include refid= "selectEtOrderVo" />
<where >
<if test= "orderNo != null and orderNo != ''" > and order_no != #{orderNo}</if>
and user_id = #{userId} and status in(5,6,7) and type = 1
</where>
</select>
2024-08-25 17:27:02 +08:00
<select id= "isInOrderBySn" resultType= "Integer" parameterType= "String" >
select count(1) from et_order
2024-06-11 16:38:59 +08:00
where sn = #{sn} and status =2 and type = 1
</select>
2024-05-23 17:24:41 +08:00
<select id= "checkIsUnique" resultType= "Integer" parameterType= "Long" >
select count(1) from et_order
2024-05-27 19:32:10 +08:00
where user_id = #{userId} and status = 0 and type=1
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalIncome" resultType= "java.lang.String" >
select COALESCE(SUM(total_fee), 0) from et_order where status = 4 and type = 1
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-06-25 09:25:38 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalUnpaid" resultType= "java.lang.String" parameterType= "String" >
2024-07-03 21:18:16 +08:00
select COALESCE(SUM(total_fee), 0) from et_order where status = 3 and type = 1 and paid = 0
2024-07-19 20:00:16 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalPaid" resultType= "java.lang.String" >
select COALESCE(SUM(total_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
2024-09-24 11:38:02 +08:00
AND date_format(pay_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
2024-07-20 18:34:58 +08:00
</if>
<if test= "timeEnd != null and timeEnd != ''" >
2024-09-24 11:38:02 +08:00
AND date_format(pay_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
2024-07-20 18:34:58 +08:00
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalRefund" resultType= "java.lang.String" >
2024-07-03 21:18:16 +08:00
select COALESCE(SUM(r.amount), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(r.create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(r.create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and o.area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalRidingFee" resultType= "java.lang.String" >
select COALESCE(SUM(riding_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalRidingRefund" resultType= "java.lang.String" >
2024-07-03 21:18:16 +08:00
select COALESCE(SUM(r.riding_fee), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(r.create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(r.create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and o.area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalDispatchFee" resultType= "java.lang.String" >
select COALESCE(SUM(dispatch_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalDispatchRefund" resultType= "java.lang.String" >
2024-07-03 21:18:16 +08:00
select COALESCE(SUM(r.dispatch_fee), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(r.create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(r.create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and o.area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalAppointmentFee" resultType= "java.lang.String" >
select COALESCE(SUM(appointment_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalAppointmentRefund" resultType= "java.lang.String" >
2024-07-03 21:18:16 +08:00
select COALESCE(SUM(r.appointment_fee), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(r.create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(r.create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and o.area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalManageFee" resultType= "java.lang.String" >
select COALESCE(SUM(manage_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getTotalManageRefund" resultType= "java.lang.String" >
2024-07-03 21:18:16 +08:00
select COALESCE(SUM(r.manage_fee), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(r.create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(r.create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and o.area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getPaidOrder" resultType= "java.lang.String" >
select COALESCE(count(1), 0) from et_order where status = 4 and type = 1 and paid = 1
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-19 20:00:16 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getRidingOrder" resultType= "java.lang.String" >
select COALESCE(count(1), 0) from et_order where status = 2 and type = 1
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getRefundOrder" resultType= "java.lang.String" >
2024-07-03 21:18:16 +08:00
select COALESCE(count(1), 0) from et_refund r left join et_order o on o.order_no = r.order_no where r.type = 1 AND refund_result = 'SUCCESS'
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(r.create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(r.create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and o.area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getUnpaidOrder" resultType= "java.lang.String" >
2024-07-03 21:18:16 +08:00
select COALESCE(count(1), 0) from et_order where status = 3 and type = 1 and paid = 0
2024-07-19 20:00:16 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
</select>
<!-- 还车待审核订单数 -->
<select id= "getAuditOrderNum" resultType= "java.lang.Integer" >
select COALESCE(count(1), 0) from et_order where status = 5 and type = 1
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
</select>
<!-- 待审核还车押金扣款 -->
<select id= "getReturnOrderDeductFee" resultType= "java.math.BigDecimal" >
select COALESCE(SUM(total_fee), 0) from et_order where status > 5 and type = 1
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
</select>
<select id= "getOrderNum" resultType= "java.lang.Integer" >
select COALESCE(count(1), 0) from et_order where type = 1
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getServiceFee" resultType= "java.math.BigDecimal" >
select COALESCE(SUM(total_fee), 0) from et_order where status = 4 and type = 1 and paid = 1
2024-07-20 18:34:58 +08:00
<if test= "timeStart != null and timeStart != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{timeStart},'%y%m%d')
</if>
<if test= "timeEnd != null and timeEnd != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{timeEnd},'%y%m%d')
</if>
2024-07-03 21:18:16 +08:00
<if test= "areaId != null and areaId != ''" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
</select>
<select id= "getPayFee" resultType= "java.math.BigDecimal" >
2024-06-13 17:47:25 +08:00
select COALESCE(SUM(pay_fee), 0) from et_order
2024-05-23 17:24:41 +08:00
<where >
<if test= "sn != null and sn != ''" > and sn = #{sn}</if>
2024-06-18 11:30:58 +08:00
<if test= "areaId != null" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
<if test= "startDateStr != null and startDateStr != ''" >
2024-07-27 21:35:19 +08:00
AND date_format(pay_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
2024-05-23 17:24:41 +08:00
</if>
<if test= "endDateStr != null and endDateStr != ''" >
2024-07-27 21:35:19 +08:00
AND date_format(pay_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
2024-05-23 17:24:41 +08:00
</if>
AND status = 4 and type = 1 and paid = 1
</where>
</select>
2024-07-19 20:00:16 +08:00
<select id= "getOrderFee" resultType= "java.math.BigDecimal" >
select COALESCE(SUM(pay_fee), 0) from et_order
<where >
<if test= "areaId != null" > and area_id = #{areaId}</if>
<if test= "startDateStr != null and startDateStr != ''" >
2024-10-04 16:07:44 +08:00
AND date_format(pay_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
2024-07-19 20:00:16 +08:00
</if>
<if test= "endDateStr != null and endDateStr != ''" >
2024-10-04 16:07:44 +08:00
AND date_format(pay_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
2024-07-19 20:00:16 +08:00
</if>
AND status = 4 and type = 1
</where>
</select>
2024-06-18 11:30:58 +08:00
<select id= "getPartnerFee" resultType= "java.math.BigDecimal" >
SELECT COALESCE
( SUM( dd.dividend_amount ), 0 )
FROM
et_dividend_detail dd
LEFT JOIN et_order o ON o.order_no = dd.order_no
<where >
<if test= "areaId != null" > and o.area_id = #{areaId}</if>
<if test= "startDateStr != null and startDateStr != ''" >
AND date_format(o.create_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
</if>
<if test= "endDateStr != null and endDateStr != ''" >
AND date_format(o.create_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
</if>
AND o.status = 4 and o.type = 1 and o.paid = 1 and dd.partner_id is not null
</where>
</select>
2024-08-21 17:22:14 +08:00
<select id= "getDepositAmount" resultType= "java.math.BigDecimal" >
select COALESCE(SUM(pay_fee), 0) from et_order o
<where >
2024-10-04 16:07:44 +08:00
<if test= "areaId != null and areaId != 0" > and o.area_id = #{areaId}</if>
<if test= "channelId != null " > AND o.pay_channel = #{channelId}</if>
2024-08-21 17:22:14 +08:00
<if test= "startDateStr != null and startDateStr != ''" >
AND date_format(o.create_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
</if>
<if test= "endDateStr != null and endDateStr != ''" >
AND date_format(o.create_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
</if>
2024-10-04 16:07:44 +08:00
<if test= "channelId != 3 or (channelId == null)" > and o.area_id != 14 </if>
2024-08-21 17:22:14 +08:00
AND o.status = 4 and o.type = 2 and o.paid = 1
</where>
</select>
2024-06-18 11:30:58 +08:00
<select id= "getPlatformServiceFee" resultType= "java.math.BigDecimal" >
SELECT COALESCE
( SUM( dd.dividend_amount ), 0 )
FROM
et_dividend_detail dd
LEFT JOIN et_order o ON o.order_no = dd.order_no
<where >
<if test= "areaId != null" > and o.area_id = #{areaId}</if>
<if test= "startDateStr != null and startDateStr != ''" >
AND date_format(o.create_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
</if>
<if test= "endDateStr != null and endDateStr != ''" >
AND date_format(o.create_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
</if>
AND o.status = 4 and o.type = 1 and o.paid = 1 and dd.partner_id is null
</where>
</select>
2024-05-23 17:24:41 +08:00
<select id= "getIncome" resultType= "java.math.BigDecimal" >
2024-06-13 17:47:25 +08:00
select COALESCE(SUM(pay_fee), 0) from et_order
2024-05-23 17:24:41 +08:00
<where >
<if test= "sn != null and sn != ''" > and sn = #{sn}</if>
2024-07-08 14:18:58 +08:00
<if test= "areaId != null" > and area_id = #{areaId}</if>
2024-05-23 17:24:41 +08:00
<if test= "startDateStr != null and startDateStr != ''" >
AND date_format(create_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
</if>
<if test= "endDateStr != null and endDateStr != ''" >
AND date_format(create_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
</if>
AND status = 4 and type = 1
</where>
</select>
<select id= "getRefundFee" resultType= "java.math.BigDecimal" >
2024-06-25 09:25:38 +08:00
select COALESCE(SUM(amount), 0) from et_refund ref
left join et_order o on o.order_no = ref.order_no
2024-05-23 17:24:41 +08:00
<where >
2024-06-25 09:25:38 +08:00
<if test= "sn != null and sn != ''" > and o.sn = #{sn}</if>
2024-10-04 16:07:44 +08:00
<if test= "areaId != null and areaId != 0" > and o.area_id = #{areaId}</if>
<if test= "startDateStr != null and startDateStr != ''" >
AND date_format(ref.create_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
</if>
<if test= "endDateStr != null and endDateStr != ''" >
AND date_format(ref.create_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
</if>
AND ref.type = 1 AND ref.refund_result = 'SUCCESS'
</where>
</select>
<select id= "getRefundFee2" resultType= "java.math.BigDecimal" >
select COALESCE(SUM(amount), 0) from et_refund ref
left join et_order o on o.order_no = ref.order_no
<where >
<if test= "sn != null and sn != ''" > and o.sn = #{sn}</if>
<if test= "areaId != null and areaId != 0" > and o.area_id = #{areaId}</if>
<if test= "channelId != null " > and o.pay_channel = #{channelId}</if>
2024-05-23 17:24:41 +08:00
<if test= "startDateStr != null and startDateStr != ''" >
2024-09-21 16:23:57 +08:00
AND date_format(ref.create_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
2024-05-23 17:24:41 +08:00
</if>
<if test= "endDateStr != null and endDateStr != ''" >
2024-09-21 16:23:57 +08:00
AND date_format(ref.create_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
2024-05-23 17:24:41 +08:00
</if>
2024-06-25 09:25:38 +08:00
AND ref.type = 1 AND ref.refund_result = 'SUCCESS'
2024-05-23 17:24:41 +08:00
</where>
</select>
2024-08-21 17:22:14 +08:00
2024-10-04 16:07:44 +08:00
2024-08-21 17:22:14 +08:00
<select id= "getDepositRefundFee" resultType= "java.math.BigDecimal" >
select COALESCE(SUM(amount), 0) from et_refund ref
left join et_order o on o.order_no = ref.order_no
<where >
<if test= "sn != null and sn != ''" > and o.sn = #{sn}</if>
2024-10-04 16:07:44 +08:00
<if test= "areaId != null and areaId != 0" > and o.area_id = #{areaId}</if>
<if test= "channelId != null " > and o.pay_channel = #{channelId}</if>
2024-08-21 17:22:14 +08:00
<if test= "startDateStr != null and startDateStr != ''" >
2024-10-04 16:07:44 +08:00
AND date_format(ref.create_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
2024-08-21 17:22:14 +08:00
</if>
<if test= "endDateStr != null and endDateStr != ''" >
2024-10-04 16:07:44 +08:00
AND date_format(ref.create_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
2024-08-21 17:22:14 +08:00
</if>
2024-10-04 16:07:44 +08:00
<if test= "channelId != 3 or (channelId == null)" > and o.area_id != 14 </if>
2024-08-21 17:22:14 +08:00
AND ref.type = 2 AND ref.refund_result = 'SUCCESS'
</where>
</select>
2024-05-23 17:24:41 +08:00
<select id= "selectLatestOrder" resultMap= "EtOrderResult" >
SELECT *
FROM et_order
<where >
<if test= "userId != null" > and user_id = #{userId}</if>
2024-06-27 15:56:12 +08:00
<if test= "sn != null" > and sn = #{sn}</if>
2024-05-23 17:24:41 +08:00
and type = 1
</where>
ORDER BY create_time DESC
LIMIT 1
</select>
2024-06-27 15:56:12 +08:00
2024-09-14 10:15:41 +08:00
<select id= "selectLatestOrder2" resultMap= "EtOrderResult" >
<include refid= "selectEtOrderVoNoRoute" />
<where >
<if test= "userId != null" > and user_id = #{userId}</if>
<if test= "sn != null" > and sn = #{sn}</if>
</where>
ORDER BY create_time DESC
LIMIT 1
</select>
2024-06-27 15:56:12 +08:00
<select id= "selectLatestOrderList" resultMap= "EtOrderResult" >
2024-07-08 14:18:58 +08:00
SELECT o.*,u.phonenumber,u.real_name realName
FROM et_order o
left join et_user u on u.user_id = o.user_id
2024-06-27 15:56:12 +08:00
<where >
2024-07-08 14:18:58 +08:00
<if test= "userId != null" > and o.user_id = #{userId}</if>
<if test= "sn != null" > and o.sn = #{sn}</if>
and o.type = 1
2024-06-27 15:56:12 +08:00
</where>
2024-07-08 14:18:58 +08:00
ORDER BY o.create_time DESC
2024-06-27 15:56:12 +08:00
LIMIT 1
</select>
2024-06-05 09:16:59 +08:00
<select id= "selectAppointmentUnfinished" resultType= "com.ruoyi.system.domain.EtOrder" >
2024-08-25 17:27:02 +08:00
<include refid= "selectEtOrderVoNoRoute" />
where appointment_start_time is not null and appointment_start_time != '' AND appointment_end_time IS NULL
2024-06-05 09:16:59 +08:00
</select>
2024-05-23 17:24:41 +08:00
2024-06-05 18:12:19 +08:00
<select id= "selectUnrefundableDepositOrder" resultMap= "EtOrderResult" >
2024-08-25 17:27:02 +08:00
select o.order_id,
o.area_id,
o.order_no,
o.out_trade_no,
o.user_id,
o.rule_id,
2024-09-04 21:45:18 +08:00
o.coupon_id,
2024-09-06 17:00:13 +08:00
o.log_id,
2024-08-25 17:27:02 +08:00
o.device_mac,
o.sn,
o.pay_time,
o.paid,
o.pay_type,
o.type,
o.total_fee,
o.pay_fee,
o.dispatch_fee,
o.manage_fee,
o.riding_fee,
o.appointment_fee,
o.mark,
o.duration,
o.distance,
o.status,
o.create_time,
o.appointment_start_time,
o.appointment_end_time,
o.appointment_timeout,
o.unlock_time,return_time,
o.rule_end_time,
o.return_type,
o.cycle,
o.deposit_deduction,
o.video_url,
o.upload_time,
o.deduction_amount,
o.audio_files,
o.used_sn,
o.change_reason,
o.locking from et_order o
2024-06-05 18:12:19 +08:00
left JOIN et_refund r on r.order_no = o.order_no
where o.status ='4' and o.paid = '1' and o.type = 2 and r.refund_result IS NULL
</select>
<select id= "selectUserListFinishOrder" resultMap= "EtOrderResult" >
select * from et_order o
2024-06-19 19:31:59 +08:00
where o.status ='4' and o.paid = '1' and o.type = 1 and o.is_test = '0'
2024-06-05 18:12:19 +08:00
GROUP BY o.user_id
</select>
<select id= "selectNeedDividendOrder" resultType= "com.ruoyi.system.domain.EtOrder" >
SELECT
*
FROM
et_order o
WHERE
o.STATUS = '4'
AND o.paid = '1'
AND o.type = 1
AND o.pay_type != 'sys'
AND o.total_fee != 0
2024-06-19 19:31:59 +08:00
AND o.is_test = '0'
2024-06-05 18:12:19 +08:00
</select>
2024-08-07 20:13:16 +08:00
<select id= "selectDeductionList" resultType= "com.ruoyi.system.domain.EtOrder" parameterType= "long" >
2024-08-19 10:14:05 +08:00
select * from et_order o
<where >
<if test= "areaId != null" > and o.area_id = #{areaId}</if>
<if test= "startDateStr != null and startDateStr != ''" >
AND date_format(o.pay_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
</if>
<if test= "endDateStr != null and endDateStr != ''" >
AND date_format(o.pay_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
</if>
AND o.pay_type = 'yj'
</where>
2024-08-07 20:13:16 +08:00
</select>
2024-05-23 17:24:41 +08:00
<insert id= "insertEtOrder" parameterType= "EtOrder" useGeneratedKeys= "true" keyProperty= "orderId" >
insert into et_order
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "orderId != null" > order_id,</if>
<if test= "areaId != null" > area_id,</if>
<if test= "orderNo != null and orderNo != ''" > order_no,</if>
<if test= "userId != null" > user_id,</if>
<if test= "ruleId != null" > rule_id,</if>
2024-09-04 21:45:18 +08:00
<if test= "couponId != null" > coupon_id,</if>
2024-09-06 17:00:13 +08:00
<if test= "logId != null" > log_id,</if>
2024-05-23 17:24:41 +08:00
<if test= "deviceMac != null" > device_mac,</if>
<if test= "sn != null" > sn,</if>
<if test= "payTime != null" > pay_time,</if>
<if test= "paid != null" > paid,</if>
<if test= "payType != null and payType != ''" > pay_type,</if>
<if test= "type != null" > type,</if>
<if test= "totalFee != null" > total_fee,</if>
2024-06-13 17:47:25 +08:00
<if test= "payFee != null" > pay_fee,</if>
2024-05-23 17:24:41 +08:00
<if test= "dispatchFee != null" > dispatch_fee,</if>
<if test= "manageFee != null" > manage_fee,</if>
<if test= "ridingFee != null" > riding_fee,</if>
<if test= "appointmentFee != null" > appointment_fee,</if>
<if test= "mark != null" > mark,</if>
<if test= "duration != null" > duration,</if>
<if test= "distance != null" > distance,</if>
<if test= "status != null" > status,</if>
<if test= "createTime != null" > create_time,</if>
<if test= "appointmentStartTime != null" > appointment_start_time,</if>
<if test= "appointmentEndTime != null" > appointment_end_time,</if>
2024-05-29 18:18:40 +08:00
<if test= "appointmentTimeout != null" > appointment_timeout,</if>
2024-05-23 17:24:41 +08:00
<if test= "unlockTime != null" > unlock_time,</if>
<if test= "returnTime != null" > return_time,</if>
<if test= "ruleEndTime != null" > rule_end_time,</if>
<if test= "returnType != null" > return_type,</if>
<if test= "tripRoute != null" > trip_route,</if>
<if test= "tripRouteStr != null" > trip_route_str,</if>
2024-07-03 21:18:16 +08:00
<if test= "cycle != null" > cycle,</if>
2024-09-04 08:43:06 +08:00
<if test= "autoRefundDeposit != null" > auto_refund_deposit,</if>
<if test= "freeRideTime != null" > free_ride_time,</if>
<if test= "rentalUnit != null" > rental_unit,</if>
<if test= "ridingRule != null" > riding_rule,</if>
<if test= "ridingRuleJson != null" > riding_rule_json,</if>
<if test= "chargingCycle != null" > charging_cycle,</if>
<if test= "chargingCycleValue != null" > charging_cycle_value,</if>
<if test= "cappedAmount != null" > capped_amount,</if>
2024-09-14 11:24:58 +08:00
<if test= "payChannel != null and payChannel != ''" > pay_channel,</if>
2024-09-28 11:24:01 +08:00
<if test= "cost != null" > cost,</if>
2024-05-23 17:24:41 +08:00
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "orderId != null" > #{orderId},</if>
<if test= "areaId != null" > #{areaId},</if>
<if test= "orderNo != null and orderNo != ''" > #{orderNo},</if>
<if test= "userId != null" > #{userId},</if>
<if test= "ruleId != null" > #{ruleId},</if>
2024-09-04 21:45:18 +08:00
<if test= "couponId != null" > #{couponId},</if>
2024-09-06 17:00:13 +08:00
<if test= "logId != null" > #{logId},</if>
2024-05-23 17:24:41 +08:00
<if test= "deviceMac != null" > #{deviceMac},</if>
<if test= "sn != null" > #{sn},</if>
<if test= "payTime != null" > #{payTime},</if>
<if test= "paid != null" > #{paid},</if>
<if test= "payType != null and payType != ''" > #{payType},</if>
<if test= "type != null" > #{type},</if>
<if test= "totalFee != null" > #{totalFee},</if>
2024-06-13 17:47:25 +08:00
<if test= "payFee != null" > #{payFee},</if>
2024-05-23 17:24:41 +08:00
<if test= "dispatchFee != null" > #{dispatchFee},</if>
<if test= "manageFee != null" > #{manageFee},</if>
<if test= "ridingFee != null" > #{ridingFee},</if>
<if test= "appointmentFee != null" > #{appointmentFee},</if>
<if test= "mark != null" > #{mark},</if>
<if test= "duration != null" > #{duration},</if>
<if test= "distance != null" > #{distance},</if>
<if test= "status != null" > #{status},</if>
<if test= "createTime != null" > #{createTime},</if>
<if test= "appointmentStartTime != null" > #{appointmentStartTime},</if>
<if test= "appointmentEndTime != null" > #{appointmentEndTime},</if>
2024-05-29 18:18:40 +08:00
<if test= "appointmentTimeout != null" > #{appointmentTimeout},</if>
2024-05-23 17:24:41 +08:00
<if test= "unlockTime != null" > #{unlockTime},</if>
<if test= "returnTime != null" > #{returnTime},</if>
<if test= "ruleEndTime != null" > #{ruleEndTime},</if>
<if test= "returnType != null" > #{returnType},</if>
<if test= "tripRoute != null" > GeomFromText(#{tripRoute}),</if>
<if test= "tripRouteStr != null" > #{tripRouteStr},</if>
2024-07-03 21:18:16 +08:00
<if test= "cycle != null" > #{cycle},</if>
2024-09-04 08:43:06 +08:00
<if test= "autoRefundDeposit != null" > #{autoRefundDeposit},</if>
<if test= "freeRideTime != null" > #{freeRideTime},</if>
<if test= "rentalUnit != null" > #{rentalUnit},</if>
<if test= "ridingRule != null" > #{ridingRule},</if>
<if test= "ridingRuleJson != null" > #{ridingRuleJson},</if>
<if test= "chargingCycle != null" > #{chargingCycle},</if>
<if test= "chargingCycleValue != null" > #{chargingCycleValue},</if>
<if test= "cappedAmount != null" > #{cappedAmount},</if>
2024-09-14 11:24:58 +08:00
<if test= "payChannel != null and payChannel != ''" > #{payChannel},</if>
2024-09-28 11:24:01 +08:00
<if test= "cost != null" > #{cost},</if>
2024-05-23 17:24:41 +08:00
</trim>
</insert>
<update id= "updateEtOrder" parameterType= "EtOrder" >
update et_order
<trim prefix= "SET" suffixOverrides= "," >
<if test= "areaId != null" > area_id = #{areaId},</if>
<if test= "outTradeNo != null and outTradeNo != ''" > out_trade_no = #{outTradeNo},</if>
<if test= "userId != null" > user_id = #{userId},</if>
<if test= "ruleId != null" > rule_id = #{ruleId},</if>
2024-09-04 21:45:18 +08:00
<if test= "couponId != null" > coupon_id = #{couponId},</if>
2024-09-06 17:00:13 +08:00
<if test= "logId != null" > log_id = #{logId},</if>
2024-05-23 17:24:41 +08:00
<if test= "deviceMac != null" > device_mac = #{deviceMac},</if>
<if test= "sn != null" > sn = #{sn},</if>
<if test= "payTime != null" > pay_time = #{payTime},</if>
<if test= "paid != null" > paid = #{paid},</if>
<if test= "payType != null and payType != ''" > pay_type = #{payType},</if>
<if test= "type != null" > type = #{type},</if>
<if test= "totalFee != null" > total_fee = #{totalFee},</if>
2024-06-13 17:47:25 +08:00
<if test= "payFee != null" > pay_fee = #{payFee},</if>
2024-05-23 17:24:41 +08:00
<if test= "dispatchFee != null" > dispatch_fee = #{dispatchFee},</if>
<if test= "manageFee != null" > manage_fee = #{manageFee},</if>
<if test= "ridingFee != null" > riding_fee = #{ridingFee},</if>
<if test= "appointmentFee != null" > appointment_fee = #{appointmentFee},</if>
<if test= "mark != null" > mark = #{mark},</if>
<if test= "duration != null" > duration = #{duration},</if>
<if test= "distance != null" > distance = #{distance},</if>
<if test= "status != null" > status = #{status},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
<if test= "appointmentStartTime != null" > appointment_start_time = #{appointmentStartTime},</if>
<if test= "appointmentEndTime != null" > appointment_end_time = #{appointmentEndTime},</if>
2024-05-29 18:18:40 +08:00
<if test= "appointmentTimeout != null" > appointment_timeout = #{appointmentTimeout},</if>
2024-05-23 17:24:41 +08:00
<if test= "unlockTime != null" > unlock_time = #{unlockTime},</if>
<if test= "returnTime != null" > return_time = #{returnTime},</if>
<if test= "returnType != null" > return_type = #{returnType},</if>
<if test= "tripRoute != null" > trip_route = GeomFromText(#{tripRoute}),</if>
<if test= "tripRouteStr != null" > trip_route_str = #{tripRouteStr},</if>
2024-07-03 21:18:16 +08:00
<if test= "cycle != null" > cycle = #{cycle},</if>
2024-07-08 14:18:58 +08:00
<if test= "depositDeduction != null" > deposit_deduction = #{depositDeduction},</if>
2024-07-13 14:12:47 +08:00
<if test= "videoUrl != null" > video_url = #{videoUrl},</if>
2024-07-20 18:34:58 +08:00
<if test= "uploadTime != null" > upload_time = #{uploadTime},</if>
2024-07-13 14:12:47 +08:00
<if test= "deductionAmount != null" > deduction_amount = #{deductionAmount},</if>
<if test= "audioFiles != null" > audio_files = #{audioFiles},</if>
2024-07-17 09:34:09 +08:00
<if test= "usedSn != null" > used_sn = #{usedSn},</if>
<if test= "changeReason != null" > change_reason = #{changeReason},</if>
2024-08-07 10:25:15 +08:00
<if test= "locking != null" > locking = #{locking},</if>
2024-09-04 08:43:06 +08:00
<if test= "autoRefundDeposit != null" > auto_refund_deposit = #{autoRefundDeposit},</if>
<if test= "freeRideTime != null" > free_ride_time = #{freeRideTime},</if>
<if test= "rentalUnit != null" > rental_unit = #{rentalUnit},</if>
<if test= "ridingRule != null" > riding_rule = #{ridingRule},</if>
<if test= "ridingRuleJson != null" > riding_rule_json = #{ridingRuleJson},</if>
<if test= "chargingCycle != null" > charging_cycle = #{chargingCycle},</if>
<if test= "chargingCycleValue != null" > charging_cycle_value = #{chargingCycleValue},</if>
<if test= "cappedAmount != null" > capped_amount = #{cappedAmount},</if>
2024-09-09 08:43:13 +08:00
<if test= "handlingCharge != null" > handling_charge = #{handlingCharge},</if>
<if test= "platformServiceFee != null" > platform_service_fee = #{platformServiceFee},</if>
<if test= "operatorDividend != null" > operator_dividend = #{operatorDividend},</if>
2024-09-14 11:24:58 +08:00
<if test= "payChannel != null" > pay_channel = #{payChannel},</if>
2024-09-28 11:24:01 +08:00
<if test= "cost != null" > cost = #{cost},</if>
2024-05-23 17:24:41 +08:00
</trim>
where order_id = #{orderId}
</update>
<update id= "updateEtOrderByOrderNo" parameterType= "EtOrder" >
update et_order
<trim prefix= "SET" suffixOverrides= "," >
<if test= "areaId != null" > area_id = #{areaId},</if>
<if test= "userId != null" > user_id = #{userId},</if>
<if test= "outTradeNo != null and outTradeNo != ''" > out_trade_no = #{outTradeNo},</if>
<if test= "ruleId != null" > rule_id = #{ruleId},</if>
2024-09-04 21:45:18 +08:00
<if test= "couponId != null" > coupon_id = #{couponId},</if>
2024-09-06 17:00:13 +08:00
<if test= "logId != null" > log_id = #{logId},</if>
2024-05-23 17:24:41 +08:00
<if test= "deviceMac != null" > device_mac = #{deviceMac},</if>
<if test= "sn != null" > sn = #{sn},</if>
<if test= "payTime != null" > pay_time = #{payTime},</if>
<if test= "paid != null" > paid = #{paid},</if>
<if test= "payType != null and payType != ''" > pay_type = #{payType},</if>
<if test= "type != null" > type = #{type},</if>
<if test= "totalFee != null" > total_fee = #{totalFee},</if>
2024-06-13 17:47:25 +08:00
<if test= "payFee != null" > pay_fee = #{payFee},</if>
2024-05-23 17:24:41 +08:00
<if test= "dispatchFee != null" > dispatch_fee = #{dispatchFee},</if>
<if test= "manageFee != null" > manage_fee = #{manageFee},</if>
<if test= "ridingFee != null" > riding_fee = #{ridingFee},</if>
<if test= "appointmentFee != null" > appointment_fee = #{appointmentFee},</if>
<if test= "mark != null" > mark = #{mark},</if>
<if test= "duration != null" > duration = #{duration},</if>
<if test= "distance != null" > distance = #{distance},</if>
<if test= "status != null" > status = #{status},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
<if test= "appointmentStartTime != null" > appointment_start_time = #{appointmentStartTime},</if>
<if test= "appointmentEndTime != null" > appointment_end_time = #{appointmentEndTime},</if>
2024-06-21 11:05:38 +08:00
<if test= "appointmentTimeout != null" > appointment_timeout = #{appointmentTimeout},</if>
2024-05-23 17:24:41 +08:00
<if test= "unlockTime != null" > unlock_time = #{unlockTime},</if>
<if test= "returnTime != null" > return_time = #{returnTime},</if>
<if test= "returnType != null" > return_type = #{returnType},</if>
<if test= "tripRoute != null" > trip_route = GeomFromText(#{tripRoute}),</if>
<if test= "tripRouteStr != null" > trip_route_str = #{tripRouteStr},</if>
2024-07-03 21:18:16 +08:00
<if test= "cycle != null" > cycle = #{cycle},</if>
2024-07-13 14:12:47 +08:00
<if test= "depositDeduction != null" > deposit_deduction = #{depositDeduction},</if>
<if test= "videoUrl != null" > video_url = #{videoUrl},</if>
2024-07-20 18:34:58 +08:00
<if test= "uploadTime != null" > upload_time = #{uploadTime},</if>
2024-07-13 14:12:47 +08:00
<if test= "deductionAmount != null" > deduction_amount = #{deductionAmount},</if>
<if test= "audioFiles != null" > audio_files = #{audioFiles},</if>
2024-07-17 09:34:09 +08:00
<if test= "usedSn != null" > used_sn = #{usedSn},</if>
<if test= "changeReason != null" > change_reason = #{changeReason},</if>
2024-08-07 10:25:15 +08:00
<if test= "locking != null" > locking = #{locking},</if>
2024-09-04 08:43:06 +08:00
<if test= "autoRefundDeposit != null" > auto_refund_deposit = #{autoRefundDeposit},</if>
<if test= "freeRideTime != null" > free_ride_time = #{freeRideTime},</if>
<if test= "rentalUnit != null" > rental_unit = #{rentalUnit},</if>
<if test= "ridingRule != null" > riding_rule = #{ridingRule},</if>
<if test= "ridingRuleJson != null" > riding_rule_json = #{ridingRuleJson},</if>
<if test= "chargingCycle != null" > charging_cycle = #{chargingCycle},</if>
<if test= "chargingCycleValue != null" > charging_cycle_value = #{chargingCycleValue},</if>
<if test= "cappedAmount != null" > capped_amount = #{cappedAmount},</if>
2024-09-09 08:43:13 +08:00
<if test= "handlingCharge != null" > handling_charge = #{handlingCharge},</if>
<if test= "platformServiceFee != null" > platform_service_fee = #{platformServiceFee},</if>
<if test= "operatorDividend != null" > operator_dividend = #{operatorDividend},</if>
2024-09-14 11:24:58 +08:00
<if test= "payChannel != null" > pay_channel = #{payChannel},</if>
2024-09-28 11:24:01 +08:00
<if test= "cost != null" > cost = #{cost},</if>
2024-05-23 17:24:41 +08:00
</trim>
where order_no = #{orderNo}
</update>
<delete id= "deleteEtOrderByOrderId" parameterType= "Long" >
delete from et_order where order_id = #{orderId}
</delete>
<delete id= "deleteEtOrderByOrderIds" parameterType= "String" >
delete from et_order where order_id in
<foreach item= "orderId" collection= "array" open= "(" separator= "," close= ")" >
#{orderId}
</foreach>
</delete>
2024-06-06 22:07:28 +08:00
<delete id= "deleteEtOrderByOrderNo" parameterType= "String" >
delete from et_order where order_no = #{orderNo}
</delete>
2024-06-18 11:30:58 +08:00
2024-08-25 17:27:02 +08:00
<!-- <select id="getCurrentOrderNum" resultType="java.lang.Integer"> -->
<!-- select count(1) from et_order where sn = #{sn} and status = 2 -->
<!-- </select> -->
2024-08-28 16:47:44 +08:00
<select id= "selectToBePaidEtOrderList" resultType= "com.ruoyi.system.domain.EtOrder" >
<include refid= "selectEtOrderVoNoRoute" />
2024-10-10 10:29:26 +08:00
WHERE status = 3 AND DATE(return_time) = CURDATE()
2024-08-28 16:47:44 +08:00
</select>
2024-08-30 17:51:58 +08:00
<select id= "getCurrentOrderList" resultType= "com.ruoyi.system.domain.EtOrder" >
select order_id, area_id, order_no, sn from et_order
where status = 2
</select>
2024-09-02 10:55:31 +08:00
<select id= "deductionErrorOrderList" resultType= "com.ruoyi.system.domain.EtOrder" >
select order_id, area_id, order_no, sn,`status`,pay_type from et_order
where status = 3 and pay_type = 'yj' and pay_time is not null
</select>
2024-10-04 16:07:44 +08:00
<select id= "getTotalPaidFee" resultType= "java.math.BigDecimal" >
SELECT
total_order_fee - COALESCE(deposit_deduction_fee, 0) AS total_fee_after_deduction
FROM
(SELECT
COALESCE(SUM(pay_fee), 0) AS total_order_fee
FROM
et_order
WHERE 1=1
<if test= "channelId != 3 or (channelId == null)" > and area_id != 14 </if>
<if test= "areaId != null and areaId != 0" > and area_id = #{areaId}</if>
<if test= "channelId != null " > AND pay_channel = #{channelId}</if>
<if test= "startDateStr != null and startDateStr != ''" >
AND date_format(pay_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
</if>
<if test= "endDateStr != null and endDateStr != ''" >
AND date_format(pay_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
</if>
2024-10-10 10:29:26 +08:00
AND STATUS in (4,5)
2024-10-04 16:07:44 +08:00
AND paid = 1
AND total_fee != 0
) AS total_order,
(SELECT
COALESCE(SUM(pay_fee), 0) AS deposit_deduction_fee
FROM
et_order
WHERE 1=1
<if test= "channelId != null and channelId != 3" > and area_id != 14</if>
<if test= "areaId != null and areaId != 0" > and area_id = #{areaId}</if>
<if test= "channelId != null " > AND pay_channel = #{channelId}</if>
<if test= "startDateStr != null and startDateStr != ''" >
AND date_format(pay_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
</if>
<if test= "endDateStr != null and endDateStr != ''" >
AND date_format(pay_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
</if>
2024-10-10 10:29:26 +08:00
AND STATUS in (4,5)
2024-10-04 16:07:44 +08:00
AND type = 1
AND deposit_deduction = '1'
AND paid = 1
AND total_fee != 0
) AS deduction
</select>
<select id= "getDepositDeductionAmount" resultType= "java.math.BigDecimal" >
SELECT
2024-10-10 10:29:26 +08:00
SUM( total_amount ) AS total_sum
2024-10-04 16:07:44 +08:00
FROM
2024-10-10 10:29:26 +08:00
(
SELECT
(
o.pay_fee - COALESCE ( ref.total_refund, 0 )) AS total_amount
FROM
et_order o
LEFT JOIN ( SELECT order_no, SUM( amount ) AS total_refund FROM et_refund GROUP BY order_no ) ref ON o.order_no = ref.order_no
WHERE 1=1
<if test= "channelId != 3 or (channelId == null)" > and o.area_id != 14 </if>
<if test= "areaId != null and areaId != 0" > and o.area_id = #{areaId}</if>
<if test= "startDateStr != null and startDateStr != ''" >
AND date_format(o.pay_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
</if>
<if test= "endDateStr != null and endDateStr != ''" >
AND date_format(o.pay_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
</if>
AND o.STATUS = 4
AND o.type = 1
AND o.deposit_deduction = '1'
AND o.paid = 1
AND o.total_fee != 0
AND (
o.pay_fee - COALESCE ( ref.total_refund, 0 )) > 0
AND o.mark LIKE '%大于%' UNION ALL
SELECT
SUM( o.pay_fee - ref.amount ) AS total_amount
FROM
et_order o
LEFT JOIN et_refund ref ON o.order_no = ref.order_no
WHERE 1=1
<if test= "channelId != 3 or (channelId == null)" > and o.area_id != 14 </if>
<if test= "areaId != null and areaId != 0" > and o.area_id = #{areaId}</if>
<if test= "channelId != null " > AND o.pay_channel = #{channelId}</if>
<if test= "startDateStr != null and startDateStr != ''" >
AND date_format(ref.create_time,'%y%m%d') > = date_format(#{startDateStr},'%y%m%d')
</if>
<if test= "endDateStr != null and endDateStr != ''" >
AND date_format(ref.create_time,'%y%m%d') < = date_format(#{endDateStr},'%y%m%d')
</if>
AND o.STATUS = 4
AND o.type = 2
AND o.deposit_deduction = '1'
AND o.paid = 1
AND o.total_fee != 0
GROUP BY
o.order_no
) AS combined_amounts
2024-10-04 16:07:44 +08:00
</select>
2024-06-18 11:30:58 +08:00
2024-05-23 17:24:41 +08:00
</mapper>