|
|
@@ -46,16 +46,15 @@
|
|
|
<resultMap id="offlinePayments" type="com.pine.admin.modules.business.entity.CarOrder" extends="entityMap">
|
|
|
|
|
|
<association property="offlinePayments"
|
|
|
- javaType="com.pine.admin.modules.business.entity.OfflinePayments"
|
|
|
- select="com.pine.admin.modules.business.dao.OfflinePaymentsDao.queryOne"
|
|
|
- column="{ carOrderId = id }"/>
|
|
|
+ javaType="com.pine.admin.modules.business.entity.OfflinePayments"
|
|
|
+ select="com.pine.admin.modules.business.dao.OfflinePaymentsDao.queryOne"
|
|
|
+ column="{ carOrderId = id }"/>
|
|
|
|
|
|
<association property="isRefund"
|
|
|
javaType="java.lang.Integer"
|
|
|
select="com.pine.admin.modules.business.dao.CarBackOrderDao.isRefund"
|
|
|
column="{ orderId = id }"/>
|
|
|
</resultMap>
|
|
|
-
|
|
|
<sql id="Base_Column_List">
|
|
|
id,
|
|
|
code,
|
|
|
@@ -93,6 +92,45 @@
|
|
|
url,
|
|
|
cancel_reason,
|
|
|
is_send </sql>
|
|
|
+ <sql id="lco_Column_sql">
|
|
|
+ lco.id id,
|
|
|
+ lco.code code,
|
|
|
+ lco.customer_id customer_id,
|
|
|
+ lco.pay_type pay_type,
|
|
|
+ lco.status status,
|
|
|
+ lco.loan_status loan_status,
|
|
|
+ lco.is_use is_use,
|
|
|
+ lco.car_id car_id,
|
|
|
+ lco.car_json car_json,
|
|
|
+ lco.picked_car_information picked_car_information,
|
|
|
+ lco.loan_instalment_count loan_instalment_count,
|
|
|
+ lco.loan_rate loan_rate,
|
|
|
+ lco.down_payment_rate down_payment_rate,
|
|
|
+ lco.real_down_payment_rate real_down_payment_rate,
|
|
|
+ lco.total_price total_price,
|
|
|
+ lco.deposit_price deposit_price,
|
|
|
+ lco.final_payment_price final_payment_price,
|
|
|
+ lco.down_payment_price down_payment_price,
|
|
|
+ lco.real_down_payment_price real_down_payment_price,
|
|
|
+ lco.loan_price loan_price,
|
|
|
+ lco.monthly_installment_payment_price monthly_installment_payment_price,
|
|
|
+ lco.name name,
|
|
|
+ lco.mobile mobile,
|
|
|
+ lco.id_card id_card,
|
|
|
+ lco.pick_city pick_city,
|
|
|
+ lco.car_supplier car_supplier,
|
|
|
+ lco.car_supplier_no car_supplier_no,
|
|
|
+ lco.create_time create_time,
|
|
|
+ lco.order_cancel_time order_cancel_time,
|
|
|
+ lco.pay_deposit_time pay_deposit_time,
|
|
|
+ lco.online_audit_time online_audit_time,
|
|
|
+ lco.offline_audit_time offline_audit_time,
|
|
|
+ lco.order_finish_time order_finish_time,
|
|
|
+ lco.url url,
|
|
|
+ lco.cancel_reason cancel_reason,
|
|
|
+
|
|
|
+
|
|
|
+ </sql>
|
|
|
<!-- 根据Id查询-->
|
|
|
<select id="selectByPrimaryKey" resultMap="entityMap" parameterType="java.lang.Integer">
|
|
|
select
|
|
|
@@ -235,14 +273,13 @@
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
- <!-- 分页查询-->
|
|
|
+ <!-- 线上支付分页查询-->
|
|
|
<select id="queryByPage" parameterType="java.util.Map"
|
|
|
resultMap="offlinePayments">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>
|
|
|
from ls_car_order
|
|
|
<where>
|
|
|
-
|
|
|
<if test="record.id != null and !"".equals(record.id)">
|
|
|
and id = #{record.id}
|
|
|
</if>
|
|
|
@@ -351,12 +388,125 @@
|
|
|
<if test="record.isSend != null and !"".equals(record.isSend)">
|
|
|
and is_send = #{record.isSend}
|
|
|
</if>
|
|
|
- and loan_status != 2
|
|
|
+ <if test="record.offlinePayType == 2">
|
|
|
+ and status = 3
|
|
|
+ </if>
|
|
|
+ and loan_status != 2
|
|
|
and status != 1
|
|
|
</where>
|
|
|
order by id desc
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 查询未支付和线下支付的 -->
|
|
|
+ <select id="queryOfflineByPage" parameterType="java.util.Map"
|
|
|
+ resultMap="offlinePayments">
|
|
|
+ select
|
|
|
+ lco.*
|
|
|
+ from ls_car_order lco
|
|
|
+ LEFT JOIN ls_offline_payments lof ON lco.id = lof.car_order_id
|
|
|
+ <where>
|
|
|
+ <if test="record.code != null and !"".equals(record.code)">
|
|
|
+ and lco.code = #{record.code}
|
|
|
+ </if>
|
|
|
+ <if test="record.customerId != null and !"".equals(record.customerId)">
|
|
|
+ and lco.customer_id = #{record.customerId}
|
|
|
+ </if>
|
|
|
+ <if test="record.payType != null and !"".equals(record.payType)">
|
|
|
+ and lco.pay_type = #{record.payType}
|
|
|
+ </if>
|
|
|
+ <if test="record.status != null and !"".equals(record.status)">
|
|
|
+ and lco.status = #{record.status}
|
|
|
+ </if>
|
|
|
+ <if test="record.loanStatus != null and !"".equals(record.loanStatus)">
|
|
|
+ and lco.loan_status = #{record.loanStatus}
|
|
|
+ </if>
|
|
|
+ <if test="record.isUse != null and !"".equals(record.isUse)">
|
|
|
+ and lco.is_use = #{record.isUse}
|
|
|
+ </if>
|
|
|
+ <if test="record.carId != null and !"".equals(record.carId)">
|
|
|
+ and lco.car_id = #{record.carId}
|
|
|
+ </if>
|
|
|
+ <if test="record.carJson != null and !"".equals(record.carJson)">
|
|
|
+ and lco.car_json = #{record.carJson}
|
|
|
+ </if>
|
|
|
+ <if test="record.pickedCarInformation != null and !"".equals(record.pickedCarInformation)">
|
|
|
+ and lco.picked_car_information = #{record.pickedCarInformation}
|
|
|
+ </if>
|
|
|
+ <if test="record.loanInstalmentCount != null and !"".equals(record.loanInstalmentCount)">
|
|
|
+ and lco.loan_instalment_count = #{record.loanInstalmentCount}
|
|
|
+ </if>
|
|
|
+ <if test="record.loanRate != null and !"".equals(record.loanRate)">
|
|
|
+ and lco.loan_rate = #{record.loanRate}
|
|
|
+ </if>
|
|
|
+ <if test="record.downPaymentRate != null and !"".equals(record.downPaymentRate)">
|
|
|
+ and lco.down_payment_rate = #{record.downPaymentRate}
|
|
|
+ </if>
|
|
|
+ <if test="record.realDownPaymentRate != null and !"".equals(record.realDownPaymentRate)">
|
|
|
+ and lco.real_down_payment_rate = #{record.realDownPaymentRate}
|
|
|
+ </if>
|
|
|
+ <if test="record.totalPrice != null and !"".equals(record.totalPrice)">
|
|
|
+ and lco.total_price = #{record.totalPrice}
|
|
|
+ </if>
|
|
|
+ <if test="record.depositPrice != null and !"".equals(record.depositPrice)">
|
|
|
+ and lco.deposit_price = #{record.depositPrice}
|
|
|
+ </if>
|
|
|
+ <if test="record.finalPaymentPrice != null and !"".equals(record.finalPaymentPrice)">
|
|
|
+ and lco.final_payment_price = #{record.finalPaymentPrice}
|
|
|
+ </if>
|
|
|
+ <if test="record.downPaymentPrice != null and !"".equals(record.downPaymentPrice)">
|
|
|
+ and lco.down_payment_price = #{record.downPaymentPrice}
|
|
|
+ </if>
|
|
|
+ <if test="record.realDownPaymentPrice != null and !"".equals(record.realDownPaymentPrice)">
|
|
|
+ and lco.real_down_payment_price = #{record.realDownPaymentPrice}
|
|
|
+ </if>
|
|
|
+ <if test="record.loanPrice != null and !"".equals(record.loanPrice)">
|
|
|
+ and lco.loan_price = #{record.loanPrice}
|
|
|
+ </if>
|
|
|
+ <if test="record.monthlyInstallmentPaymentPrice != null and !"".equals(record.monthlyInstallmentPaymentPrice)">
|
|
|
+ and lco.monthly_installment_payment_price = #{record.monthlyInstallmentPaymentPrice}
|
|
|
+ </if>
|
|
|
+ <if test="record.name != null and !"".equals(record.name)">
|
|
|
+ and lco.name = #{record.name}
|
|
|
+ </if>
|
|
|
+ <if test="record.mobile != null and !"".equals(record.mobile)">
|
|
|
+ and lco.mobile = #{record.mobile}
|
|
|
+ </if>
|
|
|
+ <if test="record.idCard != null and !"".equals(record.idCard)">
|
|
|
+ and lco.id_card = #{record.idCard}
|
|
|
+ </if>
|
|
|
+ <if test="record.pickCity != null and !"".equals(record.pickCity)">
|
|
|
+ and lco.pick_city = #{record.pickCity}
|
|
|
+ </if>
|
|
|
+ <if test="record.carSupplier != null and !"".equals(record.carSupplier)">
|
|
|
+ and lco.car_supplier = #{record.carSupplier}
|
|
|
+ </if>
|
|
|
+ <if test="record.carSupplierNo != null and !"".equals(record.carSupplierNo)">
|
|
|
+ and lco.car_supplier_no = #{record.carSupplierNo}
|
|
|
+ </if>
|
|
|
+ <if test="record.cancelReason != null and !"".equals(record.cancelReason)">
|
|
|
+ and lco.cancel_reason = #{record.cancelReason}
|
|
|
+ </if>
|
|
|
+ <if test="record.isSend != null and !"".equals(record.isSend)">
|
|
|
+ and lco.is_send = #{record.isSend}
|
|
|
+ </if>
|
|
|
+ <if test="record.offlinePayType == 2 ">
|
|
|
+ and lof.car_order_id is null
|
|
|
+ and lco.status = 3
|
|
|
+ </if>
|
|
|
+ <if test="record.offlinePayType == 1">
|
|
|
+ and lof.car_order_id is not null
|
|
|
+ </if>
|
|
|
+ <if test="record.offlinePayType == 3">
|
|
|
+ and lof.car_order_id is null
|
|
|
+ AND lco.status !=3
|
|
|
+ </if>
|
|
|
+
|
|
|
+ and lco.loan_status != 2
|
|
|
+ and lco.status != 1
|
|
|
+ </where>
|
|
|
+ order by lco.id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 全部查询 -->
|
|
|
<select id="queryAll" parameterType="java.util.Map"
|
|
|
resultMap="entityMap">
|