订单详情

This commit is contained in:
19173159168
2025-07-24 22:54:09 +08:00
parent 769a0609d5
commit 5307fc54eb
4 changed files with 96 additions and 103 deletions

View File

@ -31,6 +31,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="operatorName" column="operator_name" />
<result property="storeName" column="store_name" />
<result property="licensePlate" column="license_plate" />
</resultMap>
<resultMap id="ZcOrderMainZcOrderSubResult" type="ZcOrderMain" extends="ZcOrderMainResult">
@ -59,37 +62,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectZcOrderMainList" parameterType="ZcOrderMain" resultMap="ZcOrderMainResult">
<include refid="selectZcOrderMainVo"/>
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.customer_id, a.customer_name, a.customer_phone, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.start_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.del_flag, a.create_time, a.update_time,
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate
from zc_order_main a
left join zc_company c on c.id = a.operator_id
left join zc_company_store s on s.id = a.store_id
left join zc_car zc on zc.id = a.vehicle_id
<where>
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
<if test="operatorId != null "> and operator_id = #{operatorId}</if>
<if test="storeId != null "> and store_id = #{storeId}</if>
<if test="vehicleId != null "> and vehicle_id = #{vehicleId}</if>
<if test="customerId != null "> and customer_id = #{customerId}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="customerPhone != null and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
<if test="rentalType != null and rentalType != ''"> and rental_type = #{rentalType}</if>
<if test="rentalDays != null "> and rental_days = #{rentalDays}</if>
<if test="rentalPrice != null "> and rental_price = #{rentalPrice}</if>
<if test="depositPrice != null "> and deposit_price = #{depositPrice}</if>
<if test="overdueFee != null "> and overdue_fee = #{overdueFee}</if>
<if test="isDepositFree != null "> and is_deposit_free = #{isDepositFree}</if>
<if test="isAutoDeduct != null "> and is_auto_deduct = #{isAutoDeduct}</if>
<if test="firstOrderTime != null "> and first_order_time = #{firstOrderTime}</if>
<if test="startRentTime != null "> and start_rent_time = #{startRentTime}</if>
<if test="overdueDays != null "> and overdue_days = #{overdueDays}</if>
<if test="renewalTimes != null "> and renewal_times = #{renewalTimes}</if>
<if test="chargeTimes != null "> and charge_times = #{chargeTimes}</if>
<if test="rentCarRuleId != null "> and rent_car_rule_id = #{rentCarRuleId}</if>
<if test="rentBatteyRuleId != null "> and rent_battey_rule_id = #{rentBatteyRuleId}</if>
<if test="orderNo != null and orderNo != ''"> and a.order_no = #{orderNo}</if>
<if test="orderStatus != null and orderStatus != ''"> and a.order_status = #{orderStatus}</if>
<if test="operatorId != null "> and a.operator_id = #{operatorId}</if>
<if test="storeId != null "> and a.store_id = #{storeId}</if>
<if test="vehicleId != null "> and a.vehicle_id = #{vehicleId}</if>
<if test="customerId != null "> and a.customer_id = #{customerId}</if>
<if test="customerName != null and customerName != ''"> and a.customer_name like concat('%', #{customerName}, '%')</if>
<if test="customerPhone != null and customerPhone != ''"> and a.customer_phone = #{customerPhone}</if>
<if test="rentalType != null and rentalType != ''"> and a.rental_type = #{rentalType}</if>
<if test="rentalDays != null "> and a.rental_days = #{rentalDays}</if>
<if test="rentalPrice != null "> and a.rental_price = #{rentalPrice}</if>
<if test="depositPrice != null "> and a.deposit_price = #{depositPrice}</if>
<if test="overdueFee != null "> and a.overdue_fee = #{overdueFee}</if>
<if test="isDepositFree != null "> and a.is_deposit_free = #{isDepositFree}</if>
<if test="isAutoDeduct != null "> and a.is_auto_deduct = #{isAutoDeduct}</if>
<if test="firstOrderTime != null "> and a.first_order_time = #{firstOrderTime}</if>
<if test="startRentTime != null "> and a.start_rent_time = #{startRentTime}</if>
<if test="overdueDays != null "> and a.overdue_days = #{overdueDays}</if>
<if test="renewalTimes != null "> and a.renewal_times = #{renewalTimes}</if>
<if test="chargeTimes != null "> and a.charge_times = #{chargeTimes}</if>
<if test="rentCarRuleId != null "> and a.rent_car_rule_id = #{rentCarRuleId}</if>
<if test="rentBatteyRuleId != null "> and a.rent_battey_rule_id = #{rentBatteyRuleId}</if>
</where>
</select>
<select id="selectZcOrderMainByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderSubResult">
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.customer_id, a.customer_name, a.customer_phone, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.start_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.del_flag, a.create_time, a.update_time,
b.suborder_id as sub_suborder_id, b.order_id as sub_order_id, b.suborder_no as sub_suborder_no, b.suborder_type as sub_suborder_type, b.amount as sub_amount, b.payment_method as sub_payment_method, b.vin_battery_no as sub_vin_battery_no, b.created_at as sub_created_at, b.payment_id as sub_payment_id, b.paid_at as sub_paid_at, b.remark as sub_remark, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time
b.suborder_id as sub_suborder_id, b.order_id as sub_order_id, b.suborder_no as sub_suborder_no, b.suborder_type as sub_suborder_type, b.amount as sub_amount, b.payment_method as sub_payment_method, b.vin_battery_no as sub_vin_battery_no, b.created_at as sub_created_at, b.payment_id as sub_payment_id, b.paid_at as sub_paid_at, b.remark as sub_remark, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time,
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate
from zc_order_main a
left join zc_company c on c.id = a.operator_id
left join zc_company_store s on s.id = a.store_id
left join zc_car zc on zc.id = a.vehicle_id
left join zc_order_sub b on b.order_id = a.order_id
where a.order_id = #{orderId}
</select>