Jelajahi Sumber

1. 调整导出结算表bug

785834757 8 bulan lalu
induk
melakukan
2ea1308908
1 mengubah file dengan 45 tambahan dan 18 penghapusan
  1. 45 18
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

+ 45 - 18
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -3626,12 +3626,11 @@
             iac.taxamount,
             iac.agreement_id,
             iac.docking_person,
-            su.name as operator_name,
-            (ifon.jq_costs_export_proportion + ifon.jq_export_other_costs_proportion) as jq_export_proportion,
-            (ifon.sy_costs_export_proportion + ifon.sy_export_other_costs_proportion) as sy_export_proportion,
-            (ifon.no_costs_export_proportion + ifon.no_export_other_costs_proportion) as jy_export_proportion,
-            (ifon.jq_export_supervise_costs_premiums + ifon.sy_export_supervise_costs_premiums + ifon.no_export_supervise_costs_premiums +
-             ifon.jq_export_other_costs_premiums + ifon.sy_export_other_costs_premiums + ifon.no_export_other_costs_premiums) as settlement,
+            su.NAME AS operator_name,
+            ( ifon.jq_costs_export_proportion + ifon.jq_export_other_costs_proportion ) AS jq_export_proportion,
+            ( ifon.sy_costs_export_proportion + ifon.sy_export_other_costs_proportion ) AS sy_export_proportion,
+            ( ifon.no_costs_export_proportion + ifon.no_export_other_costs_proportion ) AS jy_export_proportion,
+            ( ifon.jq_export_supervise_costs_premiums + ifon.sy_export_supervise_costs_premiums + ifon.no_export_supervise_costs_premiums + ifon.jq_export_other_costs_premiums + ifon.sy_export_other_costs_premiums + ifon.no_export_other_costs_premiums ) AS settlement,
             ifon.jq_supervise_costs_proportion,
             ifon.jq_other_costs_proportion,
             ifon.jq_supervise_costs_premiums,
@@ -3644,20 +3643,20 @@
             ifon.no_other_costs_proportion,
             ifon.no_supervise_costs_premiums,
             ifon.no_other_costs_premiums,
-            case
-                WHEN io.entry_status = 3 THEN '是'
-                ELSE '否'
-            END as is_external,
+            CASE
+
+                WHEN io.entry_status = 3 THEN
+                    '是' ELSE '否'
+                END AS is_external,
             ipi.partner_companies_name,
             ipi.insured_name,
             iac.signing_time,
-            ipi.receivable_amount as receivable,
-            case
-                WHEN pa.agreement_type = 2 THEN '保险公司'
-                ELSE '平台公司'
-            END as agreement_type
-
+            sum(ipi.receivable_amount) AS receivable,
+            CASE
 
+                WHEN pa.agreement_type = 2 THEN
+                    '保险公司' ELSE '平台公司'
+                END AS agreement_type
         FROM
             ins_orders io
                 left join ins_area_company iac ON
@@ -3677,7 +3676,35 @@
             iac.orderstatus = 3
             and
             ifa.auditstatus = 1
-          AND iac.createtime BETWEEN #{params.signStartDate}
-            AND #{params.signEndDate};
+          AND iac.signing_time BETWEEN #{params.signStartDate}
+            AND #{params.signEndDate}
+        GROUP BY io.orderno,iac.id,
+                 ifon.jq_supervise_costs_proportion,
+                 ifon.jq_other_costs_proportion,
+                 ifon.jq_supervise_costs_premiums,
+                 ifon.jq_other_costs_premiums,
+                 ifon.sy_supervise_costs_proportion,
+                 ifon.sy_other_costs_proportion,
+                 ifon.sy_supervise_costs_premiums,
+                 ifon.sy_other_costs_premiums,
+                 ifon.no_supervise_costs_proportion,
+                 ifon.no_other_costs_proportion,
+                 ifon.no_supervise_costs_premiums,
+                 ifon.no_other_costs_premiums,
+                 ifon.jq_costs_export_proportion,
+                 ifon.jq_export_other_costs_proportion,
+                 ifon.sy_costs_export_proportion,
+                 ifon.sy_export_other_costs_proportion,
+                 ifon.no_costs_export_proportion,
+                 ifon.no_export_other_costs_proportion,
+                 ipi.partner_companies_name,
+                 ipi.insured_name,
+                 iac.signing_time,
+                 ifon.jq_export_supervise_costs_premiums,
+                 ifon.sy_export_supervise_costs_premiums,
+                 ifon.no_export_supervise_costs_premiums,
+                 ifon.jq_export_other_costs_premiums,
+                 ifon.sy_export_other_costs_premiums,
+                 ifon.no_export_other_costs_premiums;
     </select>
 </mapper>