浏览代码

feat: 不动产资源地图获取房屋维修统计接口调整sql到building_repair_month

weijianghai 1 年之前
父节点
当前提交
a2f2b64eb2
共有 1 个文件被更改,包括 17 次插入13 次删除
  1. 17 13
      src/main/java/com/nokia/financeapi/dao/house/HouseResourceMapMapper.java

+ 17 - 13
src/main/java/com/nokia/financeapi/dao/house/HouseResourceMapMapper.java

@@ -320,17 +320,19 @@ with
 t1 as (
 select
     city,
-    sum(case when repair_type = '零星维修' then amount else 0 end) as odd_sum,
-    sum(amount) as total_sum
+    sum(case when repair_type = '零星维修' then final_cost else 0 end) as odd_sum,
+    sum(final_cost) as total_sum
 from
-    house.building_repair_main_month
+    house.building_repair_month
 where
-    repair_type != '财务预提冲销'
-    and year_num = (
+    city is not null
+    and city != ''
+    and repair_type != '财务预提冲销'
+    and year_no = (
     select
-        max(year_num)
+        max(year_no)
     from
-        house.building_repair_main_month)
+        house.building_repair_month)
 group by
     city
 ),
@@ -372,17 +374,19 @@ t1 as (
 select
     city,
     district,
-    sum(case when repair_type = '零星维修' then amount else 0 end) as odd_sum,
-    sum(amount) as total_sum
+    sum(case when repair_type = '零星维修' then final_cost else 0 end) as odd_sum,
+    sum(final_cost) as total_sum
 from
-    house.building_repair_main_month
+    house.building_repair_month
 where
     repair_type != '财务预提冲销'
-    and year_num = (
+    and year_no = (
     select
-        max(year_num)
+        max(year_no)
     from
-        house.building_repair_main_month)
+        house.building_repair_month)
+    and city is not null
+    and city != ''
     and district is not null
     and district != ''
     and city = #{dto.city}