|
@@ -86,4 +86,106 @@
|
|
|
LIMIT ${startRecord}, ${pageSize}
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 获得流水单上报总数 -->
|
|
|
+ <select id="getEscalationCountByCondition" parameterType="Map" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(f.id)
|
|
|
+ FROM hy_freight_settlement_info f
|
|
|
+ LEFT JOIN common_user c on f.common_id = c.id and c.delete_flag = 0 and c.identification = '1'
|
|
|
+ WHERE
|
|
|
+ f.delete_flag = '0'
|
|
|
+ <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
+ AND (lower(f.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(f.order_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(c.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
+ </if>
|
|
|
+ <if test="searchType != null and searchType != ''">
|
|
|
+ <if test="searchType == 1">
|
|
|
+ AND f.escalation_status_key = '1'
|
|
|
+ OR f.escalation_status_key = '3'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 2">
|
|
|
+ AND f.escalation_status_key = '5'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 3">
|
|
|
+ AND f.escalation_status_key = '7'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 4">
|
|
|
+ AND f.escalation_status_key = '9'
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ AND (DATE_FORMAT(f.payment_date,"%Y%m%d") >=
|
|
|
+ DATE_FORMAT(#{startDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ AND (DATE_FORMAT(f.payment_date,"%Y%m%d") <=
|
|
|
+ DATE_FORMAT(#{endDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 流水单上报列表查询 -->
|
|
|
+ <select id="getEscalationListByCondition" parameterType="Map"
|
|
|
+ resultType="com.yh.saas.plugin.yiliangyiyun.entity.HyFreightSettlementInfo">
|
|
|
+ SELECT
|
|
|
+ f.id,
|
|
|
+ f.order_id as orderId,
|
|
|
+ f.order_no as orderNo,
|
|
|
+ f.freight_advance as freightAdvance,
|
|
|
+ f.driver_name as driverName,
|
|
|
+ c.phone as driverPhone,
|
|
|
+ f.bank_card as bankCard,
|
|
|
+ f.bank_deposit as bankDeposit,
|
|
|
+ f.bank_deposit_branch as bankDepositBranch,
|
|
|
+ f.payment_type as paymentType,
|
|
|
+ f.amount_money as amountMoney,
|
|
|
+ f.payment_date as paymentDate,
|
|
|
+ f.status_key as statusKey,
|
|
|
+ f.status,
|
|
|
+ f.escalation_status_key as escalationStatusKey,
|
|
|
+ f.escalation_status as escalationStatus,
|
|
|
+ f.escalation_failure_reason as escalationFailureReason,
|
|
|
+ f.serial_number as serialNumber,
|
|
|
+ f.arrival_date as arrivalDate,
|
|
|
+ f.payment_voucher as paymentVoucher,
|
|
|
+ f.create_date as createDate
|
|
|
+ FROM hy_freight_settlement_info f
|
|
|
+ LEFT JOIN common_user c on f.common_id = c.id and c.delete_flag = 0 and c.identification = '1'
|
|
|
+ WHERE
|
|
|
+ f.delete_flag = '0'
|
|
|
+ <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
+ AND (lower(f.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(f.order_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(c.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
+ </if>
|
|
|
+ <if test="searchType != null and searchType != ''">
|
|
|
+ <if test="searchType == 1">
|
|
|
+ AND f.escalation_status_key = '1'
|
|
|
+ OR f.escalation_status_key = '3'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 2">
|
|
|
+ AND f.escalation_status_key = '5'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 3">
|
|
|
+ AND f.escalation_status_key = '7'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 4">
|
|
|
+ AND f.escalation_status_key = '9'
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ AND (DATE_FORMAT(f.payment_date,"%Y%m%d") >=
|
|
|
+ DATE_FORMAT(#{startDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ AND (DATE_FORMAT(f.payment_date,"%Y%m%d") <=
|
|
|
+ DATE_FORMAT(#{endDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ ORDER BY f.payment_date DESC
|
|
|
+ <if test="currentPage != null and currentPage != ''">
|
|
|
+ LIMIT ${startRecord}, ${pageSize}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|