|
@@ -320,17 +320,19 @@ with
|
|
t1 as (
|
|
t1 as (
|
|
select
|
|
select
|
|
city,
|
|
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
|
|
from
|
|
- house.building_repair_main_month
|
|
|
|
|
|
+ house.building_repair_month
|
|
where
|
|
where
|
|
- repair_type != '财务预提冲销'
|
|
|
|
- and year_num = (
|
|
|
|
|
|
+ city is not null
|
|
|
|
+ and city != ''
|
|
|
|
+ and repair_type != '财务预提冲销'
|
|
|
|
+ and year_no = (
|
|
select
|
|
select
|
|
- max(year_num)
|
|
|
|
|
|
+ max(year_no)
|
|
from
|
|
from
|
|
- house.building_repair_main_month)
|
|
|
|
|
|
+ house.building_repair_month)
|
|
group by
|
|
group by
|
|
city
|
|
city
|
|
),
|
|
),
|
|
@@ -372,17 +374,19 @@ t1 as (
|
|
select
|
|
select
|
|
city,
|
|
city,
|
|
district,
|
|
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
|
|
from
|
|
- house.building_repair_main_month
|
|
|
|
|
|
+ house.building_repair_month
|
|
where
|
|
where
|
|
repair_type != '财务预提冲销'
|
|
repair_type != '财务预提冲销'
|
|
- and year_num = (
|
|
|
|
|
|
+ and year_no = (
|
|
select
|
|
select
|
|
- max(year_num)
|
|
|
|
|
|
+ max(year_no)
|
|
from
|
|
from
|
|
- house.building_repair_main_month)
|
|
|
|
|
|
+ house.building_repair_month)
|
|
|
|
+ and city is not null
|
|
|
|
+ and city != ''
|
|
and district is not null
|
|
and district is not null
|
|
and district != ''
|
|
and district != ''
|
|
and city = #{dto.city}
|
|
and city = #{dto.city}
|