haungfuli 2 年之前
父節點
當前提交
1600a84d38
共有 12 個文件被更改,包括 335 次插入11 次删除
  1. 13 5
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/FreightInfoController.java
  2. 12 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/HyFreightSettlementInfoController.java
  3. 34 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FreightInfo.java
  4. 1 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyFreightSettlementInfo.java
  5. 2 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/OrderInfo.java
  6. 19 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/FreightInfoMapper.java
  7. 9 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IFreightInfoService.java
  8. 8 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IHyFreightSettlementInfoService.java
  9. 26 3
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FreightInfoServiceImpl.java
  10. 62 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyFreightSettlementInfoServiceImpl.java
  11. 47 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FreightInfoMapper.xml
  12. 102 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/HyFreightSettlementInfoMapper.xml

+ 13 - 5
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/FreightInfoController.java

@@ -5,13 +5,10 @@ import com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo;
 import com.yh.saas.plugin.yiliangyiyun.service.IFreightInfoService;
 import com.yh.saas.plugin.yiliangyiyun.util.Log;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.text.ParseException;
+import java.util.List;
 
 /**
  * <p>
@@ -49,5 +46,16 @@ public class FreightInfoController {
     public String balance (@RequestBody  FreightInfo freightInfo) throws ParseException{
         return freightInfoService.balance(freightInfo);
     }
+
+    /**
+     * 后台管理统计报表利润图表
+     * @param freightInfo
+     * @return
+     */
+    @Log(title = "统计报表利润图表")
+    @GetMapping("/selectProfit")
+    public FreightInfo selectProfit(FreightInfo freightInfo){
+        return freightInfoService.selectProfit(freightInfo);
+    }
 }
 

+ 12 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/HyFreightSettlementInfoController.java

@@ -96,5 +96,17 @@ public class HyFreightSettlementInfoController {
     public String batchSubmission(@RequestBody HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException {
         return hyFreightSettlementInfoService.batchSubmission(hyFreightSettlementInfo);
     }
+
+    /**
+     * 流水单查看
+     *
+     * @param
+     * @return
+     */
+    @Log(title = "查看流水单详情")
+    @GetMapping("/getHyFreightSettlementInfo")
+    public HyFreightSettlementInfo getHyFreightSettlementInfo(HyFreightSettlementInfo hyFreightSettlementInfo){
+        return hyFreightSettlementInfoService.getHyFreightSettlementInfo(hyFreightSettlementInfo);
+    }
 }
 

+ 34 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FreightInfo.java

@@ -1,5 +1,6 @@
 package com.yh.saas.plugin.yiliangyiyun.entity;
 
+import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
 import com.baomidou.mybatisplus.enums.IdType;
@@ -12,6 +13,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -108,6 +110,38 @@ public class FreightInfo extends BaseModel<FreightInfo> {
      * 货主合计付款
      */
     private Double totalPayment;
+    /**
+     * 利润(元)
+     */
+    private Double profit;
+    /**
+     * 利润生成时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date profitDate;
+
+
+    /**
+     * 1按天2按月3按年
+     */
+    @TableField(exist = false)
+    private String searchType;
+    /**
+     * 年份
+     */
+    @TableField(exist = false)
+    private String year;
+    /**
+     *柱形图
+     */
+    @TableField(exist = false)
+    private List<FreightInfo> dataList;
+    /**
+     *表格
+     */
+    @TableField(exist = false)
+    private List<FreightInfo> formList;
 
 
     @Override

+ 1 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyFreightSettlementInfo.java

@@ -127,6 +127,7 @@ public class HyFreightSettlementInfo extends BaseModel<HyFreightSettlementInfo>
     private String searchKeyWord;
     /**
      * 查询类型(1待支付2已支付3暂缓中)
+     * 上报列表(1待上报2审核中3已通过4暂缓中)
      */
     @TableField(exist = false)
     private String searchType;

+ 2 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/OrderInfo.java

@@ -304,7 +304,7 @@ public class OrderInfo extends BaseModel<OrderInfo> {
     @TableField(exist = false)
     @JsonFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date startDate;
+    private String startDate;
 
     /**
      * 结束时间
@@ -312,7 +312,7 @@ public class OrderInfo extends BaseModel<OrderInfo> {
     @TableField(exist = false)
     @JsonFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date endDate;
+    private String endDate;
 
     /**
      * 模糊查询

+ 19 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/FreightInfoMapper.java

@@ -1,8 +1,12 @@
 package com.yh.saas.plugin.yiliangyiyun.mapper;
 
+import com.yh.saas.plugin.yiliangyiyun.entity.FleetInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 运费信息 Mapper 接口
@@ -13,4 +17,19 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
  */
 public interface FreightInfoMapper extends BaseMapper<FreightInfo> {
 
+    /**
+     * 根据条件查询利润柱形图
+     *
+     * @param pageView
+     * @return
+     */
+    List<FreightInfo> getListByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询利润表格
+     *
+     * @param pageView
+     * @return
+     */
+    List<FreightInfo> getFormListByCondition(Map<String, Object> pageView);
 }

+ 9 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IFreightInfoService.java

@@ -4,6 +4,7 @@ import com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo;
 import com.baomidou.mybatisplus.service.IService;
 
 import java.text.ParseException;
+import java.util.List;
 
 /**
  * <p>
@@ -28,4 +29,12 @@ public interface IFreightInfoService extends IService<FreightInfo> {
      * @return
      */
     String balance (FreightInfo freightInfo) throws ParseException;
+
+
+    /**
+     * 后台管理统计报表利润图表
+     * @param freightInfo
+     * @return
+     */
+    FreightInfo selectProfit(FreightInfo freightInfo);
 }

+ 8 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IHyFreightSettlementInfoService.java

@@ -63,4 +63,12 @@ public interface IHyFreightSettlementInfoService extends IService<HyFreightSettl
      * @return
      */
     String batchSubmission(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException ;
+
+    /**
+     * 流水单查看
+     *
+     * @param hyFreightSettlementInfo
+     * @return
+     */
+    HyFreightSettlementInfo getHyFreightSettlementInfo(HyFreightSettlementInfo hyFreightSettlementInfo);
 }

+ 26 - 3
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FreightInfoServiceImpl.java

@@ -3,6 +3,7 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.plugin.yiliangyiyun.entity.*;
+import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView;
 import com.yh.saas.plugin.yiliangyiyun.exception.YException;
 import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.FreightInfoMapper;
@@ -15,9 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * <p>
@@ -41,6 +40,28 @@ public class FreightInfoServiceImpl extends ServiceImpl<FreightInfoMapper, Freig
     @Autowired
     private ICargoOwnerInfoService cargoOwnerInfoService;
 
+
+    /**
+     * 后台管理统计报表利润图表
+     * @param freightInfo
+     * @return
+     */
+    @Override
+    public FreightInfo selectProfit(FreightInfo freightInfo){
+        FreightInfo freightInfo1 = new FreightInfo();
+        Map<String, Object> pageView = new HashMap<>();
+        //类型
+        pageView.put("searchType", freightInfo.getSearchType());
+        pageView.put("year", freightInfo.getYear());
+//        List<FreightInfo> dataList = baseMapper.getListByCondition(pageView);
+//        freightInfo1.setDataList(dataList);
+        List<FreightInfo> formList = baseMapper.getFormListByCondition(pageView);
+        freightInfo1.setFormList(formList);
+        return freightInfo1;
+    }
+
+
+
     /**
      * 预付
      *
@@ -174,4 +195,6 @@ public class FreightInfoServiceImpl extends ServiceImpl<FreightInfoMapper, Freig
 //        //查询费用信息
 //        List<FreightInfo> freightInfoList = this.selectList(new EntityWrapper<FreightInfo>().eq("delete_flag","0"));
 //    }
+
+
 }

+ 62 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyFreightSettlementInfoServiceImpl.java

@@ -242,9 +242,13 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                         //尾款
                         freightInfo.setFreightBalance(hyFreightSettlementInfo1.getAmountMoney());
                         freightInfo.setFreightBalanceDate(new Date());
+                        freightInfo.setOwnerFreightBalance(freightInfo.getFreightBalance() + freightInfo.getDriverServiceCharge());
+                        freightInfo.setOwnerFreightBalanceDate(new Date());
                         Double d = freightInfo.getPayabledFreight();
                         freightInfo.setPayabledFreight(d + hyFreightSettlementInfo1.getAmountMoney());
                         freightInfo.setNopayableFreight(freightInfo.getPayableFreight() - freightInfo.getPayabledFreight());
+                        freightInfo.setProfit(freightInfo.getReceivableFreight()-freightInfo.getPayableFreight());
+                        freightInfo.setProfitDate(new Date());
                         //修改订单运费
                         if (orderInfo1 != null) {
                             orderInfo1.setFreight(freightInfo.getPrepaidFreight() + freightInfo.getFreightBalance());
@@ -279,13 +283,19 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                 //查询银行key值
                 HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
                         .eq("const_id", "BANK1").eq("const_value", orderInfo1.getBankDeposit()));
-                hyFreightSettlementInfo1.setBankKey(hyCommonSysParameter.getConstKey());
+                if (hyCommonSysParameter == null){
+                    hyFreightSettlementInfo1.setBankKey("9999");
+                }else {
+                    hyFreightSettlementInfo1.setBankKey(hyCommonSysParameter.getConstKey());
+                }
                 //上报
                 String token = EntityAnalyse.GetJTToken();
                 hyFreightSettlementInfo1.setToken(token);
                 EntityAnalyse.uploadFlowSheet(hyFreightSettlementInfo1);
                 //编辑信息
                 this.updateById(hyFreightSettlementInfo1);
+                //修改运费信息
+                freightInfoService.updateById(freightInfo);
             }
             return "ok";
         }
@@ -355,6 +365,26 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
         String token = EntityAnalyse.GetJTToken();
         if (CollectionUtils.isNotEmpty(hyFreightSettlementInfo.getHyFreightSettlementInfos())){
             for (HyFreightSettlementInfo hyFreightSettlementInfo1 : hyFreightSettlementInfo.getHyFreightSettlementInfos()){
+                //查询上报所需信息
+                //查询订单
+                OrderInfo orderInfo1 = orderInfoService.selectById(hyFreightSettlementInfo1.getOrderId());
+                //司机信息
+                HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
+                        .eq("common_id",hyFreightSettlementInfo1.getCommonId()).eq("delete_flag","0"));
+                hyFreightSettlementInfo1.setDriverIdCard(hyDriverInfo.getNumberCard());
+                hyFreightSettlementInfo1.setDriverSex(hyDriverInfo.getDriverSex());
+                hyFreightSettlementInfo1.setDriverBirthday(hyDriverInfo.getDriverBirthday());
+                hyFreightSettlementInfo1.setDriverPhone(hyDriverInfo.getDriverPhone());
+                hyFreightSettlementInfo1.setDriverAddress(hyDriverInfo.getCardAddress());
+                //车辆信息
+                HyDriverCarInfo hyDriverCarInfo = driverCarInfoService.selectOne(new EntityWrapper<HyDriverCarInfo>()
+                        .eq("car_number",orderInfo1.getCarNumber()).eq("delete_flag","0"));
+                hyFreightSettlementInfo1.setCarNumber(hyDriverCarInfo.getCarNumber());
+                hyFreightSettlementInfo1.setCarNumberColour(hyDriverCarInfo.getCarNumberColour());
+                //查询银行key值
+                HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
+                        .eq("const_id", "BANK1").eq("const_value", orderInfo1.getBankDeposit()));
+                hyFreightSettlementInfo1.setBankKey(hyCommonSysParameter.getConstKey());
                 //上报
                 hyFreightSettlementInfo1.setToken(token);
                 EntityAnalyse.uploadFlowSheet(hyFreightSettlementInfo1);
@@ -366,4 +396,35 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
         }
         return "ok";
     }
+
+    /**
+     * 流水单查看
+     * @param hyFreightSettlementInfo
+     * @return
+     * @throws IOException
+     * @throws ParseException
+     */
+    @Override
+    public HyFreightSettlementInfo getHyFreightSettlementInfo(HyFreightSettlementInfo hyFreightSettlementInfo){
+        //查询流水单信息
+        HyFreightSettlementInfo hyFreightSettlementInfo1 = this.selectById(hyFreightSettlementInfo.getId());
+        //查询订单
+        OrderInfo orderInfo1 = orderInfoService.selectById(hyFreightSettlementInfo1.getOrderId());
+        //司机信息
+        HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
+                .eq("common_id",hyFreightSettlementInfo1.getCommonId()).eq("delete_flag","0"));
+        hyFreightSettlementInfo1.setDriverIdCard(hyDriverInfo.getNumberCard());
+        hyFreightSettlementInfo1.setDriverSex(hyDriverInfo.getDriverSex());
+        hyFreightSettlementInfo1.setDriverBirthday(hyDriverInfo.getDriverBirthday());
+        hyFreightSettlementInfo1.setDriverPhone(hyDriverInfo.getDriverPhone());
+        hyFreightSettlementInfo1.setDriverAddress(hyDriverInfo.getCardAddress());
+        //车辆信息
+        HyDriverCarInfo hyDriverCarInfo = driverCarInfoService.selectOne(new EntityWrapper<HyDriverCarInfo>()
+                .eq("car_number",orderInfo1.getCarNumber()).eq("delete_flag","0"));
+        if (hyDriverCarInfo != null){
+            hyFreightSettlementInfo1.setCarNumber(hyDriverCarInfo.getCarNumber());
+            hyFreightSettlementInfo1.setCarNumberColour(hyDriverCarInfo.getCarNumberColour());
+        }
+        return hyFreightSettlementInfo1;
+    }
 }

+ 47 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FreightInfoMapper.xml

@@ -2,4 +2,51 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.FreightInfoMapper">
 
+    <!-- 根据条件查询利润表格 -->
+    <select id="getFormListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo">
+        <if test="year != null and year != ''">
+            SELECT
+            SUM(case month(profit_date) when '1' then profit else 0 end)/10000 AS Jan,
+            SUM(case month(profit_date) when '2' then profit else 0 end)/10000 AS Feb,
+            SUM(case month(profit_date) when '3' then profit else 0 end)/10000 AS Mar,
+            SUM(case month(profit_date) when '4' then profit else 0 end)/10000 AS Apr,
+            SUM(case month(profit_date) when '5' then profit else 0 end)/10000 AS May,
+            SUM(case month(profit_date) when '6' then profit else 0 end)/10000 AS June,
+            SUM(case month(profit_date) when '7' then profit else 0 end)/10000 AS July,
+            SUM(case month(profit_date) when '8' then profit else 0 end)/10000 AS Aug,
+            SUM(case month(profit_date) when '9' then profit else 0 end)/10000 AS Sept,
+            SUM(case month(profit_date) when '10' then profit else 0 end)/10000 AS Oct,
+            SUM(case month(profit_date) when '11' then profit else 0 end)/10000 AS Nov,
+            SUM(case month(profit_date) when '12' then profit else 0 end)/10000 AS Dece,
+            SUM(profit)/10000 AS total
+            FROM
+            hy_freight_info
+            WHERE
+            year(profit_date) = #{year}
+        </if>
+    </select>
+
+    <!-- 根据条件查询利润柱形图 -->
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo">
+        <if test="year != null and year != ''">
+            <if test="searchType == 1">
+                SELECT IFNULL(SUM(b.profit)/10000, 0 ) profit, aa.date create_date
+                FROM (SELECT @cdate := date_add( @cdate, INTERVAL - 1 DAY ) date
+                FROM ( SELECT @cdate := date_add( CURDATE(), INTERVAL 1 DAY ) FROM hy_freight_info LIMIT 30 ) a ) aa
+                LEFT JOIN (select id,profit, profit_date from hy_freight_info
+                where profit_date >=DATE_SUB(CURDATE(), INTERVAL 30  DAY)
+                ) b on aa.date = b.profit_date
+                GROUP BY aa.date
+                ORDER BY aa.date DESC;
+            </if>
+            <if test="searchType == 2">
+
+            </if>
+            <if test="searchType == 3">
+
+            </if>
+        </if>
+    </select>
 </mapper>

+ 102 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/HyFreightSettlementInfoMapper.xml

@@ -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") &lt;=
+            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") &lt;=
+            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>