buzhanyi преди 2 години
родител
ревизия
c35c445bd9
променени са 1 файла, в които са добавени 9 реда и са изтрити 6 реда
  1. 9 6
      purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml

+ 9 - 6
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml

@@ -587,13 +587,14 @@
             resultType="java.util.Map">
         select count(a.demand_id) countNum,
         ifnull(sum(a.evaluation), 0) evaluation,
-        year(a.create_time) yy,
+        year(a.up_acceptance_time) yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, create_time, demand_id
+        select evaluation, up_acceptance_time, demand_id
         from pm_demand
         <include refid="deptListOrDemandIdAll"/>
         project_status in (15, 16, 17)
+        and up_acceptance_time!=null
         ) a
         left join (
         select contract_amount, demand_id
@@ -605,13 +606,14 @@
     <select id="selectPurchaseTaskFinishQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
         select ifnull(sum(a.evaluation), 0) evaluation,
-        quarter(a.create_time) yy,
+        quarter(a.up_acceptance_time) yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, create_time, demand_id
+        select evaluation, up_acceptance_time, demand_id
         from pm_demand
         <include refid="deptListOrDemandIdAll"/>
         project_status in (15, 16, 17)
+        and up_acceptance_time!=null
         and year(up_acceptance_time) = year(NOW())
         ) a
         left join (
@@ -624,13 +626,14 @@
     <select id="selectPurchaseTaskFinishMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
         select ifnull(sum(a.evaluation), 0) evaluation,
-        date_format(create_time, '%m') yy,
+        date_format(up_acceptance_time, '%m') yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, create_time, demand_id
+        select evaluation, up_acceptance_time, demand_id
         from pm_demand
         <include refid="deptListOrDemandIdAll"/>
         project_status in (15, 16, 17)
+        and up_acceptance_time!=null
         and year(up_acceptance_time) = year(NOW())
         ) a
         left join (