Bläddra i källkod

1.预收入明细查询

wuhp 2 år sedan
förälder
incheckning
89d189ac57

+ 96 - 3
src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java

@@ -289,13 +289,17 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
     @Override
     public SysUserAccountVo getInsOrders(SysUserAccountVo sysUserAccountVo) {
         ArrayList<InsFeeOrderNew> resultList = new ArrayList<>();
+        BigDecimal willPromotion = BigDecimal.ZERO;
         if(StringUtils.isNotEmpty(sysUserAccountVo.getIds())){
             for (String insOrderNo : sysUserAccountVo.getIds().split(",")) {
-
                 InsAreaCompany byInsOrderNo = insAreaCompanyService.getByInsOrderNoNew(insOrderNo,sysUserAccountVo.getTimeFiltering());
                 if(ObjectUtils.isNotEmpty(byInsOrderNo)){
                     String id = byInsOrderNo.getId();
-                    InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getInsFeeOrderNewByCompanyId(id);
+                    InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getInsFeeOrderEntity(id);
+                    //预收推广
+                    willPromotion =this.getWillPromotion(insFeeOrderNew,willPromotion);
+                    this.getWillAmount(insFeeOrderNew);  // 推广 非跟单
+                    insFeeOrderNew.setWillPromotion(willPromotion);
                     resultList.add(insFeeOrderNew);
                 }
             }
@@ -304,6 +308,96 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
         return sysUserAccountVo;
     }
 
+    private void getWillAmount(InsFeeOrderNew insFeeOrderNew) {
+        if(ObjectUtils.isNotEmpty(insFeeOrderNew)){
+            //交强手续费出口比例
+            BigDecimal jqExportProceduresFee = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqSuperviseCostsProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
+            //商业手续费出口比例
+            BigDecimal syExportProceduresFee = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSySuperviseCostsProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
+            //非车手续费出口比例
+            BigDecimal noExportProceduresFee = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoSuperviseCostsProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
+            //用户出口手续费
+
+            insFeeOrderNew.setWillHalding(jqExportProceduresFee.add(syExportProceduresFee).add(noExportProceduresFee));
+
+            //非车出口比例
+            //总机构 交强管理比例
+            BigDecimal sumJqDeptProportion = insFeeOrderNew.getJqDeptProportionLevel1()
+                    .add(insFeeOrderNew.getJqDeptProportionLevel2())
+                    .add(insFeeOrderNew.getJqDeptProportionLevel3())
+                    .add(insFeeOrderNew.getJqDeptProportionLevel4())
+                    .add(insFeeOrderNew.getJqDeptProportionLevel5());
+
+            //总机构 商业管理比例
+            BigDecimal sumSyDeptProportion = insFeeOrderNew.getSyDeptProportionLevel1()
+                    .add(insFeeOrderNew.getSyDeptProportionLevel2())
+                    .add(insFeeOrderNew.getSyDeptProportionLevel3())
+                    .add(insFeeOrderNew.getSyDeptProportionLevel4())
+                    .add(insFeeOrderNew.getSyDeptProportionLevel5());
+
+            //总机构 非车管理比例
+            BigDecimal sumNoDeptProportion = insFeeOrderNew.getNoDeptProportionLevel1()
+                    .add(insFeeOrderNew.getNoDeptProportionLevel2())
+                    .add(insFeeOrderNew.getNoDeptProportionLevel3())
+                    .add(insFeeOrderNew.getNoDeptProportionLevel4())
+                    .add(insFeeOrderNew.getNoDeptProportionLevel5());
+            BigDecimal noExportProceduresProportion = new BigDecimal(0);
+            //总分销比例
+            BigDecimal sumRetail = insFeeOrderNew.getFirstDetailProportion().add(insFeeOrderNew.getSecondDetailProportion()).add(insFeeOrderNew.getThirdDetailProportion());
+            if(insFeeOrderNew.getNoCostsProportion().compareTo(sumNoDeptProportion.add(sumRetail))>0){
+                noExportProceduresProportion = insFeeOrderNew.getNoCostsProportion().subtract(sumNoDeptProportion).subtract(sumRetail);
+            }
+            //商业出口比例
+            BigDecimal syExportProceduresProportion = new BigDecimal(0);
+            if(insFeeOrderNew.getSyCostsProportion().compareTo(sumSyDeptProportion.add(sumRetail))>0){
+                syExportProceduresProportion = insFeeOrderNew.getSyCostsProportion().subtract(sumSyDeptProportion).subtract(sumRetail);
+            }
+            //交强出口比例
+            BigDecimal jqExportProceduresProportion = new BigDecimal(0);
+            if(insFeeOrderNew.getJqCostsProportion().compareTo(sumJqDeptProportion.add(sumRetail))>0){
+                jqExportProceduresProportion = insFeeOrderNew.getJqCostsProportion().subtract(sumJqDeptProportion).subtract(sumRetail);
+            }
+            //交强跟单出口费用
+            BigDecimal jqExportOtherFee = insFeeOrderNew.getJqPremium()
+                    .multiply(jqExportProceduresProportion
+                            .subtract(insFeeOrderNew.getJqSuperviseCostsProportion()).divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
+
+            //商业跟单出口比例
+            BigDecimal syExportOtherFee = insFeeOrderNew.getSyPremium()
+                    .multiply(syExportProceduresProportion
+                            .subtract(insFeeOrderNew.getSySuperviseCostsProportion()).divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
+            //非车跟单出口比例
+            BigDecimal noExportOtherFee = insFeeOrderNew.getNoPremium()
+                    .multiply(noExportProceduresProportion
+                            .subtract(insFeeOrderNew.getNoSuperviseCostsProportion()).divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
+            //用户出口跟单费
+            insFeeOrderNew.setWillDocumentary(jqExportOtherFee.add(syExportOtherFee).add(noExportOtherFee));
+        }
+    }
+
+    private BigDecimal getWillPromotion(InsFeeOrderNew insFeeOrderNew,BigDecimal  willPromotion) {
+        for (int i = 1; i <4 ; i++) {
+            InsOrders   InsOrders = insAreaCompanyService.selectByInFeeOrderNew(insFeeOrderNew,i);
+            if(ObjectUtils.isNotEmpty(InsOrders)){
+                BigDecimal willFirstPremiums = InsOrders.getWillFirstPremiums();
+                BigDecimal willSecondPremiums = InsOrders.getWillSecondPremiums();
+                BigDecimal willThreePremiums = InsOrders.getWillThreePremiums();
+                if(ObjectUtils.isNotEmpty(InsOrders)){
+                    if(willFirstPremiums==null){
+                        willFirstPremiums=BigDecimal.ZERO;
+                    }
+                    if(willSecondPremiums==null){
+                        willSecondPremiums=BigDecimal.ZERO;
+                    }
+                    if(willThreePremiums==null){
+                        willThreePremiums=BigDecimal.ZERO;
+                    }
+                    return   willPromotion.add(willFirstPremiums).add(willThreePremiums).add(willSecondPremiums);
+                }
+            }
+        }
+        return null;
+    }
 
 
     private void judgeSysAmountAuditing(List<SysAmountAuditingEntity> sysAmountAuditingApproved, SysUserAccountVo sysUserAccountVo) {
@@ -349,7 +443,6 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
 
     private BigDecimal willPromotion(BigDecimal willPromotion, String userId) {
         for (int i = 1; i <4 ; i++) {
-
             InsOrders   InsOrders = insAreaCompanyService.selectPromotionBy(userId,i);
             if(ObjectUtils.isNotEmpty(InsOrders)){
                 BigDecimal willFirstPremiums = InsOrders.getWillFirstPremiums();

+ 1 - 0
src/main/java/com/ydtech/modules/order/service/InsAreaCompanyService.java

@@ -93,4 +93,5 @@ public interface InsAreaCompanyService extends IService<InsAreaCompany> {
 
     InsAreaCompany getByInsOrderNoNew(String insOrderNo, String timeFiltering);
 
+    InsOrders selectByInFeeOrderNew(InsFeeOrderNew insFeeOrderNew, int i);
 }

+ 31 - 4
src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java

@@ -13,6 +13,7 @@ import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.order.service.InsOrdersTrackService;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
+import com.ydtech.utils.StringUtils;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -156,14 +157,40 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
     @Override
     public InsAreaCompany getByInsOrderNoNew(String insOrderNo, String timeFiltering) {
         LambdaQueryWrapper<InsAreaCompany> queryWrapper = new LambdaQueryWrapper<>();
-        YearMonth targetYearMonth = YearMonth.parse(timeFiltering); // 假设timeFiltering是形如"2024-04"的字符串
-        LocalDate startOfMonth = targetYearMonth.atDay(1); // 当月第一天
-        LocalDate endOfMonth = targetYearMonth.atEndOfMonth(); // 当月最后一天
-        queryWrapper.between(InsAreaCompany::getSigningTime, startOfMonth, endOfMonth);
+        if(StringUtils.isNotEmpty(timeFiltering)){
+            YearMonth targetYearMonth = YearMonth.parse(timeFiltering); // 假设timeFiltering是形如"2024-04"的字符串
+            LocalDate startOfMonth = targetYearMonth.atDay(1); // 当月第一天
+            LocalDate endOfMonth = targetYearMonth.atEndOfMonth(); // 当月最后一天
+            queryWrapper.between(InsAreaCompany::getSigningTime, startOfMonth, endOfMonth);
+        }
         queryWrapper.eq(InsAreaCompany::getId, insOrderNo);
         return baseMapper.selectOne(queryWrapper);
     }
 
+    @Override
+    public InsOrders selectByInFeeOrderNew(InsFeeOrderNew insFeeOrderNew, int i) {
+        HashMap<String, Object> params = new HashMap<>();
+        if(!ObjectUtils.isEmpty(insFeeOrderNew)){
+            String userId = insFeeOrderNew.getUserId();
+            params.put("id",insFeeOrderNew.getId());
+            if(i==1){
+                params.put("firstUserId",userId);
+                return baseMapper.selectFirstPromotionBy(params);
+
+            }
+            if(i==2){
+                params.put("secondUserId",userId);
+                return baseMapper.selectSecondPromotionBy(params);
+
+            }
+            if(i==3){
+                params.put("thirdUserId",userId);
+                return baseMapper.selectThirdPromotionBy(params);
+            }
+        }
+        return null;
+    }
+
 
 }
 

+ 1 - 0
src/main/java/com/ydtech/modules/protocols/dao/InsFeeOrderNewMapper.java

@@ -12,6 +12,7 @@ import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsAttrLink;
  */
 public interface InsFeeOrderNewMapper extends BaseMapper<InsFeeOrderNew> {
 
+    InsFeeOrderNew getInsFeeOrderEntity(String id);
 }
 
 

+ 20 - 0
src/main/java/com/ydtech/modules/protocols/entity/po/InsFeeOrderNew.java

@@ -12,6 +12,7 @@ import org.apache.poi.hpsf.Decimal;
 
 import javax.persistence.Table;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 
 /**
 *@author: tz
@@ -365,7 +366,26 @@ public class InsFeeOrderNew {
     @TableField(value = "dept_distribution")
     private BigDecimal deptDistribution;
 
+    @ApiModelProperty(value = "签单日期")
+    @TableField(exist = false)
+    private LocalDate signingTime;
+
+    @ApiModelProperty(value = "车牌号")
+    @TableField(exist = false)
+    private String licenseno;
 
 
+    @ApiModelProperty(value = "预收推广")
+    @TableField(exist = false)
+    private BigDecimal willPromotion;
+
+    @ApiModelProperty(value = "预收手续费")
+    @TableField(exist = false)
+    private BigDecimal willHalding;
+
+    @ApiModelProperty(value = "预收跟单费")
+    @TableField(exist = false)
+    private BigDecimal willDocumentary;
+
 
 }

+ 1 - 0
src/main/java/com/ydtech/modules/protocols/service/InsFeeOrderNewService.java

@@ -13,4 +13,5 @@ public interface InsFeeOrderNewService extends IService<InsFeeOrderNew> {
 
     InsFeeOrderNew getInsFeeOrderNewByCompanyId(String companyId);
 
+    InsFeeOrderNew getInsFeeOrderEntity(String id);
 }

+ 5 - 0
src/main/java/com/ydtech/modules/protocols/service/impl/InsFeeOrderNewServiceImpl.java

@@ -25,4 +25,9 @@ public class InsFeeOrderNewServiceImpl extends ServiceImpl<InsFeeOrderNewMapper,
         return baseMapper.selectOne(new LambdaQueryWrapper<InsFeeOrderNew>()
                 .eq(InsFeeOrderNew::getInsOrderNo, companyId));
     }
+
+    @Override
+    public InsFeeOrderNew getInsFeeOrderEntity(String id) {
+        return baseMapper.getInsFeeOrderEntity(id);
+    }
 }

+ 191 - 0
src/main/resources/mapper/modules/ins/InsFeeOrderNewMapper.xml

@@ -0,0 +1,191 @@
+<?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.ydtech.modules.protocols.dao.InsFeeOrderNewMapper">
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.protocols.entity.po.InsFeeOrderNew">
+        <id column="id" property="id"/>
+        <result column="ins_order_no" property="insOrderNo"/>
+        <result column="agreement_id" property="agreementId"/>
+        <result column="costs_id" property="costsId"/>
+        <result column="dept_id" property="deptId"/>
+        <result column="user_id" property="userId"/>
+        <result column="jq_premium" property="jqPremium"/>
+        <result column="sy_premium" property="syPremium"/>
+        <result column="no_premium" property="noPremium"/>
+        <result column="jq_no_tax_premium" property="jqNoTaxPremium"/>
+        <result column="sy_no_tax_premium" property="syNoTaxPremium"/>
+        <result column="no_no_tax_premium" property="noNoTaxPremium"/>
+        <result column="jq_costs_proportion" property="jqCostsProportion"/>
+        <result column="jq_costs_premiums" property="jqCostsPremiums"/>
+        <result column="sy_costs_proportion" property="syCostsProportion"/>
+        <result column="sy_costs_premiums" property="syCostsPremiums"/>
+        <result column="no_costs_proportion" property="noCostsProportion"/>
+        <result column="no_costs_premiums" property="noCostsPremiums"/>
+        <result column="jq_supervise_costs_proportion" property="jqSuperviseCostsProportion"/>
+        <result column="jq_supervise_costs_premiums" property="jqSuperviseCostsPremiums"/>
+        <result column="sy_supervise_costs_proportion" property="sySuperviseCostsProportion"/>
+        <result column="sy_supervise_costs_premiums" property="sySuperviseCostsPremiums"/>
+        <result column="no_supervise_costs_proportion" property="noSuperviseCostsProportion"/>
+        <result column="no_supervise_costs_premiums" property="noSuperviseCostsPremiums"/>
+        <result column="jq_other_costs_proportion" property="jqOtherCostsProportion"/>
+        <result column="jq_other_costs_premiums" property="jqOtherCostsPremiums"/>
+        <result column="sy_other_costs_proportion" property="syOtherCostsProportion"/>
+        <result column="sy_other_costs_premiums" property="syOtherCostsPremiums"/>
+        <result column="no_other_costs_proportion" property="noOtherCostsProportion"/>
+        <result column="no_other_costs_premiums" property="noOtherCostsPremiums"/>
+        <result column="jq_investment_costs_proportion" property="jqInvestmentCostsProportion"/>
+        <result column="jq_investment_costs_premiums" property="jqInvestmentCostsPremiums"/>
+        <result column="sy_investment_costs_proportion" property="syInvestmentCostsProportion"/>
+        <result column="sy_investment_costs_premiums" property="syInvestmentCostsPremiums"/>
+        <result column="jq_dept_proportion_level_1" property="jqDeptProportionLevel1"/>
+        <result column="jq_dept_premiums_level_1" property="jqDeptPremiumsLevel1"/>
+        <result column="sy_dept_proportion_level_1" property="syDeptProportionLevel1"/>
+        <result column="sy_dept_premiums_level_1" property="syDeptPremiumsLevel1"/>
+        <result column="no_dept_proportion_level_1" property="noDeptProportionLevel1"/>
+        <result column="no_dept_premiums_level_1" property="noDeptPremiumsLevel1"/>
+        <result column="jq_dept_proportion_level_2" property="jqDeptProportionLevel2"/>
+        <result column="jq_dept_premiums_level_2" property="jqDeptPremiumsLevel2"/>
+        <result column="sy_dept_proportion_level_2" property="syDeptProportionLevel2"/>
+        <result column="sy_dept_premiums_level_2" property="syDeptPremiumsLevel2"/>
+        <result column="no_dept_proportion_level_2" property="noDeptProportionLevel2"/>
+        <result column="no_dept_premiums_level_2" property="noDeptPremiumsLevel2"/>
+        <result column="jq_dept_proportion_level_3" property="jqDeptProportionLevel3"/>
+        <result column="jq_dept_premiums_level_3" property="jqDeptPremiumsLevel3"/>
+        <result column="sy_dept_proportion_level_3" property="syDeptProportionLevel3"/>
+        <result column="sy_dept_premiums_level_3" property="syDeptPremiumsLevel3"/>
+        <result column="no_dept_proportion_level_3" property="noDeptProportionLevel3"/>
+        <result column="no_dept_premiums_level_3" property="noDeptPremiumsLevel3"/>
+        <result column="jq_dept_proportion_level_4" property="jqDeptProportionLevel4"/>
+        <result column="jq_dept_premiums_level_4" property="jqDeptPremiumsLevel4"/>
+        <result column="sy_dept_proportion_level_4" property="syDeptProportionLevel4"/>
+        <result column="sy_dept_premiums_level_4" property="syDeptPremiumsLevel4"/>
+        <result column="no_dept_proportion_level_4" property="noDeptProportionLevel4"/>
+        <result column="no_dept_premiums_level_4" property="noDeptPremiumsLevel4"/>
+        <result column="jq_dept_proportion_level_5" property="jqDeptProportionLevel5"/>
+        <result column="jq_dept_premiums_level_5" property="jqDeptPremiumsLevel5"/>
+        <result column="sy_dept_proportion_level_5" property="syDeptProportionLevel5"/>
+        <result column="sy_dept_premiums_level_5" property="syDeptPremiumsLevel5"/>
+        <result column="no_dept_proportion_level_5" property="noDeptProportionLevel5"/>
+        <result column="no_dept_premiums_level_5" property="noDeptPremiumsLevel5"/>
+        <result column="jq_costs_export_proportion" property="jqCostsExportProportion"/>
+        <result column="sy_costs_export_proportion" property="syCostsExportProportion"/>
+        <result column="no_costs_export_proportion" property="noCostsExportProportion"/>
+        <result column="jq_export_investment_proportion" property="jqExportInvestmentProportion"/>
+        <result column="jq_export_investment_premiums" property="jqExportInvestmentPremiums"/>
+        <result column="sy_export_investment_proportion" property="syExportInvestmentProportion"/>
+        <result column="sy_export_investment_premiums" property="syExportInvestmentPremiums"/>
+        <result column="first_detail_proportion" property="firstDetailProportion"/>
+        <result column="first_detail_premiums" property="firstDetailPremiums"/>
+        <result column="second_detail_proportion" property="secondDetailProportion"/>
+        <result column="second_detail_premiums" property="secondDetailPremiums"/>
+        <result column="third_detail_proportion" property="thirdDetailProportion"/>
+        <result column="third_detail_premiums" property="thirdDetailPremiums"/>
+        <result column="create_time" property="createTime"/>
+        <result column="first_level_user_id" property="firstLevelUserId"/>
+        <result column="two_level_user_id" property="twoLevelUserId"/>
+        <result column="three_level_user_id" property="threeLevelUserId"/>
+        <result column="distribution_status" property="distributionStatus"/>
+        <result column="dept_distribution" property="deptDistribution"/>
+    </resultMap>
+
+
+    <select id="getInsFeeOrderEntity" resultType="com.ydtech.modules.protocols.entity.po.InsFeeOrderNew">
+        select
+            a.id  as "id",
+            a.ins_order_no  as "insOrderNo",
+            a.agreement_id  as "agreementId",
+            a.costs_id  as "costsId",
+            a.dept_id  as "deptId",
+            a.user_id  as "userId",
+            a.jq_premium  as "jqPremium",
+            a.sy_premium  as "syPremium",
+            a.no_premium  as "noPremium",
+            a.jq_no_tax_premium  as "jqNoTaxPremium",
+            a.sy_no_tax_premium  as "syNoTaxPremium",
+            a.no_no_tax_premium  as "noNoTaxPremium",
+            a.jq_costs_proportion  as "jqCostsProportion",
+            a.jq_costs_premiums  as "jqCostsPremiums",
+            a.sy_costs_proportion  as "syCostsProportion",
+            a.sy_costs_premiums  as "syCostsPremiums",
+            a.no_costs_proportion  as "noCostsProportion",
+            a.no_costs_premiums  as "noCostsPremiums",
+            a.jq_supervise_costs_proportion  as "jqSuperviseCostsProportion",
+            a.jq_supervise_costs_premiums  as "jqSuperviseCostsPremiums",
+            a.sy_supervise_costs_proportion  as "sySuperviseCostsProportion",
+            a.sy_supervise_costs_premiums  as "sySuperviseCostsPremiums",
+            a.no_supervise_costs_proportion  as "noSuperviseCostsProportion",
+            a.no_supervise_costs_premiums  as "noSuperviseCostsPremiums",
+            a.jq_other_costs_proportion  as "jqOtherCostsProportion",
+            a.jq_other_costs_premiums  as "jqOtherCostsPremiums",
+            a.sy_other_costs_proportion  as "syOtherCostsProportion",
+            a.sy_other_costs_premiums  as "syOtherCostsPremiums",
+            a.no_other_costs_proportion  as "noOtherCostsProportion",
+            a.no_other_costs_premiums  as "noOtherCostsPremiums",
+            a.jq_investment_costs_proportion  as "jqInvestmentCostsProportion",
+            a.jq_investment_costs_premiums  as "jqInvestmentCostsPremiums",
+            a.sy_investment_costs_proportion  as "syInvestmentCostsProportion",
+            a.sy_investment_costs_premiums  as "syInvestmentCostsPremiums",
+            a.jq_dept_proportion_level_1  as "jqDeptProportionLevel1",
+            a.jq_dept_premiums_level_1  as "jqDeptPremiumsLevel1",
+            a.sy_dept_proportion_level_1  as "syDeptProportionLevel1",
+            a.sy_dept_premiums_level_1  as "syDeptPremiumsLevel1",
+            a.no_dept_proportion_level_1  as "noDeptProportionLevel1",
+            a.no_dept_premiums_level_1  as "noDeptPremiumsLevel1",
+            a.jq_dept_proportion_level_2  as "jqDeptProportionLevel2",
+            a.jq_dept_premiums_level_2  as "jqDeptPremiumsLevel2",
+            a.sy_dept_proportion_level_2  as "syDeptProportionLevel2",
+            a.sy_dept_premiums_level_2  as "syDeptPremiumsLevel2",
+            a.no_dept_proportion_level_2  as "noDeptProportionLevel2",
+            a.no_dept_premiums_level_2  as "noDeptPremiumsLevel2",
+            a.jq_dept_proportion_level_3  as "jqDeptProportionLevel3",
+            a.jq_dept_premiums_level_3  as "jqDeptPremiumsLevel3",
+            a.sy_dept_proportion_level_3  as "syDeptProportionLevel3",
+            a.sy_dept_premiums_level_3  as "syDeptPremiumsLevel3",
+            a.no_dept_proportion_level_3  as "noDeptProportionLevel3",
+            a.no_dept_premiums_level_3  as "noDeptPremiumsLevel3",
+            a.jq_dept_proportion_level_4  as "jqDeptProportionLevel4",
+            a.jq_dept_premiums_level_4  as "jqDeptPremiumsLevel4",
+            a.sy_dept_proportion_level_4  as "syDeptProportionLevel4",
+            a.sy_dept_premiums_level_4  as "syDeptPremiumsLevel4",
+            a.no_dept_proportion_level_4  as "noDeptProportionLevel4",
+            a.no_dept_premiums_level_4  as "noDeptPremiumsLevel4",
+            a.jq_dept_proportion_level_5  as "jqDeptProportionLevel5",
+            a.jq_dept_premiums_level_5  as "jqDeptPremiumsLevel5",
+            a.sy_dept_proportion_level_5  as "syDeptProportionLevel5",
+            a.sy_dept_premiums_level_5  as "syDeptPremiumsLevel5",
+            a.no_dept_proportion_level_5  as "noDeptProportionLevel5",
+            a.no_dept_premiums_level_5  as "noDeptPremiumsLevel5",
+            a.jq_costs_export_proportion  as "jqCostsExportProportion",
+            a.sy_costs_export_proportion  as "syCostsExportProportion",
+            a.no_costs_export_proportion  as "noCostsExportProportion",
+            a.jq_export_investment_proportion  as "jqExportInvestmentProportion",
+            a.jq_export_investment_premiums  as "jqExportInvestmentPremiums",
+            a.sy_export_investment_proportion  as "syExportInvestmentProportion",
+            a.sy_export_investment_premiums  as "syExportInvestmentPremiums",
+            a.first_detail_proportion  as "firstDetailProportion",
+            a.first_detail_premiums  as "firstDetailPremiums",
+            a.second_detail_proportion  as "secondDetailProportion",
+            a.second_detail_premiums  as "secondDetailPremiums",
+            a.third_detail_proportion  as "thirdDetailProportion",
+            a.third_detail_premiums  as "thirdDetailPremiums",
+            a.create_time  as "createTime",
+            a.first_level_user_id  as "firstLevelUserId",
+            a.two_level_user_id  as "twoLevelUserId",
+            a.three_level_user_id  as "threeLevelUserId",
+            a.distribution_status  as "distributionStatus",
+            a.dept_distribution  as "deptDistribution",
+            iac.signing_time  as  "signingTime",
+            io.licenseno  as  "licenseno"
+            from   ins_fee_order_new  a
+            LEFT JOIN   ins_area_company iac on iac.id=a.ins_order_no
+            LEFT JOIN   ins_orders  io on io.quoteno =iac.id
+            <where>
+                1=1
+                <if test="id !=null and id !=''">
+                 AND     a.ins_order_no=#{id}
+                </if>
+            </where>
+
+    </select>
+
+
+</mapper>

+ 9 - 0
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -231,6 +231,9 @@
              AND  a.three_level_user_id = #{thirdUserId}
         </if>
 
+         <if test="id != null and id != ''">
+             AND  a.id = #{id}
+        </if>
     </select>
     <select id="selectSecondPromotionBy" resultType="com.ydtech.modules.order.entity.InsOrders">
         SELECT
@@ -256,6 +259,9 @@
         <if test="thirdUserId != null and thirdUserId != ''">
              AND  a.three_level_user_id = #{thirdUserId}
         </if>
+        <if test="id != null and id != ''">
+            AND  a.id = #{id}
+        </if>
 
     </select>
     <select id="selectThirdPromotionBy" resultType="com.ydtech.modules.order.entity.InsOrders">
@@ -283,6 +289,9 @@
         <if test="thirdUserId != null and thirdUserId != ''">
              AND  a.three_level_user_id = #{thirdUserId}
         </if>
+        <if test="id != null and id != ''">
+            AND  a.id = #{id}
+        </if>
 
     </select>