Selaa lähdekoodia

【CHG】修改查询字段

zhaomn 2 vuotta sitten
vanhempi
commit
73939d958f

+ 8 - 8
railway-business/src/main/resources/mapper/bi/ShowSbxjMapper.xml

@@ -447,8 +447,8 @@
     round(sum(actual) * 100 / sum(plan)) as dx
     from (
       select dept_name, team_name, xb,
-        case when plan is not null and plan != '' then 1 else 0 end as plan,
-        case when actual is not null and actual != '' then 1 else 0 end as actual
+        case when plan is not null and plan != '' then xb else 0 end as plan,
+        case when actual is not null and actual != '' then xb else 0 end as actual
       from (
         select dept_name, team_name, xb,
         <if test="month==1">plan1 as plan, actual1 as actual</if>
@@ -481,8 +481,8 @@
     round(sum(actual) * 100 / sum(plan)) as dx
     from (
       select dept_name, team_name, qybds,
-      case when plan is not null and plan != '' then 1 else 0 end as plan,
-      case when actual is not null and actual != '' then 1 else 0 end as actual
+      case when plan is not null and plan != '' then qybds else 0 end as plan,
+      case when actual is not null and actual != '' then qybds else 0 end as actual
       from (
         select dept_name, team_name, qybds,
         <if test="month==1">plan1 as plan, actual1 as actual</if>
@@ -516,8 +516,8 @@
     round(sum(actual) * 100 / sum(plan)) as dx
     from (
       select dept_name, team_name, pds, bds,
-      case when plan is not null and plan != '' then 1 else 0 end as plan,
-      case when actual is not null and actual != '' then 1 else 0 end as actual
+      case when plan is not null and plan != '' then pds + bds else 0 end as plan,
+      case when actual is not null and actual != '' then pds + bds else 0 end as actual
       from (
         select dept_name, team_name, pds, bds,
         <if test="month==1">plan1 as plan, actual1 as actual</if>
@@ -552,8 +552,8 @@
     round(sum(actual) * 100 / sum(plan)) as dx
     from (
       select dept_name, team_name, sdxl,
-      case when plan is not null and plan != '' then 1 else 0 end as plan,
-      case when actual is not null and actual != '' then 1 else 0 end as actual
+      case when plan is not null and plan != '' then sdxl else 0 end as plan,
+      case when actual is not null and actual != '' then sdxl else 0 end as actual
       from (
         select dept_name, team_name, sdxl,
         <if test="month==1">plan1 as plan, actual1 as actual</if>