Эх сурвалжийг харах

1.控制台数据统计优化

wuhp 2 жил өмнө
parent
commit
fff9c9a92b

+ 1 - 1
src/main/java/com/ydtech/modules/admin/model/dto/DeptBalanceDto.java

@@ -20,7 +20,7 @@ public class DeptBalanceDto implements Serializable {
     @ApiModelProperty(value = "机构名称")
     private String deptName;
 
-    @ApiModelProperty(value = "机构负责人")
+    @ApiModelProperty(value = "用户名称")
     private String userName;
 
     @ApiModelProperty(value = "机构地址")

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

@@ -2521,6 +2521,7 @@
                 </where>
                 GROUP BY 	DATE_FORMAT( a.signing_time, '%Y-%m' )
             )  c  on c.subSigndate=a.subSigndate
+        ORDER BY   a.subSigndate
     </select>
 
     <select id="queryDateByTypeMonthSumAmount" resultType="java.math.BigDecimal">
@@ -3138,8 +3139,8 @@
                                     and   DATE_FORMAT( a.signdate, '%Y' ) =#{vo.year}
                                 </if>
                             </where>
-
                             GROUP BY DATE_FORMAT(a.signdate, '%Y-%m')) c on c.signingTime = a.signingTime
+                            ORDER BY IFNULL( a.signingTime, 0 )
     </select>
     <select id="getPatherId" resultType="com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesMonthVo">
         SELECT

+ 14 - 12
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -1330,11 +1330,15 @@
             COUNT( CASE WHEN pa.audit_type = 2 AND ifa.auditstatus = 1 THEN 1 END ) AS "automaticAudit"
         FROM
             ins_fee_audit ifa
-                LEFT JOIN ins_area_company iac ON iac.id = ifa.ins_order_no
-                LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
-                LEFT JOIN ins_fee_order_new ion ON ion.ins_order_no = iac.id
+            LEFT JOIN ins_orders io ON io.orderno = ifa.orderno
+            LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno
+            AND iac.orderstatus = 3
+            LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
+            LEFT JOIN esm_ins_company eic ON eic.id = pa.partner_companies_id
         <where>
             1=1
+            and iac.id = ifa.ins_order_no
+            AND iac.orderstatus = 3
             <if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
                 AND   DATE_FORMAT( ifa.audittime, '%Y-%m-%d')   BETWEEN #{taskStatisticsVo.createtimeStart} AND #{taskStatisticsVo.createtimeEnd}
             </if>
@@ -1352,8 +1356,6 @@
                     and iac.product = #{taskStatisticsVo.riskCode}
                 </when>
             </choose>
-
-
         </where>
         GROUP BY
             iac.company_id,
@@ -1588,13 +1590,13 @@
         <if test="vo.days !=null  and vo.days !='' ">
             and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{vo.days} DAY)
         </if>
-        <if test="vo.provinceId != null and vo.provinceId != ''">
+        <if test="vo.provinceId != null and vo.provinceId != '' and  vo.cityId == null and vo.countyId == null  and vo.houseId == null ">
             and io.deptid like "${vo.provinceId}%"
         </if>
-        <if test="vo.cityId != null and vo.cityId != ''">
+        <if test="vo.cityId != null and vo.cityId != '' and vo.countyId ==null and  vo.houseId ==null">
             and io.deptid like "${vo.cityId}%"
         </if>
-        <if test="vo.countyId != null and vo.countyId != ''">
+        <if test="vo.countyId != null and vo.countyId != '' and  vo.houseId  ==null">
             and io.deptid like "${vo.countyId}%"
         </if>
         <if test="vo.houseId != null and vo.houseId != ''">
@@ -1629,11 +1631,11 @@
         agree.insurance_company AS "insuranceCompanyName",
         agree.partner_companies_id AS "parterCompanyId",
         ins.namesimple AS "partnerCompaniesName",
-        sum(sumpremium) as "totalPremium",
+        IFNULL(sum(iac.jqpremium),0) + IFNULL(sum(iac.sypremium),0) +IFNULL(sum(iac.jypremium),0) as "totalPremium",
         COUNT(0) AS "qutationInsureCount",
-        sum(sumpremium) /  COUNT(0) AS "averagePremium",
+        (IFNULL(sum(iac.jqpremium),0) + IFNULL(sum(iac.sypremium),0) +IFNULL(sum(iac.jypremium),0)) /  COUNT(0) AS "averagePremium",
         COUNT(DISTINCT io.userId) AS "userNumber",
-        sum(sumpremium) / COUNT(DISTINCT io.userId)  as "perCapitaAmount"
+        (IFNULL(sum(iac.jqpremium),0) + IFNULL(sum(iac.sypremium),0) +IFNULL(sum(iac.jypremium),0)) / COUNT(DISTINCT io.userId)  as "perCapitaAmount"
         FROM
         ins_area_company iac
         LEFT JOIN ptl_agreement agree ON iac.agreement_id = agree.id
@@ -1648,7 +1650,7 @@
             and agree.partner_companies_id = #{vo.parterCompanyId}
         </if>
         <if test="vo.createtimeStart  != null  and  vo.createtimeStart!=''  and vo.createtimeEnd  != null  and  vo.createtimeEnd!=''">
-            AND iac.signing_time BETWEEN #{vo.createtimeStart} AND #{vo.createtimeStart}
+            AND iac.createtime BETWEEN #{vo.createtimeStart} AND #{vo.createtimeStart}
         </if>
         <if test="vo.provinceId != null and vo.provinceId != ''">
             and io.deptid like "${vo.provinceId}%"