|
|
@@ -384,12 +384,10 @@
|
|
|
FROM show_sbxj
|
|
|
<where>
|
|
|
del_flag='0'
|
|
|
+ and file_id = (select max(id) from show_file where data_type = 'xjdx' and imp_result = '1')
|
|
|
<if test="teamName!=null and teamName!=''">
|
|
|
and team_name like concat('%', #{teamName}, '%')
|
|
|
</if>
|
|
|
- <if test="fileId!=null ">
|
|
|
- and file_id=#{fileId}
|
|
|
- </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
@@ -412,24 +410,30 @@
|
|
|
sum(plan) as planTotal,
|
|
|
sum(actual) as actualTotal,
|
|
|
round(sum(actual) * 100 / sum(plan)) as dx
|
|
|
- from (select dept_name,
|
|
|
- team_name,
|
|
|
- case when plan is not null then 1 else 0 end as plan,
|
|
|
- case when actual is not null then 1 else 0 end as actual
|
|
|
- from (select dept_name, team_name,
|
|
|
- <if test="month==1">plan1 as plan, actual1 as actual</if>
|
|
|
- <if test="month==2">plan2 as plan, actual2 as actual</if>
|
|
|
- <if test="month==3">plan3 as plan, actual3 as actual</if>
|
|
|
- <if test="month==4">plan4 as plan, actual4 as actual</if>
|
|
|
- <if test="month==5">plan5 as plan, actual5 as actual</if>
|
|
|
- <if test="month==6">plan6 as plan, actual6 as actual</if>
|
|
|
- <if test="month==7">plan7 as plan, actual7 as actual</if>
|
|
|
- <if test="month==8">plan8 as plan, actual8 as actual</if>
|
|
|
- <if test="month==9">plan9 as plan, actual9 as actual</if>
|
|
|
- <if test="month==10">plan10 as plan, actual10 as actual</if>
|
|
|
- <if test="month==11">plan11 as plan, actual11 as actual</if>
|
|
|
- <if test="month==12">plan12 as plan, actual12 as actual</if>
|
|
|
- from show_sbxj) a) b
|
|
|
+ from (
|
|
|
+ select dept_name,
|
|
|
+ team_name,
|
|
|
+ case when plan is not null then 1 else 0 end as plan,
|
|
|
+ case when actual is not null then 1 else 0 end as actual
|
|
|
+ from (
|
|
|
+ select dept_name, team_name,
|
|
|
+ <if test="month==1">plan1 as plan, actual1 as actual</if>
|
|
|
+ <if test="month==2">plan2 as plan, actual2 as actual</if>
|
|
|
+ <if test="month==3">plan3 as plan, actual3 as actual</if>
|
|
|
+ <if test="month==4">plan4 as plan, actual4 as actual</if>
|
|
|
+ <if test="month==5">plan5 as plan, actual5 as actual</if>
|
|
|
+ <if test="month==6">plan6 as plan, actual6 as actual</if>
|
|
|
+ <if test="month==7">plan7 as plan, actual7 as actual</if>
|
|
|
+ <if test="month==8">plan8 as plan, actual8 as actual</if>
|
|
|
+ <if test="month==9">plan9 as plan, actual9 as actual</if>
|
|
|
+ <if test="month==10">plan10 as plan, actual10 as actual</if>
|
|
|
+ <if test="month==11">plan11 as plan, actual11 as actual</if>
|
|
|
+ <if test="month==12">plan12 as plan, actual12 as actual</if>
|
|
|
+ from show_sbxj
|
|
|
+ where del_flag='0'
|
|
|
+ and file_id = (select max(id) from show_file where data_type = 'xjdx' and imp_result = '1')
|
|
|
+ ) a
|
|
|
+ ) b
|
|
|
group by dept_name, team_name
|
|
|
|
|
|
union
|
|
|
@@ -460,7 +464,10 @@
|
|
|
<if test="month==11">plan11 as plan, actual11 as actual</if>
|
|
|
<if test="month==12">plan12 as plan, actual12 as actual</if>
|
|
|
from show_sbxj
|
|
|
- where xb is not null) a) b
|
|
|
+ where del_flag='0'
|
|
|
+ and file_id = (select max(id) from show_file where data_type = 'xjdx' and imp_result = '1')
|
|
|
+ and xb is not null
|
|
|
+ ) a) b
|
|
|
group by dept_name, team_name
|
|
|
|
|
|
union
|
|
|
@@ -491,7 +498,9 @@
|
|
|
<if test="month==11">plan11 as plan, actual11 as actual</if>
|
|
|
<if test="month==12">plan12 as plan, actual12 as actual</if>
|
|
|
from show_sbxj
|
|
|
- where bds is not null) a) b
|
|
|
+ where del_flag='0'
|
|
|
+ and file_id = (select max(id) from show_file where data_type = 'xjdx' and imp_result = '1')
|
|
|
+ and qybds is not null) a) b
|
|
|
group by dept_name, team_name
|
|
|
|
|
|
union
|
|
|
@@ -522,7 +531,11 @@
|
|
|
<if test="month==11">plan11 as plan, actual11 as actual</if>
|
|
|
<if test="month==12">plan12 as plan, actual12 as actual</if>
|
|
|
from show_sbxj
|
|
|
- where pds is not null) a) b
|
|
|
+ where del_flag='0'
|
|
|
+ and file_id = (select max(id) from show_file where data_type = 'xjdx' and imp_result = '1')
|
|
|
+ <!-- 配电所 包含 配电所 和 10/0.4变电所 -->
|
|
|
+ and (pds is not null or bds is null)
|
|
|
+ ) a) b
|
|
|
group by dept_name, team_name
|
|
|
|
|
|
union
|
|
|
@@ -553,7 +566,9 @@
|
|
|
<if test="month==11">plan11 as plan, actual11 as actual</if>
|
|
|
<if test="month==12">plan12 as plan, actual12 as actual</if>
|
|
|
from show_sbxj
|
|
|
- where sdxl is not null) a) b
|
|
|
+ where del_flag='0'
|
|
|
+ and file_id = (select max(id) from show_file where data_type = 'xjdx' and imp_result = '1')
|
|
|
+ and sdxl is not null) a) b
|
|
|
group by dept_name, team_name
|
|
|
</select>
|
|
|
|
|
|
@@ -588,7 +603,9 @@
|
|
|
<if test="month==11">plan11 as plan, actual11 as actual</if>
|
|
|
<if test="month==12">plan12 as plan, actual12 as actual</if>
|
|
|
from show_sbxj
|
|
|
- where sdxl is not null) a) b
|
|
|
+ where del_flag='0'
|
|
|
+ and file_id = (select max(id) from show_file where data_type = 'xjdx' and imp_result = '1')
|
|
|
+ and sdxl is not null) a) b
|
|
|
group by dept_name, team_name
|
|
|
</select>
|
|
|
|