订单列表
This commit is contained in:
@ -0,0 +1,216 @@
|
||||
<?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.orders.mapper.ZcOrderMainMapper">
|
||||
|
||||
<resultMap type="ZcOrderMain" id="ZcOrderMainResult">
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="orderNo" column="order_no" />
|
||||
<result property="orderStatus" column="order_status" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="storeId" column="store_id" />
|
||||
<result property="vehicleId" column="vehicle_id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="customerName" column="customer_name" />
|
||||
<result property="customerPhone" column="customer_phone" />
|
||||
<result property="rentalType" column="rental_type" />
|
||||
<result property="rentalDays" column="rental_days" />
|
||||
<result property="rentalPrice" column="rental_price" />
|
||||
<result property="depositPrice" column="deposit_price" />
|
||||
<result property="overdueFee" column="overdue_fee" />
|
||||
<result property="isDepositFree" column="is_deposit_free" />
|
||||
<result property="isAutoDeduct" column="is_auto_deduct" />
|
||||
<result property="firstOrderTime" column="first_order_time" />
|
||||
<result property="startRentTime" column="start_rent_time" />
|
||||
<result property="overdueDays" column="overdue_days" />
|
||||
<result property="renewalTimes" column="renewal_times" />
|
||||
<result property="chargeTimes" column="charge_times" />
|
||||
<result property="rentCarRuleId" column="rent_car_rule_id" />
|
||||
<result property="rentBatteyRuleId" column="rent_battey_rule_id" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ZcOrderMainZcOrderSubResult" type="ZcOrderMain" extends="ZcOrderMainResult">
|
||||
<collection property="zcOrderSubList" notNullColumn="sub_suborder_id" javaType="java.util.List" resultMap="ZcOrderSubResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="ZcOrderSub" id="ZcOrderSubResult">
|
||||
<result property="suborderId" column="sub_suborder_id" />
|
||||
<result property="orderId" column="sub_order_id" />
|
||||
<result property="suborderNo" column="sub_suborder_no" />
|
||||
<result property="suborderType" column="sub_suborder_type" />
|
||||
<result property="amount" column="sub_amount" />
|
||||
<result property="paymentMethod" column="sub_payment_method" />
|
||||
<result property="vinBatteryNo" column="sub_vin_battery_no" />
|
||||
<result property="createdAt" column="sub_created_at" />
|
||||
<result property="paymentId" column="sub_payment_id" />
|
||||
<result property="paidAt" column="sub_paid_at" />
|
||||
<result property="remark" column="sub_remark" />
|
||||
<result property="delFlag" column="sub_del_flag" />
|
||||
<result property="createTime" column="sub_create_time" />
|
||||
<result property="updateTime" column="sub_update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZcOrderMainVo">
|
||||
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, customer_id, customer_name, customer_phone, rental_type, rental_days, rental_price, deposit_price, overdue_fee, is_deposit_free, is_auto_deduct, first_order_time, start_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, del_flag, create_time, update_time from zc_order_main
|
||||
</sql>
|
||||
|
||||
<select id="selectZcOrderMainList" parameterType="ZcOrderMain" resultMap="ZcOrderMainResult">
|
||||
<include refid="selectZcOrderMainVo"/>
|
||||
<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>
|
||||
</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
|
||||
from zc_order_main a
|
||||
left join zc_order_sub b on b.order_id = a.order_id
|
||||
where a.order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
<insert id="insertZcOrderMain" parameterType="ZcOrderMain" useGeneratedKeys="true" keyProperty="orderId">
|
||||
insert into zc_order_main
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderNo != null and orderNo != ''">order_no,</if>
|
||||
<if test="orderStatus != null and orderStatus != ''">order_status,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="vehicleId != null">vehicle_id,</if>
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="customerName != null and customerName != ''">customer_name,</if>
|
||||
<if test="customerPhone != null and customerPhone != ''">customer_phone,</if>
|
||||
<if test="rentalType != null and rentalType != ''">rental_type,</if>
|
||||
<if test="rentalDays != null">rental_days,</if>
|
||||
<if test="rentalPrice != null">rental_price,</if>
|
||||
<if test="depositPrice != null">deposit_price,</if>
|
||||
<if test="overdueFee != null">overdue_fee,</if>
|
||||
<if test="isDepositFree != null">is_deposit_free,</if>
|
||||
<if test="isAutoDeduct != null">is_auto_deduct,</if>
|
||||
<if test="firstOrderTime != null">first_order_time,</if>
|
||||
<if test="startRentTime != null">start_rent_time,</if>
|
||||
<if test="overdueDays != null">overdue_days,</if>
|
||||
<if test="renewalTimes != null">renewal_times,</if>
|
||||
<if test="chargeTimes != null">charge_times,</if>
|
||||
<if test="rentCarRuleId != null">rent_car_rule_id,</if>
|
||||
<if test="rentBatteyRuleId != null">rent_battey_rule_id,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderNo != null and orderNo != ''">#{orderNo},</if>
|
||||
<if test="orderStatus != null and orderStatus != ''">#{orderStatus},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="vehicleId != null">#{vehicleId},</if>
|
||||
<if test="customerId != null">#{customerId},</if>
|
||||
<if test="customerName != null and customerName != ''">#{customerName},</if>
|
||||
<if test="customerPhone != null and customerPhone != ''">#{customerPhone},</if>
|
||||
<if test="rentalType != null and rentalType != ''">#{rentalType},</if>
|
||||
<if test="rentalDays != null">#{rentalDays},</if>
|
||||
<if test="rentalPrice != null">#{rentalPrice},</if>
|
||||
<if test="depositPrice != null">#{depositPrice},</if>
|
||||
<if test="overdueFee != null">#{overdueFee},</if>
|
||||
<if test="isDepositFree != null">#{isDepositFree},</if>
|
||||
<if test="isAutoDeduct != null">#{isAutoDeduct},</if>
|
||||
<if test="firstOrderTime != null">#{firstOrderTime},</if>
|
||||
<if test="startRentTime != null">#{startRentTime},</if>
|
||||
<if test="overdueDays != null">#{overdueDays},</if>
|
||||
<if test="renewalTimes != null">#{renewalTimes},</if>
|
||||
<if test="chargeTimes != null">#{chargeTimes},</if>
|
||||
<if test="rentCarRuleId != null">#{rentCarRuleId},</if>
|
||||
<if test="rentBatteyRuleId != null">#{rentBatteyRuleId},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZcOrderMain" parameterType="ZcOrderMain">
|
||||
update zc_order_main
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderNo != null and orderNo != ''">order_no = #{orderNo},</if>
|
||||
<if test="orderStatus != null and orderStatus != ''">order_status = #{orderStatus},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
<if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
|
||||
<if test="customerPhone != null and customerPhone != ''">customer_phone = #{customerPhone},</if>
|
||||
<if test="rentalType != null and rentalType != ''">rental_type = #{rentalType},</if>
|
||||
<if test="rentalDays != null">rental_days = #{rentalDays},</if>
|
||||
<if test="rentalPrice != null">rental_price = #{rentalPrice},</if>
|
||||
<if test="depositPrice != null">deposit_price = #{depositPrice},</if>
|
||||
<if test="overdueFee != null">overdue_fee = #{overdueFee},</if>
|
||||
<if test="isDepositFree != null">is_deposit_free = #{isDepositFree},</if>
|
||||
<if test="isAutoDeduct != null">is_auto_deduct = #{isAutoDeduct},</if>
|
||||
<if test="firstOrderTime != null">first_order_time = #{firstOrderTime},</if>
|
||||
<if test="startRentTime != null">start_rent_time = #{startRentTime},</if>
|
||||
<if test="overdueDays != null">overdue_days = #{overdueDays},</if>
|
||||
<if test="renewalTimes != null">renewal_times = #{renewalTimes},</if>
|
||||
<if test="chargeTimes != null">charge_times = #{chargeTimes},</if>
|
||||
<if test="rentCarRuleId != null">rent_car_rule_id = #{rentCarRuleId},</if>
|
||||
<if test="rentBatteyRuleId != null">rent_battey_rule_id = #{rentBatteyRuleId},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where order_id = #{orderId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZcOrderMainByOrderId" parameterType="Long">
|
||||
delete from zc_order_main where order_id = #{orderId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZcOrderMainByOrderIds" parameterType="String">
|
||||
delete from zc_order_main where order_id in
|
||||
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZcOrderSubByOrderIds" parameterType="String">
|
||||
delete from zc_order_sub where order_id in
|
||||
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZcOrderSubByOrderId" parameterType="Long">
|
||||
delete from zc_order_sub where order_id = #{orderId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchZcOrderSub">
|
||||
insert into zc_order_sub( suborder_id, order_id, suborder_no, suborder_type, amount, payment_method, vin_battery_no, created_at, payment_id, paid_at, remark, del_flag, create_time, update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.suborderId}, #{item.orderId}, #{item.suborderNo}, #{item.suborderType}, #{item.amount}, #{item.paymentMethod}, #{item.vinBatteryNo}, #{item.createdAt}, #{item.paymentId}, #{item.paidAt}, #{item.remark}, #{item.delFlag}, #{item.createTime}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,113 @@
|
||||
<?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.orders.mapper.ZcOrderSubMapper">
|
||||
|
||||
<resultMap type="ZcOrderSub" id="ZcOrderSubResult">
|
||||
<result property="suborderId" column="suborder_id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="suborderNo" column="suborder_no" />
|
||||
<result property="suborderType" column="suborder_type" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="paymentMethod" column="payment_method" />
|
||||
<result property="vinBatteryNo" column="vin_battery_no" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="paymentId" column="payment_id" />
|
||||
<result property="paidAt" column="paid_at" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZcOrderSubVo">
|
||||
select suborder_id, order_id, suborder_no, suborder_type, amount, payment_method, vin_battery_no, created_at, payment_id, paid_at, remark, del_flag, create_time, update_time from zc_order_sub
|
||||
</sql>
|
||||
|
||||
<select id="selectZcOrderSubList" parameterType="ZcOrderSub" resultMap="ZcOrderSubResult">
|
||||
<include refid="selectZcOrderSubVo"/>
|
||||
<where>
|
||||
<if test="orderId != null "> and order_id = #{orderId}</if>
|
||||
<if test="suborderNo != null and suborderNo != ''"> and suborder_no = #{suborderNo}</if>
|
||||
<if test="suborderType != null and suborderType != ''"> and suborder_type = #{suborderType}</if>
|
||||
<if test="amount != null "> and amount = #{amount}</if>
|
||||
<if test="paymentMethod != null and paymentMethod != ''"> and payment_method = #{paymentMethod}</if>
|
||||
<if test="vinBatteryNo != null and vinBatteryNo != ''"> and vin_battery_no = #{vinBatteryNo}</if>
|
||||
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
||||
<if test="paymentId != null and paymentId != ''"> and payment_id = #{paymentId}</if>
|
||||
<if test="paidAt != null "> and paid_at = #{paidAt}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZcOrderSubBySuborderId" parameterType="Long" resultMap="ZcOrderSubResult">
|
||||
<include refid="selectZcOrderSubVo"/>
|
||||
where suborder_id = #{suborderId}
|
||||
</select>
|
||||
|
||||
<insert id="insertZcOrderSub" parameterType="ZcOrderSub" useGeneratedKeys="true" keyProperty="suborderId">
|
||||
insert into zc_order_sub
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="suborderNo != null and suborderNo != ''">suborder_no,</if>
|
||||
<if test="suborderType != null and suborderType != ''">suborder_type,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="paymentMethod != null and paymentMethod != ''">payment_method,</if>
|
||||
<if test="vinBatteryNo != null and vinBatteryNo != ''">vin_battery_no,</if>
|
||||
<if test="createdAt != null">created_at,</if>
|
||||
<if test="paymentId != null and paymentId != ''">payment_id,</if>
|
||||
<if test="paidAt != null">paid_at,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="suborderNo != null and suborderNo != ''">#{suborderNo},</if>
|
||||
<if test="suborderType != null and suborderType != ''">#{suborderType},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="paymentMethod != null and paymentMethod != ''">#{paymentMethod},</if>
|
||||
<if test="vinBatteryNo != null and vinBatteryNo != ''">#{vinBatteryNo},</if>
|
||||
<if test="createdAt != null">#{createdAt},</if>
|
||||
<if test="paymentId != null and paymentId != ''">#{paymentId},</if>
|
||||
<if test="paidAt != null">#{paidAt},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZcOrderSub" parameterType="ZcOrderSub">
|
||||
update zc_order_sub
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="suborderNo != null and suborderNo != ''">suborder_no = #{suborderNo},</if>
|
||||
<if test="suborderType != null and suborderType != ''">suborder_type = #{suborderType},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="paymentMethod != null and paymentMethod != ''">payment_method = #{paymentMethod},</if>
|
||||
<if test="vinBatteryNo != null and vinBatteryNo != ''">vin_battery_no = #{vinBatteryNo},</if>
|
||||
<if test="createdAt != null">created_at = #{createdAt},</if>
|
||||
<if test="paymentId != null and paymentId != ''">payment_id = #{paymentId},</if>
|
||||
<if test="paidAt != null">paid_at = #{paidAt},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where suborder_id = #{suborderId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZcOrderSubBySuborderId" parameterType="Long">
|
||||
delete from zc_order_sub where suborder_id = #{suborderId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZcOrderSubBySuborderIds" parameterType="String">
|
||||
delete from zc_order_sub where suborder_id in
|
||||
<foreach item="suborderId" collection="array" open="(" separator="," close=")">
|
||||
#{suborderId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user