Преглед изворни кода

1.平台私有应收需求
2. 月份平台应收需求

wuhp пре 2 година
родитељ
комит
9158c6239f

+ 22 - 0
src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.fnc.controller;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
+import com.ydtech.modules.fnc.dto.SumAllAmountSettlementDto;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity;
 import com.ydtech.modules.fnc.service.ImportAsyncService;
@@ -454,6 +455,27 @@ public class InsPlyIncomeController extends BaseController {
     public HttpResult<Object> batchPinBalanceNew(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
         return insPlyIncomeService.batchPinBalanceNew(insPlyIncomeVo);
     }
+    /**
+     *
+     * @param insPlyIncomeVo
+     * @return  返回私有 平台  应收 已收  未收
+     */
+    @PostMapping("/totalReceivables")
+    @ApiModelProperty(value = "平台 私有 应收未收 金额")
+    public HttpResult<HashMap<String,Object>> totalReceivables(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        return insPlyIncomeService.totalReceivables(insPlyIncomeVo);
+    }
+
+    /**
+     *
+     * @param insPlyIncomeVo
+     * @return  返回私有   1   到 12  月   应收 已收
+     */
+    @PostMapping("/monthTotalReceivables")
+    @ApiModelProperty(value = "私有平台 已收未收金额")
+    public HttpResult<List<HashMap<String,Object>>> monthTotalReceivables(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        return insPlyIncomeService.monthTotalReceivables(insPlyIncomeVo);
+    }
 }
 
 

+ 16 - 0
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -130,4 +130,20 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
      *  @Description: 根据合作公司id和结算状态查询数据
      */
     List<PlatformSettlementRecordDto> platformSettlementRecord(@Param("partnerCompaniesId") String partnerCompaniesId, @Param("handlingFeesStatus") String handlingFeesStatus);
+
+
+    /***
+     *
+     * @param insPlyIncomeVo
+     * @return  返回私有 平台  应收 已收  未收
+     */
+    InsPlyIncome getTotalPtReceivables(InsPlyIncomeVo insPlyIncomeVo);
+
+    /**
+     *  根据签单日期月份分组
+     * @param insPlyIncomeVo
+     * @return   平台 私有  应收   已收
+     */
+
+    List<HashMap<String, Object>> ptSumGroupByMonth(HashMap<String, Object> params);
 }

+ 33 - 0
src/main/java/com/ydtech/modules/fnc/dto/SumAllAmountSettlementDto.java

@@ -0,0 +1,33 @@
+package com.ydtech.modules.fnc.dto;
+
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+@ApiModel("结算统计")
+public class SumAllAmountSettlementDto implements Serializable {
+
+
+    @ApiModelProperty("协议类型")
+    private String agreementType;
+
+    @ApiModelProperty("应收金额")
+    private  BigDecimal totAmount;
+
+    @ApiModelProperty("已收金额")
+    private  BigDecimal receivedAmount;
+
+
+    @ApiModelProperty("已收金额")
+    private  BigDecimal unReceivedAmount;
+
+
+
+
+}

+ 7 - 0
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -156,5 +156,12 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     void updateNoHand(InsPlyIncomeVo insPlyIncomeVo);
 
     HttpResult<Object> batchPinBalanceNew(InsPlyIncomeVo insPlyIncomeVo);
+    /***
+     *
+     * @param insPlyIncomeVo
+     * @return  返回私有 平台  应收 已收  未收
+     */
+    HttpResult<HashMap<String, Object>> totalReceivables(InsPlyIncomeVo insPlyIncomeVo);
 
+    HttpResult<List<HashMap<String,Object>>> monthTotalReceivables(InsPlyIncomeVo insPlyIncomeVo);
 }

+ 91 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -2328,7 +2328,9 @@ handlingProportion,
             params.remove("handlingFeesStatus");
             List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);  //金额总数
             for (InsPlyIncome all : insPlyIncomes) {
-                commissionFeevalue = commissionFeevalue.add(all.getCommissionFeevalue());
+                if(ObjectUtils.isNotEmpty(all)){
+                    commissionFeevalue = commissionFeevalue.add(all.getCommissionFeevalue());
+                }
             }
             //已开票金额  =  开票未结算+  开票已结算
             params.put("handlingFeesStatus", "0"); // 开票
@@ -2637,6 +2639,8 @@ handlingProportion,
                     map.put("syPolicyno", item.getSyPolicyno());
                     map.put("jqOtherCostsPremium", jqOtherAmount);
                     map.put("syOtherCostsPremium", syOtherAmount);
+                    map.put("jqOtherCostsProportion", jqOtherCostsProportion);
+                    map.put("syOtherCostsProportion", syOtherCostsProportion);
 
                     map.put("otherFeevalue", byBxLicenseno.getOtherFeevalue());
                     map.put("otherFeerate", byBxLicenseno.getOtherFeerate());
@@ -2833,6 +2837,11 @@ handlingProportion,
         insPlyIncome.setSyReceivableProportion(this.calculateTotal(insPlyIncome.getSySuperviseCostsProportion(),insPlyIncome.getNoOtherCostsProportion(),null));
         insPlyIncome.setNoReceivableProportion(this.calculateTotal(insPlyIncome.getNoSuperviseCostsProportion(),insPlyIncome.getNoOtherCostsProportion(),null));
         insPlyIncome.setCreateTime(LocalDate.now());
+        insPlyIncome.setCommissionFeerate(this.calculateTotal(insPlyIncome.getJqSuperviseCostsProportion(),insPlyIncome.getSySuperviseCostsProportion(),insPlyIncome.getNoSuperviseCostsPremiums()));
+        insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getJqSuperviseCostsPremiums(),insPlyIncome.getSySuperviseCostsPremiums(),insPlyIncome.getNoSuperviseCostsPremiums()));
+        insPlyIncome.setOtherFeerate(this.calculateTotal(insPlyIncome.getJqOtherCostsProportion(),insPlyIncome.getSyOtherCostsProportion(),insPlyIncome.getNoOtherCostsProportion()));
+        insPlyIncome.setOtherFeevalue(this.calculateTotal(insPlyIncome.getJqOtherCostsPremium(),insPlyIncome.getSyOtherCostsPremium(),insPlyIncome.getNoOtherCostsPremium()));
+        insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getCommissionFeevalue(),insPlyIncome.getOtherFeevalue(),null));
         insPlyIncome.setAgreementType("1");
         insPlyIncome.setHandlingFeesStatus("0");
         insPlyIncome.setIsNotCar("0");
@@ -2852,6 +2861,87 @@ handlingProportion,
         baseMapper.insert(insPlyIncome);
         return HttpResult.ok();
     }
+    /***
+     *
+     * @param insPlyIncomeVo
+     * @return  返回私有 平台  应收 已收  未收
+     */
+    @Override
+    public HttpResult<HashMap<String, Object>> totalReceivables(InsPlyIncomeVo insPlyIncomeVo) {
+        ArrayList<Map<String,Object>> resultList = new ArrayList<>();
+        BigDecimal bxhandAmount = BigDecimal.ZERO;   //保险手续费应收
+        BigDecimal receivedAmount = BigDecimal.ZERO;   //保险手续费应收
+        HashMap<String, Object> ptParams = new HashMap<>();
+        ptParams.put("agreementType","1");
+        InsPlyIncome totalledAmount = baseMapper.ptTotalAmount(ptParams);  //应收 未收 已收
+        ptParams.clear();
+        ptParams.put("commissionFeevalue",totalledAmount.getCommissionFeevalue());
+        ptParams.put("noInvoicCommissionFeevalue",totalledAmount.getNoInvoicCommissionFeevalue());
+        ptParams.put("readyCommissionFeevalue",totalledAmount.getReadyCommissionFeevalue());
+        resultList.add(ptParams);
+        //手续费应收
+        HashMap<String, Object>  privateParams= new HashMap<>();
+        privateParams.put("agreementType","2");
+        List<InsPlyIncome> bxHandList = baseMapper.queryNew(privateParams);
+        for (InsPlyIncome bxhandItem : bxHandList){
+            bxhandAmount=bxhandAmount.add(bxhandItem.getAllFeeValue());
+        }
+        privateParams.clear();
+        //已开票金额  =  开票未结算+  开票已结算
+        privateParams.put("settlementStatus", "2"); // 结算
+        List<SettlementDocumentaryFeesEntity> invoicInsPlyIncomes = settlementDocumentaryFeesService.queryNew(privateParams);  //金额总数
+        for (SettlementDocumentaryFeesEntity invoicInsPlyIncome : invoicInsPlyIncomes) {
+            receivedAmount =receivedAmount.add(invoicInsPlyIncome.getSettlementAmount());
+        }
+        BigDecimal subtract = bxhandAmount.subtract(receivedAmount);
+        privateParams.clear();
+        privateParams.put("commissionFeevalue",bxhandAmount);
+        privateParams.put("noInvoicCommissionFeevalue",receivedAmount);
+        privateParams.put("readyCommissionFeevalue",subtract);
+        resultList.add(privateParams);
+        return HttpResult.ok();
+    }
+
+    /**
+     *  根据签单日期月份分组
+     * @param insPlyIncomeVo
+     * @return   平台 私有  应收   已收
+     */
 
+    @Override
+    public HttpResult<List<HashMap<String,Object>>> monthTotalReceivables(InsPlyIncomeVo insPlyIncomeVo) {
 
+        HashMap<String, Object> params = new HashMap<>();
+        params.put("agreementType", insPlyIncomeVo.getAgreementType());
+        if ("1".equals(insPlyIncomeVo.getAgreementType())) {  //平台
+            params.put("year", insPlyIncomeVo.getYear());
+            List<HashMap<String, Object>> ptResultList = baseMapper.ptSumGroupByMonth(params);
+            params.put("handlingFeesStatus", "1");
+
+            List<HashMap<String, Object>> ptSettleResultList = baseMapper.ptSumGroupByMonth(params);
+            Map<String, BigDecimal> ptMap = new HashMap<>(); // 假设commissionFeevalue是BigDecimal类型
+            for (HashMap<String, Object> ptSettleResultListItem : ptSettleResultList) {
+                String month = (String) ptSettleResultListItem.get("month");
+                if (month == null) {
+                    // 处理month为null的情况
+                    continue;
+                }
+                BigDecimal commissionFeevalue = (BigDecimal) ptSettleResultListItem.get("commissionFeevalue");
+                if (commissionFeevalue == null) {
+                    // 处理commissionFeevalue为null的情况
+                    continue;
+                }
+                ptMap.put(month, commissionFeevalue);
+            }
+            for (HashMap<String, Object> ptResultListItem : ptResultList) {
+                BigDecimal bigDecimal1 = ptMap.get(ptResultListItem.get("year"));
+                ptResultListItem.put("readyCommissionFeevalue",bigDecimal1);
+                BigDecimal commissionFeevalue = BigDecimal.valueOf(Long.valueOf(ptResultListItem.get("commissionFeevalue").toString()));
+                BigDecimal subtract = commissionFeevalue.subtract(bigDecimal1);
+                ptResultListItem.put("noInvoicCommissionFeevalue",subtract);
+            }
+            return HttpResult.ok(ptResultList);
+        }
+        return HttpResult.ok();
+    }
 }

+ 394 - 1
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -812,7 +812,7 @@
     <select id="ptTotalAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
             SELECT
             SUM(IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 )) AS commissionFeevalue,
-            SUM( CASE WHEN a.handling_fees_status = '0' THEN IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ) ELSE 0 END ) AS "noInvoicCommissionFeevalue",
+            SUM(CASE WHEN a.handling_fees_status = '0' THEN IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ) ELSE 0 END ) AS "noInvoicCommissionFeevalue",
             SUM(CASE WHEN a.handling_fees_status = '1' THEN IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ) ELSE 0 END) AS "readyCommissionFeevalue"
             FROM
             ins_ply_income a
@@ -1518,6 +1518,8 @@
             <if test="isNotCar !=null  and  isNotCar  !=''">
                 and a.is_not_car =#{isNotCar}
             </if>
+
+
             <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
                 and a.handling_fees_status =#{handlingFeesStatus}
             </if>
@@ -1762,4 +1764,395 @@
         group  by  a.settlement_time
     </select>
 
+    <select id="getTotalPtReceivables"  resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
+        select
+        pa.agreement_type as   "agreementType",
+        sum(a.all_fee_value) as "allFeeValue"
+        from  ins_ply_income a
+        LEFT  JOIN  ptl_agreement  pa  on  a.agreement_id  = pa.id
+        LEFT  JOIN  sys_user   su  on su.id=a.user_id
+        LEFT  JOIN  sys_user   su1  on su1.id=a.settlement_user_id
+        LEFT  JOIN  sys_user   su2  on su2.id=a.update_user_id
+        LEFT  JOIN   ins_upload_files  upf   on  a.settlement_image_id=upf.id
+        LEFT  JOIN   esm_ins_company  eic   on  eic.id=a.partner_companies_id
+        LEFT  JOIN   sys_dept b on pa.dept_id=b.id
+        <where>
+            <if test="startDate !=null  and  startDate!='' and  endDate !=null and endDate !=''">
+                and DATE_FORMAT( a.signdate, '%Y-%m-%d')  between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')
+            </if>
+            <if test="agreementType !=null  and  agreementType  !=''">
+                and pa.agreement_type =#{agreementType}
+            </if>
+
+            <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
+                and a.signdate   between #{signDateStart} and #{signDateEnd}
+            </if>
+
+            <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                and a.handling_fees_status =#{handlingFeesStatus}
+            </if>
+            <if test="jqReceivableProportion !=null  and  jqReceivableProportion  !=''">
+                and a.jq_receivable_proportion =#{jqReceivableProportion}
+            </if>
+
+            <if test="syReceivableProportion !=null  and  syReceivableProportion  !=''">
+                and a.sy_receivable_proportion =#{syReceivableProportion}
+            </if>
+            <if test="noReceivableProportion !=null  and  noReceivableProportion  !=''">
+                and a.no_receivable_proportion =#{noReceivableProportion}
+            </if>
+
+            <if test="id !=null  and  id  !=''">
+                and a.id =#{id}
+            </if>
+
+            <if test="allPartnerCompaniesId !=null  and  allPartnerCompaniesId  !=''">
+                AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
+            </if>
+
+            <if test="provincePartnerCompaniesId !=null  and  provincePartnerCompaniesId  !=''">
+                and eic.parent_id LIKE CONCAT(#{provincePartnerCompaniesId}, '%')
+            </if>
+
+            <if test="dockingPerson !=null  and  dockingPerson  !=''">
+                and  pa.docking_person  =#{dockingPerson}
+            </if>
+
+            <if test="provinceId != null and provinceId != ''">
+                and pa.dept_id  LIKE CONCAT(#{provinceId}, '%')
+            </if>
+
+            <if test="cityId != null and cityId != ''">
+                and pa.dept_id  LIKE CONCAT(#{cityId}, '%')
+            </if>
+
+            <if test="createTimeQuery != null and createTimeQuery != ''">
+                and DATE_FORMAT( a.create_time, '%Y-%m-%d')   =#{createTimeQuery}
+            </if>
+
+            <if test="countyId != null and countyId != ''">
+                and pa.dept_id   LIKE CONCAT(#{countyId}, '%')
+            </if>
+            <if test="taskId != null and taskId != ''">
+                and a.task_id = #{taskId}
+            </if>
+            <if test="orderno !=null  and  orderno  !=''">
+                and a.orderno =#{orderno}
+            </if>
+            <if test="companyName !=null  and  companyName  !=''">
+                and a.company_id =#{companyName}
+            </if>
+
+            <if test="policyno !=null  and  policyno  !=''">
+                and a.policyno =#{policyno}
+            </if>
+            <if test="documentaryFeesStatus !=null  and  documentaryFeesStatus  !=''">
+                and a.documentary_fees_status =#{documentaryFeesStatus}
+            </if>
+
+            <if test="isNotCar !=null  and  isNotCar  !=''">
+                and a.is_not_car =#{isNotCar}
+            </if>
+
+            <if test="deptId !=null  and  deptId  !=''">
+                and pa.dept_id =#{deptId}
+            </if>
+
+
+            <if test="ids != null and ids != '' and ids.length > 0">
+                and a.id in
+                <foreach collection="ids" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="incomeIds != null and incomeIds != '' and incomeIds.size() > 0">
+                and a.id in
+                <foreach collection="incomeIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="selectIds != null and selectIds != '' and selectIds.size() > 0">
+                and a.id in
+                <foreach collection="selectIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
+                and a.partner_companies_id in
+                <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="isOther !=null  and  isOther  !=''">
+                and a.is_not_documentary   =#{isOther}
+            </if>
+            <if test="licenseno != null and licenseno != ''">
+                and a.licenseno  =#{licenseno}
+            </if>
+            <if test="syPolicyno != null and syPolicyno != ''">
+                and a.sy_policyno  =#{syPolicyno}
+            </if>
+
+            <if test="noPolicyno != null and noPolicyno != ''">
+                and a.no_policyno =#{noPolicyno}
+            </if>
+            <if test="signdate !=null  and  signdate  !=''">
+                AND  a.signdate =#{signdate}
+            </if>
+            <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
+                AND a.partner_companies_id =#{partnerCompaniesId}
+            </if>
+
+            <if test="partnerCompaniesName !=null  and  partnerCompaniesName  !=''">
+                AND   a.partner_companies_name =#{partnerCompaniesName}
+            </if>
+
+            <if test="createTime !=null  and  createTime  !=''">
+                AND  a.create_time =#{createTime}
+            </if>
+            <if test="settlementTime !=null  and  settlementTime  !=''">
+                AND a.settlement_time =#{settlementTime}
+            </if>
+
+            <if test="settlementDate !=null  and  settlementDate  !=''">
+                AND a.settlement_time =#{settlementDate}
+            </if>
+
+            <if test="userId !=null  and  userId  !=''">
+                and a.userId   =#{userId}
+            </if>
+            <if test="companyId !=null  and  companyId  !=''">
+                and a.company_id   =#{companyId}
+            </if>
+            <if test="riskcode !=null  and  riskcode  !=''">
+                and a.riskcode   =#{riskcode}
+            </if>
+            <if test="year !=null  and  year  !=''">
+                AND YEAR(a.signdate) =#{year}
+            </if>
+            <if test="month !=null  and  month !=''">
+                AND month(a.signdate) =#{month}
+            </if>
+            <if test="day !=null  and  day !=''">
+                AND day(a.signdate) =#{day}
+            </if>
+            <if test="insuredName !=null  and  insuredName !=''">
+                AND  a.insured_name =#{insuredName}
+            </if>
+            <if test="jqStartDate  !=null  and  jqStartDate  != ''  and  jqEndDate   != null  and  jqEndDate   !=''">
+                AND DATE(a.jq_start_date) BETWEEN #{jqStartDate} AND #{jqEndDate}
+
+            </if>
+            <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
+                AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
+
+            </if>
+
+            <if test="yearStrat  !=null  and  yearStrat  != ''  and  yearEnd   != null  and  yearEnd   !=''">
+                AND DATE(a.signdate) BETWEEN #{yearStrat} AND #{yearEnd}
+            </if>
+        </where>
+         group  by   pa.agreement_type
+    </select>
+
+    <select id="ptSumGroupByMonth" resultType="java.util.HashMap">
+        SELECT
+            DATE_FORMAT( a.signdate, '%m') as "month",
+            sum(a.all_fee_value) as "commissionFeevalue"
+        FROM
+            ins_ply_income a
+                LEFT JOIN ptl_agreement pa ON a.agreement_id = pa.id
+                LEFT JOIN sys_user su ON su.id = a.user_id
+                LEFT JOIN sys_user su1 ON su1.id = a.settlement_user_id
+                LEFT JOIN sys_user su2 ON su2.id = a.update_user_id
+                LEFT JOIN ins_upload_files upf ON a.settlement_image_id = upf.id
+                LEFT JOIN esm_ins_company eic ON eic.id = a.partner_companies_id
+                LEFT JOIN sys_dept b ON pa.dept_id = b.id
+        <where>
+            <if test="startDate !=null  and  startDate!='' and  endDate !=null and endDate !=''">
+                and DATE_FORMAT( a.signdate, '%Y-%m-%d')  between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')
+            </if>
+            <if test="agreementType !=null  and  agreementType  !=''">
+                and pa.agreement_type =#{agreementType}
+            </if>
+
+            <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
+                and a.signdate   between #{signDateStart} and #{signDateEnd}
+            </if>
+
+            <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                and a.handling_fees_status =#{handlingFeesStatus}
+            </if>
+            <if test="jqReceivableProportion !=null  and  jqReceivableProportion  !=''">
+                and a.jq_receivable_proportion =#{jqReceivableProportion}
+            </if>
+
+            <if test="syReceivableProportion !=null  and  syReceivableProportion  !=''">
+                and a.sy_receivable_proportion =#{syReceivableProportion}
+            </if>
+            <if test="noReceivableProportion !=null  and  noReceivableProportion  !=''">
+                and a.no_receivable_proportion =#{noReceivableProportion}
+            </if>
+            <if test="id !=null  and  id  !=''">
+                and a.id =#{id}
+            </if>
+
+            <if test="allPartnerCompaniesId !=null  and  allPartnerCompaniesId  !=''">
+                AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
+            </if>
+
+            <if test="provincePartnerCompaniesId !=null  and  provincePartnerCompaniesId  !=''">
+                and eic.parent_id LIKE CONCAT(#{provincePartnerCompaniesId}, '%')
+            </if>
+
+            <if test="dockingPerson !=null  and  dockingPerson  !=''">
+                and  pa.docking_person  =#{dockingPerson}
+            </if>
+
+            <if test="provinceId != null and provinceId != ''">
+                and pa.dept_id  LIKE CONCAT(#{provinceId}, '%')
+            </if>
+
+            <if test="cityId != null and cityId != ''">
+                and pa.dept_id  LIKE CONCAT(#{cityId}, '%')
+            </if>
+
+            <if test="createTimeQuery != null and createTimeQuery != ''">
+                and DATE_FORMAT( a.create_time, '%Y-%m-%d')   =#{createTimeQuery}
+            </if>
+
+            <if test="countyId != null and countyId != ''">
+                and pa.dept_id   LIKE CONCAT(#{countyId}, '%')
+            </if>
+            <if test="taskId != null and taskId != ''">
+                and a.task_id = #{taskId}
+            </if>
+            <if test="orderno !=null  and  orderno  !=''">
+                and a.orderno =#{orderno}
+            </if>
+            <if test="companyName !=null  and  companyName  !=''">
+                and a.company_id =#{companyName}
+            </if>
+
+            <if test="policyno !=null  and  policyno  !=''">
+                and a.policyno =#{policyno}
+            </if>
+            <if test="documentaryFeesStatus !=null  and  documentaryFeesStatus  !=''">
+                and a.documentary_fees_status =#{documentaryFeesStatus}
+            </if>
+
+            <if test="isNotCar !=null  and  isNotCar  !=''">
+                and a.is_not_car =#{isNotCar}
+            </if>
+
+            <if test="deptId !=null  and  deptId  !=''">
+                and pa.dept_id =#{deptId}
+            </if>
+
+
+            <if test="ids != null and ids != '' and ids.length > 0">
+                and a.id in
+                <foreach collection="ids" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="incomeIds != null and incomeIds != '' and incomeIds.size() > 0">
+                and a.id in
+                <foreach collection="incomeIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="selectIds != null and selectIds != '' and selectIds.size() > 0">
+                and a.id in
+                <foreach collection="selectIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
+                and a.partner_companies_id in
+                <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="isOther !=null  and  isOther  !=''">
+                and a.is_not_documentary   =#{isOther}
+            </if>
+            <if test="licenseno != null and licenseno != ''">
+                and a.licenseno  =#{licenseno}
+            </if>
+            <if test="syPolicyno != null and syPolicyno != ''">
+                and a.sy_policyno  =#{syPolicyno}
+            </if>
+
+            <if test="noPolicyno != null and noPolicyno != ''">
+                and a.no_policyno =#{noPolicyno}
+            </if>
+            <if test="signdate !=null  and  signdate  !=''">
+                AND  a.signdate =#{signdate}
+            </if>
+            <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
+                AND a.partner_companies_id =#{partnerCompaniesId}
+            </if>
+
+            <if test="partnerCompaniesName !=null  and  partnerCompaniesName  !=''">
+                AND   a.partner_companies_name =#{partnerCompaniesName}
+            </if>
+
+            <if test="createTime !=null  and  createTime  !=''">
+                AND  a.create_time =#{createTime}
+            </if>
+            <if test="settlementTime !=null  and  settlementTime  !=''">
+                AND a.settlement_time =#{settlementTime}
+            </if>
+
+            <if test="settlementDate !=null  and  settlementDate  !=''">
+                AND a.settlement_time =#{settlementDate}
+            </if>
+
+            <if test="userId !=null  and  userId  !=''">
+                and a.userId   =#{userId}
+            </if>
+            <if test="companyId !=null  and  companyId  !=''">
+                and a.company_id   =#{companyId}
+            </if>
+            <if test="riskcode !=null  and  riskcode  !=''">
+                and a.riskcode   =#{riskcode}
+            </if>
+            <if test="year !=null  and  year  !=''">
+                AND YEAR(a.signdate) =#{year}
+            </if>
+            <if test="month !=null  and  month !=''">
+                AND month(a.signdate) =#{month}
+            </if>
+            <if test="day !=null  and  day !=''">
+                AND day(a.signdate) =#{day}
+            </if>
+            <if test="insuredName !=null  and  insuredName !=''">
+                AND  a.insured_name =#{insuredName}
+            </if>
+            <if test="jqStartDate  !=null  and  jqStartDate  != ''  and  jqEndDate   != null  and  jqEndDate   !=''">
+                AND DATE(a.jq_start_date) BETWEEN #{jqStartDate} AND #{jqEndDate}
+
+            </if>
+            <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
+                AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
+
+            </if>
+
+            <if test="yearStrat  !=null  and  yearStrat  != ''  and  yearEnd   != null  and  yearEnd   !=''">
+                AND DATE(a.signdate) BETWEEN #{yearStrat} AND #{yearEnd}
+            </if>
+        </where>
+        GROUP BY
+        DATE_FORMAT( a.signdate, '%m')
+    </select>
+
+
+
 </mapper>