Pārlūkot izejas kodu

汽运结算报表

zxz 3 gadi atpakaļ
vecāks
revīzija
1a138164e6

+ 58 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/TranSettlementReportController.java

@@ -1,9 +1,14 @@
 package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.TranSettlementReport;
+import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 
-import org.springframework.web.bind.annotation.RestController;
+import java.util.List;
 
 /**
  * <p>
@@ -14,8 +19,58 @@ import org.springframework.web.bind.annotation.RestController;
  * @since 2021-08-27
  */
 @RestController
-@RequestMapping("/tranSettlementReport")
+    @RequestMapping("/tranSettlementReport")
 public class TranSettlementReportController {
+    @Autowired
+    private ITranSettlementReportService tranSettlementReportService;
+    /**
+     * 汽运结算统计报表
+     * @param tranSettlementReport
+     * @return
+     */
+    @GetMapping("/selectTranSettlementReport")
+    public Page<TranSettlementReport> selectTranSettlementReport(TranSettlementReport tranSettlementReport){
+        return tranSettlementReportService.selectTranSettlementReport(tranSettlementReport);
+    }
 
+    /**
+     * 修改结算重量\扣款\已开发票
+     * @param tranSettlementReport
+     * @return
+     */
+    @PostMapping("/api/editTranSettlementReport")
+    public String editTranSettlementReport(@RequestBody TranSettlementReport tranSettlementReport){
+        return tranSettlementReportService.editTranSettlementReport(tranSettlementReport);
+    }
+
+    /**
+     * 合同编号下拉列表
+     * @param compId
+     * @return
+     */
+    @GetMapping("/selectContractNoList")
+    public List<ContractManagementInfo> selectContractNoList(String compId) {
+        return tranSettlementReportService.selectContractNoList(compId);
+    }
+
+    /**
+     * 出纳付款
+     * @param
+     * @return
+     */
+    @PostMapping("/api/payMoney")
+    public String payMoney(@RequestBody TranSettlementReport tranSettlementReport){
+        return tranSettlementReportService.payMoney(tranSettlementReport);
+    }
+
+    /**
+     * 批量开发票
+     * @param tranSettlementReport
+     * @return
+     */
+    @PostMapping("/api/openInvoiceList")
+    public String openInvoiceList(@RequestBody TranSettlementReport tranSettlementReport) {
+        return tranSettlementReportService.openInvoiceList(tranSettlementReport);
+    }
 }
 

+ 58 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/TranSettlementReport.java

@@ -3,16 +3,20 @@ package com.yh.saas.plugin.yiliangyiyun.entity;
 import java.util.Date;
 import com.baomidou.mybatisplus.activerecord.Model;
 import java.io.Serializable;
+import java.util.List;
 
+import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
 import com.baomidou.mybatisplus.annotations.Version;
 
 import com.baomidou.mybatisplus.enums.IdType;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.yh.saas.common.support.entity.BaseModel;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * <p>
@@ -106,6 +110,8 @@ public class TranSettlementReport extends BaseModel<TranSettlementReport> {
     /**
      * 付款日期
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date paymentDate;
     /**
      * 状态标识
@@ -131,6 +137,58 @@ public class TranSettlementReport extends BaseModel<TranSettlementReport> {
      * 审核流id
      */
     private String workflowId;
+    /**
+     * 手动修改标识(1是)
+     */
+    private String manualFlag;
+    /**
+     * 通过1驳回2
+     */
+    @TableField(exist = false)
+    private Integer flag;
+
+    /**
+     * 修改结算重量0修改扣款1修改已开发票2
+     */
+    @TableField(exist = false)
+    private Integer editFlag;
+
+    /**
+     * 角色人flag(1统计2决策人3财务4出纳)
+     */
+    @TableField(exist = false)
+    private Integer roleFlag;
+
+    /**
+     * 待审核id
+     */
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 模糊查询
+     */
+    @TableField(exist = false)
+    private String searchKeyWord;
+
+    /**
+     *查询类型
+     */
+    @TableField(exist = false)
+    private String searchType;
+
+    /**
+     *付款金额
+     */
+    @TableField(exist = false)
+    private Float money;
+
+    //改价记录
+    @TableField(exist = false)
+    private List<DriverPayeeInfo> driverPayeeInfoList;
+
+    @TableField(exist = false)
+    private List<TranSettlementReport> tranSettlementReportList;
 
 
     @Override

+ 17 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/TranSettlementReportMapper.java

@@ -3,6 +3,9 @@ package com.yh.saas.plugin.yiliangyiyun.mapper;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranSettlementReport;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 汽运结算报表 Mapper 接口
@@ -12,5 +15,19 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
  * @since 2021-08-27
  */
 public interface TranSettlementReportMapper extends BaseMapper<TranSettlementReport> {
+    /**
+     * 根据条件查询汽运结算统计总数
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getCountByCondition(Map<String, Object> pageView);
 
+    /**
+     * 根据条件查询采购平仓统计列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<TranSettlementReport> getListByCondition(Map<String, Object> pageView);
 }

+ 34 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ITranSettlementReportService.java

@@ -1,8 +1,12 @@
 package com.yh.saas.plugin.yiliangyiyun.service;
 
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.TranSettlementReport;
 import com.baomidou.mybatisplus.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 汽运结算报表 服务类
@@ -12,5 +16,35 @@ import com.baomidou.mybatisplus.service.IService;
  * @since 2021-08-27
  */
 public interface ITranSettlementReportService extends IService<TranSettlementReport> {
+    /**
+     * 汽运结算统计报表
+     *
+     * @param tranSettlementReport
+     * @return
+     */
+    Page<TranSettlementReport> selectTranSettlementReport(TranSettlementReport tranSettlementReport);
+    /**
+     * 修改 结算重量\扣款\已开发票
+     * @param tranSettlementReport
+     * @return
+     */
+    String editTranSettlementReport(TranSettlementReport tranSettlementReport);
+    /**
+     * 合同编号下拉列表
+     *
+     * @param compId
+     */
+    List<ContractManagementInfo> selectContractNoList(String compId);
+    /**
+     * 出纳付款
+     * @param tranSettlementReport
+     */
+    String payMoney(TranSettlementReport tranSettlementReport);
+    /**
+     * 批量开发票
+     * @param tranSettlementReport
+     */
+    String openInvoiceList(TranSettlementReport tranSettlementReport);
+
 
 }

+ 268 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/TranSettlementReportServiceImpl.java

@@ -1,10 +1,29 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
-import com.yh.saas.plugin.yiliangyiyun.entity.TranSettlementReport;
+import com.alibaba.fastjson.JSONObject;
+import com.alipay.sofa.runtime.api.annotation.SofaReference;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.google.common.collect.Lists;
+import com.winsea.svc.base.base.entity.CommonRoleResource;
+import com.winsea.svc.base.base.service.ICommonRoleResourceService;
+import com.winsea.svc.base.security.entity.User;
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
+import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.mapper.TranSettlementReportMapper;
-import com.yh.saas.plugin.yiliangyiyun.service.ITranSettlementReportService;
+import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -17,4 +36,251 @@ import org.springframework.stereotype.Service;
 @Service
 public class TranSettlementReportServiceImpl extends ServiceImpl<TranSettlementReportMapper, TranSettlementReport> implements ITranSettlementReportService {
 
+//    @Autowired
+//    private INewWorkflowService workflowService;
+
+//    @SofaReference
+//    private ICommonRoleResourceService roleResourceService;
+    @Autowired
+    private IDriverPayeeInfoService driverPayeeInfoService;
+    @Autowired
+    private IDriverViewInfoService driverViewInfoService;
+
+    @Autowired
+    private IContractManagementInfoService contractManagementInfoService;
+    /**
+     * 汽运结算统计列表
+     *
+     * @param tranSettlementReport
+     * @return
+     */
+    @Override
+    public Page<TranSettlementReport> selectTranSettlementReport(TranSettlementReport tranSettlementReport) {
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("startRecord", (tranSettlementReport.getCurrentPage() - 1)
+                * tranSettlementReport.getPageSize());
+//        List<String> businessKeys = null;
+//        if("1".equals(tranSettlementReport.getSearchType())){
+//            businessKeys = workflowService.getTaskBusinessKeysByCode("PROCUREMENT-CLOSE-REPORT");
+//        }
+//        List<String> statusSet = new ArrayList<>();
+//        List<String> resourceIdList = this.getResourceIdList();
+//        if (resourceIdList.contains("procurementCloseReport-Edit")) { // 填写,提交    权限做完以后替换
+//            List<String> statusList = Lists.newArrayList(StatusEnum.PUR_RETURN.getFlag());
+//            statusSet.addAll(statusList);
+//        }
+
+        //公司id
+        pageView.put("compId", tranSettlementReport.getCompId());
+        pageView.put("searchKeyWord", tranSettlementReport.getSearchKeyWord());
+        pageView.put("searchType", tranSettlementReport.getSearchType());
+        pageView.put("pageSize", tranSettlementReport.getPageSize());
+        pageView.put("currentPage", tranSettlementReport.getCurrentPage());
+        pageView.put("contractNo", tranSettlementReport.getContractNo());
+//        pageView.put("roleFlag", tranSettlementReport.getRoleFlag());
+        pageView.put("statusFlag", tranSettlementReport.getStatusFlag());
+//        pageView.put("businessKeys", businessKeys);
+//        pageView.put("statusSet", statusSet);
+
+
+        // 查询采购订单总数
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<TranSettlementReport> dataList = baseMapper.getListByCondition(pageView);
+
+        if (!CollectionUtils.isEmpty(dataList)) {
+            for (TranSettlementReport tranSettlementReport1 : dataList) {
+                //查询账户信息
+                List<DriverViewInfo> driverViewInfoList = driverViewInfoService.selectList(new EntityWrapper<DriverViewInfo>()
+                        .eq("driver_name", tranSettlementReport1.getName())
+                        .eq("delete_flag", "0"));
+                if (!CollectionUtils.isEmpty(driverViewInfoList)){
+                    for (DriverViewInfo driverViewInfo:driverViewInfoList){
+                        List<DriverPayeeInfo> driverPayeeInfoList=driverPayeeInfoService.selectList(new EntityWrapper<DriverPayeeInfo>()
+                                .eq("driver_id", driverViewInfo.getId())
+                                .eq("delete_flag", "0"));
+                        tranSettlementReport1.setDriverPayeeInfoList(driverPayeeInfoList);
+                    }
+                }
+                //损耗
+                if(tranSettlementReport1.getUnloadingWeight() != null){
+                    tranSettlementReport1.setLossWeight(tranSettlementReport1.getLoadingWeight() - tranSettlementReport1.getUnloadingWeight());
+                }
+                //扣款
+                if(tranSettlementReport1.getLossWeight() <= (tranSettlementReport1.getLoadingWeight()/1000)){
+                    tranSettlementReport1.setDeductionAmount("0");
+                }
+                else{
+                    tranSettlementReport1.setDeductionAmount(String.valueOf((Float.valueOf(tranSettlementReport1.getLossWeight()) - (tranSettlementReport1.getLoadingWeight()/1000)) * tranSettlementReport1.getTransportPrice()));
+                }
+                //结算重量
+                if ("0".equals(tranSettlementReport1.getManualFlag())){
+                    //卸车为空时,结算重量=装车重量
+                    if (tranSettlementReport1.getUnloadingWeight() == null){
+                        tranSettlementReport1.setSettlementWeight(tranSettlementReport1.getLoadingWeight());
+                    }
+                    //卸车不为空时,结算重量=装卸取小
+                    else {
+                        tranSettlementReport1.setSettlementWeight(tranSettlementReport1.getLoadingWeight() > tranSettlementReport1.getUnloadingWeight() ? tranSettlementReport1.getUnloadingWeight() : tranSettlementReport1.getLoadingWeight());
+
+                    }
+                }
+                //应付金额
+                //已付金额
+                //未付金额
+            }
+//                String taskId = "";
+//                // 只有待审核状态才有taskId
+//                if (StringUtils.isNotBlank(tranSettlementReport1.getWorkflowId())) {
+//                    JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(tranSettlementReport1.getWorkflowId()), tranSettlementReport1.getId());
+//                    taskId = jsonObject.getString("taskId");
+//                    tranSettlementReport1.setTaskId(taskId);
+//                }
+//            }
+        }
+                Page<TranSettlementReport> page = new Page<>();
+                page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+                page.setTotal(dataCount == null ? 0 : dataCount);
+                page.setCurrent(tranSettlementReport.getCurrentPage());
+                page.setSize(tranSettlementReport.getPageSize());
+                return page;
+    }
+//    private List<String> getResourceIdList() {
+//        User currentUser = AuthSecurityUtils.getCurrentUserInfo();
+//        // 当前登录人主要角色
+//        return roleResourceService.getBindResourcesByUserId(currentUser.getUserId()).stream()
+//                .map(CommonRoleResource::getResourceId).collect(Collectors.toList());
+//
+//    }
+    /**
+     * 修改结算重量0修改扣款1修改已开发票2
+     * @param tranSettlementReport
+     * @return
+     */
+    @Override
+    public String editTranSettlementReport(TranSettlementReport tranSettlementReport) {
+        //查询汽运结算信息
+        TranSettlementReport tranSettlementReport1 = this.selectById(tranSettlementReport.getId());
+        if (tranSettlementReport1 != null ){
+            //0 修改结算重量
+            if(tranSettlementReport.getFlag()==0) {
+                tranSettlementReport1.setSettlementWeight(tranSettlementReport.getSettlementWeight());
+                tranSettlementReport1.setManualFlag("1");
+                //更改汽运结算信息
+                this.updateById(tranSettlementReport1);
+                return "OK";
+            }
+            //1 修改扣款
+            else if(tranSettlementReport.getFlag()==1){
+                tranSettlementReport1.setDeductionAmount(tranSettlementReport.getDeductionAmount());
+                //更改汽运结算信息
+                this.updateById(tranSettlementReport1);
+                return "OK";
+            }
+            //2 修改已开发票
+            else {
+                tranSettlementReport1.setAlreadyInvoice(tranSettlementReport1.getAlreadyInvoice() + tranSettlementReport.getAlreadyInvoice());
+                //更改汽运结算信息
+                this.updateById(tranSettlementReport1);
+                return "OK";
+            }
+        }
+        return "NG";
+    }
+    /**
+     * 合同编号下拉列表
+     * @param compId
+     */
+    @Override
+    public List<ContractManagementInfo> selectContractNoList(String compId) {
+        //查我方承运的合同
+        List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
+                .eq("comp_id", compId)
+                .eq("deliver_type", "1")
+                .eq("delete_flag", "0")
+                .orderBy("update_date", false));
+        for(ContractManagementInfo contractManagementInfo: contractManagementInfoList){
+            Float money=0.0f;
+            //查汽运结算报表
+            List<TranSettlementReport> tranSettlementReportList = this.selectList(new EntityWrapper<TranSettlementReport>()
+                    .eq("contract_no", contractManagementInfo.getContractNo())
+                    .eq("delete_flag", "0"));
+            if (!CollectionUtils.isEmpty(tranSettlementReportList)){
+                for (TranSettlementReport tranSettlementReport:tranSettlementReportList){
+                    money=money+tranSettlementReport.getAmountNotPayable();
+                }
+                //有未付金额
+                if (money > 0) {
+                    contractManagementInfo.setReportStatus("待结算");
+                }
+                else {
+                    contractManagementInfo.setReportStatus("已结算");
+                }
+            }
+        }
+        return contractManagementInfoList;
+    }
+
+    /**
+     * 出纳付款
+     *
+     * @param tranSettlementReport
+     * @return
+     */
+    @Override
+    public String payMoney(TranSettlementReport tranSettlementReport) {
+        List<TranSettlementReport> tranSettlementReportList = tranSettlementReport.getTranSettlementReportList();
+        Float money = tranSettlementReport.getMoney();
+        //付款多条
+        if (!CollectionUtils.isEmpty(tranSettlementReportList)) {
+            for (TranSettlementReport tranSettlementReport1 : tranSettlementReportList) {
+                TranSettlementReport tranSettlementReport2 = this.selectById(tranSettlementReport1.getId());
+                //付款金额大于本次循环未付金额
+                if (money >= tranSettlementReport1.getAmountNotPayable()) {
+                    money = money - tranSettlementReport1.getAmountNotPayable();
+                    //全部付款
+                    tranSettlementReport1.setStatus(StatusEnum.PUR_PAYaLL.getName());
+                    tranSettlementReport1.setStatusFlag(StatusEnum.PUR_PAYaLL.getFlag());
+                    tranSettlementReport1.setPaymentDate(tranSettlementReport.getPaymentDate());
+                    tranSettlementReport1.setPaymentScreenshot(tranSettlementReport2.getPaymentScreenshot() != null ? tranSettlementReport2.getPaymentScreenshot() + '$' + tranSettlementReport.getPaymentScreenshot() : tranSettlementReport.getPaymentScreenshot());
+                    tranSettlementReport1.setAmountEdPayable(tranSettlementReport1.getAmountEdPayable() + tranSettlementReport1.getAmountNotPayable());
+                    tranSettlementReport1.setAmountNotPayable(0.0f);
+                    this.updateById(tranSettlementReport1);
+                } else if (money > 0) {
+                    Float moneyTmp = money - tranSettlementReport1.getAmountNotPayable();
+                    //部分付款
+                    tranSettlementReport1.setStatus(StatusEnum.PUR_PAY.getName());
+                    tranSettlementReport1.setStatusFlag(StatusEnum.PUR_PAY.getFlag());
+                    tranSettlementReport1.setPaymentDate(tranSettlementReport.getPaymentDate());
+                    tranSettlementReport1.setPaymentScreenshot(tranSettlementReport2.getPaymentScreenshot() != null ? tranSettlementReport2.getPaymentScreenshot() + '$' + tranSettlementReport.getPaymentScreenshot() : tranSettlementReport.getPaymentScreenshot());
+                    tranSettlementReport1.setAmountEdPayable(tranSettlementReport1.getAmountEdPayable() + money);
+                    tranSettlementReport1.setAmountNotPayable(tranSettlementReport1.getAmountNotPayable() - money);
+                    this.updateById(tranSettlementReport1);
+                    money = moneyTmp;
+                } else {
+                    break;
+                }
+            }
+        }
+        return "ok";
+    }
+
+    /**
+     * 批量开发票
+     *
+     * @param tranSettlementReport
+     */
+    @Override
+    public String openInvoiceList(TranSettlementReport tranSettlementReport) {
+        List<TranSettlementReport> tranSettlementReportList = tranSettlementReport.getTranSettlementReportList();
+        //批量
+        if (!CollectionUtils.isEmpty(tranSettlementReportList)) {
+            for (TranSettlementReport tranSettlementReport1 : tranSettlementReportList) {
+                //已开发票金额等于已付金额
+                tranSettlementReport1.setAlreadyInvoice(tranSettlementReport1.getAmountEdPayable());
+                this.updateById(tranSettlementReport1);
+            }
+        }
+        return "ok";
+    }
+
 }

+ 103 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/TranSettlementReportMapper.xml

@@ -1,5 +1,107 @@
 <?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.yh.saas.plugin.yiliangyiyun.mapper.TranSettlementReportMapper">
-
+    <!-- 获得汽运结算统计总数 -->
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(id)
+        FROM tran_settlement_report
+        WHERE
+        delete_flag = '0'
+        AND comp_id = #{compId}
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND amount_ing_payable-amount_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ing_payable-amount_ed_payable=0
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
+            AND contract_no = #{contractNo}
+        </if>
+<!--        <if test="businessKeys != null and businessKeys.size > 0">-->
+<!--            and(-->
+<!--            <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">-->
+<!--                id = #{businessValue}-->
+<!--            </foreach>-->
+<!--            )-->
+<!--        </if>-->
+<!--        <if test="statusSet != null and statusSet.size > 0">-->
+<!--            or (-->
+<!--            <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">-->
+<!--                status_flag =-->
+<!--                <if test="statusId != null">-->
+<!--                    #{statusId}-->
+<!--                </if>-->
+<!--            </foreach>-->
+<!--            )-->
+<!--        </if>-->
+    </select>
+    <!-- 获得汽运结算统计列表 -->
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.TranSettlementReport">
+        SELECT
+        id,
+        comp_id as compId,
+        contract_no as contractNo,
+        process_no as processNo,
+        phone,
+        name as name,
+        tran_car_no as tranCarNo,
+        car_no as carNo,
+        loading_weight as loadingWeight,
+        unloading_weight as unloadingWeight,
+        loss_weight as lossWeight,
+        manual_flag as ManualFlag,
+        transport_price as transportPrice,
+        settlement_weight as settlementWeight,
+        deduction_amount as deductionAmount,
+        amount_ing_payable as amountIngPayable,
+        amount_ed_payable as amountEdPayable,
+        amount_not_payable as amountNotPayable,
+        already_invoice as alreadyInvoice,
+        payment_date as paymentDate,
+        payment_screenshot as paymentScreenshot,
+        status,
+        status_flag as statusFlag,
+        approve_status as approveStatus,
+        workflow_id as workflowId
+        FROM tran_settlement_report
+        WHERE
+        delete_flag = '0'
+        AND comp_id = #{compId}
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND amount_ing_payable-amount_ed_payable>0
+            </if>
+            <if test="searchType == 3">
+                AND amount_ing_payable-amount_ed_payable=0
+            </if>
+        </if>
+        <if test="contractNo != null and contractNo != ''and contractNo != '全部合同'">
+            AND contract_no = #{contractNo}
+        </if>
+<!--        <if test="businessKeys != null and businessKeys.size > 0">-->
+<!--            and(-->
+<!--            <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">-->
+<!--                id = #{businessValue}-->
+<!--            </foreach>-->
+<!--            )-->
+<!--        </if>-->
+<!--        <if test="statusSet != null and statusSet.size > 0">-->
+<!--            or (-->
+<!--            <foreach collection="statusSet" item="statusId" separator="or" open="(" close=")">-->
+<!--                status_flag =-->
+<!--                <if test="statusId != null">-->
+<!--                    #{statusId}-->
+<!--                </if>-->
+<!--            </foreach>-->
+<!--            )-->
+<!--        </if>-->
+        ORDER BY create_date DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
 </mapper>