buzhanyi 2 rokov pred
rodič
commit
8a762ca9d4

+ 8 - 3
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml

@@ -148,7 +148,8 @@
         SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
         FROM `pm_demand`
         <include refid="deptListOrDemandIdAll"/>
-        now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
+        ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
+        or (real_purchase_finish_time > plan_purchase_finish_time))
         and YEAR(plan_demand_sub_time) = YEAR(NOW())
     </select>
 
@@ -157,7 +158,8 @@
         SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
         FROM `pm_demand`
         <include refid="deptListOrDemandIdAll"/>
-        now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
+        ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
+        or (real_purchase_finish_time > plan_purchase_finish_time))
         and quarter(plan_demand_sub_time) = quarter(NOW())
     </select>
 
@@ -166,6 +168,8 @@
         SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
         FROM `pm_demand`
         <include refid="deptListOrDemandIdAll"/>
+        ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
+        or (real_purchase_finish_time > plan_purchase_finish_time))
         now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
         and MONTH(plan_demand_sub_time) = MONTH(NOW())
     </select>
@@ -175,7 +179,8 @@
         SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
         FROM `pm_demand`
         <include refid="deptListOrDemandIdAll"/>
-        now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
+        ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
+        or (real_purchase_finish_time > plan_purchase_finish_time))
     </select>
 
     <select id="countProjectExceedTZ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"