buzhanyi 2 роки тому
батько
коміт
d2446ac9d1

+ 11 - 0
purchase-admin/src/main/java/com/ozs/web/controller/statisticalAnalysis/AnalysisController.java

@@ -256,5 +256,16 @@ public class AnalysisController extends BaseController {
         return pmDemandService.countMajorProjectNumCGB(pmDemandReqVo);
     }
 
+    @ApiOperation(value = "滞留环节")
+    @PostMapping("/exceedLink")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult exceedLink(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        //    超过计划完成采购时间的各状态数量及占比统计,包括:采购需求对接、采购文件编制审核、标签质疑投诉、待开标/流废标处置、标后质疑
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        return pmDemandService.exceedLink(pmDemandReqVo);
+    }
+
 
 }

+ 21 - 0
purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandMapper.java

@@ -562,4 +562,25 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
      * @return
      */
     StatisticalChartsResVo countProjecReaAndStatus(@Param("vo") PmDemandReqVo pmDemandReqVo);
+
+    /**
+     * 统计不同时间维度的所有超过计划完成采购时间的数据
+     *
+     * @return
+     */
+    StatisticalChartsResVo countProjectACT_Year(@Param("vo") PmDemandReqVo pmDemandReqVo);
+
+    /**
+     * 统计不同时间维度的所有超过计划完成采购时间的数据
+     *
+     * @return
+     */
+    StatisticalChartsResVo countProjectACT_Qua(@Param("vo") PmDemandReqVo pmDemandReqVo);
+
+    /**
+     * 统计不同时间维度的所有超过计划完成采购时间的数据
+     *
+     * @return
+     */
+    StatisticalChartsResVo countProjectACT_Mon(@Param("vo") PmDemandReqVo pmDemandReqVo);
 }

+ 8 - 0
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandService.java

@@ -379,4 +379,12 @@ public interface IPmDemandService extends IService<PmDemand> {
      * @return
      */
     AjaxResult countMajorProjectNumCGB(PmDemandReqVo pmDemandReqVo);
+
+    /**
+     * 滞留环节
+     *
+     * @param pmDemandReqVo
+     * @return
+     */
+    AjaxResult exceedLink(PmDemandReqVo pmDemandReqVo);
 }

+ 105 - 4
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -3494,6 +3494,59 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         return AjaxResult.success(resVos);
     }
 
+    @Override
+    public AjaxResult exceedLink(PmDemandReqVo pmDemandReqVo) {
+        List<StatisticalChartsResVo> resVos = new ArrayList<>();
+        //是-1就是查询自己及子孙级以下,否则只查询指定部门
+        pmDemandReqVo.setDeptList(isQueryAll(pmDemandReqVo.getPurchaseDeptId()));
+        //滞留环节
+        //超过计划完成采购时间的各状态数量及占比统计,包括:采购需求对接、采购文件编制审核、标签质疑投诉、待开标、流废标处置、标后质疑
+        //1、 状态为“采购需求对接”的数量及预算金额
+        List<String> xqdj = new ArrayList<>();
+        xqdj.add(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
+        pmDemandReqVo.setProjectStatusList(xqdj);
+        StatisticalChartsResVo resVo = pmDemandMapper.countProjectExceedAndStatus(pmDemandReqVo);
+        resVo.setColumnName("采购需求对接");
+        resVos.add(resVo);
+        //2、 状态为“采购文件编制审核“的数量及预算金额
+        List<String> wjsh = new ArrayList<>();
+        wjsh.add(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
+        pmDemandReqVo.setProjectStatusList(wjsh);
+        StatisticalChartsResVo resVo2 = pmDemandMapper.countProjectExceedAndStatus(pmDemandReqVo);
+        resVo2.setColumnName("采购文件编制审核");
+        resVos.add(resVo2);
+        //3.标前质疑
+        List<String> bqzy = new ArrayList<>();
+        bqzy.add(PmProjectStatus.PRE_BID_QUERY.getCode());
+        pmDemandReqVo.setProjectStatusList(bqzy);
+        StatisticalChartsResVo resVo3 = pmDemandMapper.countProjectExceedAndStatus(pmDemandReqVo);
+        resVo3.setColumnName("标前质疑投诉");
+        resVos.add(resVo3);
+        //4、 待开标
+        List<String> dkb = new ArrayList<>();
+        dkb.add(PmProjectStatus.WAIT_OPEN_BID.getCode());
+        pmDemandReqVo.setProjectStatusList(dkb);
+        StatisticalChartsResVo resVo4 = pmDemandMapper.countProjectExceedAndStatus(pmDemandReqVo);
+        resVo4.setColumnName("待开标");
+        resVos.add(resVo4);
+        //5、 流废标处置
+        List<String> lfb = new ArrayList<>();
+        lfb.add(PmProjectStatus.WASTE_BID_HANDLE.getCode());
+        pmDemandReqVo.setProjectStatusList(lfb);
+        StatisticalChartsResVo resVo5 = pmDemandMapper.countProjectExceedAndStatus(pmDemandReqVo);
+        resVo5.setColumnName("流废标处置");
+        resVos.add(resVo5);
+        //6、 标后质疑
+        List<String> bhzy = new ArrayList<>();
+        bhzy.add(PmProjectStatus.POST_BID_QUERY.getCode());
+        pmDemandReqVo.setProjectStatusList(bhzy);
+        StatisticalChartsResVo resVo6 = pmDemandMapper.countProjectExceedAndStatus(pmDemandReqVo);
+        resVo6.setColumnName("标后质疑");
+        resVos.add(resVo6);
+
+        return AjaxResult.success(resVos);
+    }
+
     @Override
     public AjaxResult countPurTask(PmDemandReqVo pmDemandReqVo) {
         List<StatisticalChartsResVo> resVos = new ArrayList<>();
@@ -3513,8 +3566,6 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         resVo2.setColumnName("所属采购机构");
         resVos.add(resVo2);
         //3、新受领集中采购数量--状态为“任务待下达”之后的数据
-        List<Long> demandIdAll = questionHisService.selectDemandIdAll();
-        pmDemandReqVo.setDemandIdAll(demandIdAll);
         StatisticalChartsResVo resVo3 = pmDemandMapper.JZCGnum(pmDemandReqVo);
         resVo3.setColumnName("新受领集中采购数量");
         resVos.add(resVo3);
@@ -3539,8 +3590,58 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     @Override
     public AjaxResult countMajorProjectNumCGB(PmDemandReqVo pmDemandReqVo) {
         //新增执行滞后采购任务数量分析 所有的超过计划完成采购时间的数据
-
-        return null;
+        //是-1就是查询自己及子孙级以下,否则只查询指定部门
+        pmDemandReqVo.setDeptList(isQueryAll(pmDemandReqVo.getPurchaseDeptId()));
+        HashMap<String, List<StatisticalChartsResVo>> resMap = new HashMap<>();
+        // 查询数据库中最小的年份
+        int minYear = pmDemandMapper.selectMinYear();
+        // 获取当前年份
+        Calendar calendar = Calendar.getInstance();
+        int thisYear = calendar.get(Calendar.YEAR);
+        List<StatisticalChartsResVo> resVos = new LinkedList<>();
+        for (int i = minYear; i <= thisYear; i++) {
+            pmDemandReqVo.setYear(i);
+            StatisticalChartsResVo byYear = pmDemandMapper.countProjectACT_Year(pmDemandReqVo);
+            resVos.add(byYear);
+        }
+        if (pmDemandReqVo.getTimeType().equals("1")) {
+            resMap.put("年", resVos);
+        } else if (pmDemandReqVo.getTimeType().equals("2")) {
+            List<StatisticalChartsResVo> byQuarter = new LinkedList<>();
+            for (StatisticalChartsResVo chartsResVo : resVos) {
+                pmDemandReqVo.setYear(Integer.parseInt(chartsResVo.getColumnName()));
+                for (int i = 1; i <= 4; i++) {
+                    pmDemandReqVo.setQuarter(i);
+                    StatisticalChartsResVo quarter = pmDemandMapper.countProjectACT_Qua(pmDemandReqVo);
+                    if (ObjectUtils.isEmpty(quarter)) {
+                        StatisticalChartsResVo vo = new StatisticalChartsResVo("", 0, BigDecimal.valueOf(0), BigDecimal.valueOf(0));
+                        quarter = vo;
+                        quarter.setColumnName(chartsResVo.getColumnName() + "年第" + i + "季度");
+                    }
+                    quarter.setColumnName(chartsResVo.getColumnName() + "年第" + i + "季度");
+                    byQuarter.add(quarter);
+                }
+            }
+            resMap.put("季度", byQuarter);
+        } else if (pmDemandReqVo.getTimeType().equals("3")) {
+            List<StatisticalChartsResVo> byMonth = new LinkedList<>();
+            for (StatisticalChartsResVo chartsResVo : resVos) {
+                pmDemandReqVo.setYear(Integer.parseInt(chartsResVo.getColumnName()));
+                for (int i = 1; i <= 12; i++) {
+                    pmDemandReqVo.setMonth(i);
+                    StatisticalChartsResVo month = pmDemandMapper.countProjectACT_Mon(pmDemandReqVo);
+                    if (ObjectUtils.isEmpty(month)) {
+                        StatisticalChartsResVo vo = new StatisticalChartsResVo("", 0, BigDecimal.valueOf(0), BigDecimal.valueOf(0));
+                        month = vo;
+                        month.setColumnName(chartsResVo.getColumnName() + "年" + i + "月");
+                    }
+                    month.setColumnName(chartsResVo.getColumnName() + "年" + i + "月");
+                    byMonth.add(month);
+                }
+            }
+            resMap.put("月", byMonth);
+        }
+        return AjaxResult.success(resMap);
     }
 
     //查询不同状态下的项目数据

+ 136 - 62
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml

@@ -58,7 +58,6 @@
 
     <select id="purchaseProjectStatisticalXCJ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
-        -- DATE_FORMAT(plan_demand_sub_time,'%Y')
         select count(demand_id) countXCJ, ifnull(sum(evaluation), 0) evaluationXCJ
         from pm_demand
         where purchase_dept_id in
@@ -67,12 +66,11 @@
             #{item}
         </foreach>
         AND project_status !=17
-        and year(plan_demand_sub_time) = year(NOW())
+        and year(create_time) = year(NOW())
     </select>
 
     <select id="purchaseProjectStatisticalQNWC" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
-        -- DATE_FORMAT(plan_demand_sub_time,'%Y')
         select de.countYWC, ifnull(sum(c.contract_amount), 0) evaluationQNWC
         from pm_demand d, pm_contract_info c,
         (SELECT COUNT(demand_id) countYWC ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
@@ -360,11 +358,13 @@
             resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         <include refid="majorProjectByStatus"></include>
         AND YEAR(create_time ) = YEAR(now())-1
-        AND project_status in
-        <foreach collection="vo.projectStatusList" item="item" index="index"
-                 separator="," open="(" close=")">
-            #{item}
-        </foreach>
+        <if test="vo.projectStatusList!=null">
+            AND project_status in
+            <foreach collection="vo.projectStatusList" item="item" index="index"
+                     separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
     </select>
     <select id="majorProjectByStatusToThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
@@ -495,8 +495,8 @@
             #{item}
         </foreach>
         AND find_in_set('1', project_attr)
-        and QUARTER(create_time) = #{quarter}
-        AND YEAR(create_time) = #{year}
+        and QUARTER(create_time) = #{vo.quarter}
+        AND YEAR(create_time) = #{vo.year}
     </select>
 
     <!-- 正常推进项目 -->
@@ -528,7 +528,7 @@
     </select>
 
     <select id="selectMinYear" resultType="java.lang.Integer">
-        select min(year(plan_demand_sub_time))
+        select min(year(create_time))
         from pm_demand
     </select>
 
@@ -536,10 +536,10 @@
             resultType="java.util.Map">
         select count(a.demand_id) countNum,
         ifnull(sum(a.evaluation), 0) evaluation,
-        year(a.plan_demand_sub_time) yy,
+        year(a.create_time) yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, plan_demand_sub_time, demand_id
+        select evaluation, create_time, demand_id
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
@@ -553,16 +553,16 @@
         from pm_contract_info
         ) b on a.demand_id = b.demand_id
 
-        group by year(plan_demand_sub_time)
+        group by year(create_time)
     </select>
 
     <select id="selectpurchaseProjectCompleteNumberQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
         select ifnull(sum(a.evaluation), 0) evaluation,
-        quarter(a.plan_demand_sub_time) yy,
+        quarter(a.create_time) yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, plan_demand_sub_time, demand_id
+        select evaluation, create_time, demand_id
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
@@ -570,22 +570,22 @@
             #{item}
         </foreach>
         AND project_status = '21'
-        and year(plan_demand_sub_time) = year(NOW())
+        and year(create_time) = year(NOW())
         ) a
         left join (
         select contract_amount, demand_id
         from pm_contract_info
         ) b on a.demand_id = b.demand_id
-        group by concat(Year(a.plan_demand_sub_time), quarter(a.plan_demand_sub_time))
+        group by concat(Year(a.create_time), quarter(a.create_time))
     </select>
 
     <select id="selectpurchaseProjectCompleteNumberMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
         select ifnull(sum(a.evaluation), 0) evaluation,
-        date_format(plan_demand_sub_time, '%m') yy,
+        date_format(create_time, '%m') yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, plan_demand_sub_time, demand_id
+        select evaluation, create_time, demand_id
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
@@ -593,23 +593,23 @@
             #{item}
         </foreach>
         AND project_status = '21'
-        and year(plan_demand_sub_time) = year(NOW())
+        and year(create_time) = year(NOW())
         ) a
         left join (
         select contract_amount, demand_id
         from pm_contract_info
         ) b on a.demand_id = b.demand_id
-        group by date_format(a.plan_demand_sub_time, '%y%m')
+        group by date_format(a.create_time, '%y%m')
     </select>
 
     <select id="selectPurchaseTaskFinishYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
         select count(a.demand_id) countNum,
         ifnull(sum(a.evaluation), 0) evaluation,
-        year(a.plan_demand_sub_time) yy,
+        year(a.create_time) yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, plan_demand_sub_time, demand_id
+        select evaluation, create_time, demand_id
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
@@ -622,16 +622,16 @@
         select contract_amount, demand_id
         from pm_contract_info
         ) b on a.demand_id = b.demand_id
-        group by year(a.plan_demand_sub_time)
+        group by year(a.create_time)
     </select>
 
     <select id="selectPurchaseTaskFinishQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
         select ifnull(sum(a.evaluation), 0) evaluation,
-        quarter(a.plan_demand_sub_time) yy,
+        quarter(a.create_time) yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, plan_demand_sub_time, demand_id
+        select evaluation, create_time, demand_id
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
@@ -639,22 +639,22 @@
             #{item}
         </foreach>
         AND project_status in (15, 16, 17)
-        and year(plan_demand_sub_time) = year(NOW())
+        and year(create_time) = year(NOW())
         ) a
         left join (
         select contract_amount, demand_id
         from pm_contract_info
         ) b on a.demand_id = b.demand_id
-        group by concat(Year(a.plan_demand_sub_time), quarter(a.plan_demand_sub_time))
+        group by concat(Year(a.create_time), quarter(a.create_time))
     </select>
 
     <select id="selectPurchaseTaskFinishMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
         select ifnull(sum(a.evaluation), 0) evaluation,
-        date_format(plan_demand_sub_time, '%m') yy,
+        date_format(create_time, '%m') yy,
         ifnull(sum(b.contract_amount), 0) contractAmount
         from (
-        select evaluation, plan_demand_sub_time, demand_id
+        select evaluation, create_time, demand_id
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
@@ -662,13 +662,13 @@
             #{item}
         </foreach>
         AND project_status in (15, 16, 17)
-        and year(plan_demand_sub_time) = year(NOW())
+        and year(create_time) = year(NOW())
         ) a
         left join (
         select contract_amount, demand_id
         from pm_contract_info
         ) b on a.demand_id = b.demand_id
-        group by date_format(a.plan_demand_sub_time, '%y%m')
+        group by date_format(a.create_time, '%y%m')
     </select>
 
     <select id="countProjectExceedAndMajor" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
@@ -690,74 +690,77 @@
                  separator="," open="(" close=")">
             #{item}
         </foreach>
-        AND project_status in
-        <foreach item="item" collection="vo.projectStatusList" separator="," open="(" close=")">
-            #{item}
-        </foreach>
+        <if test="vo.projectStatusList!=null">
+            AND project_status in
+            <foreach collection="vo.projectStatusList" item="item" index="index"
+                     separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
     </select>
 
     <select id="purchaseProjectNumberAnalysisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
-        select count(demand_id) countNum, ifnull(sum(evaluation), 0) evaluationSum, year(plan_demand_sub_time) yy
+        select count(demand_id) countNum, ifnull(sum(evaluation), 0) evaluationSum, year(create_time) yy
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
                  separator="," open="(" close=")">
             #{item}
         </foreach>
-        group by year(plan_demand_sub_time)
+        group by year(create_time)
     </select>
 
     <select id="purchaseProjectNumberAnalysisQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
-        select count(demand_id) countNum, ifnull(sum(evaluation), 0) evaluationSum, quarter(plan_demand_sub_time) yy
+        select count(demand_id) countNum, ifnull(sum(evaluation), 0) evaluationSum, quarter(create_time) yy
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
                  separator="," open="(" close=")">
             #{item}
         </foreach>
-        AND year(plan_demand_sub_time) = year(NOW())
-        group by concat(Year(plan_demand_sub_time), quarter(plan_demand_sub_time))
+        AND year(create_time) = year(NOW())
+        group by concat(Year(create_time), quarter(create_time))
     </select>
 
     <select id="purchaseProjectNumberAnalysisOldYearQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
-        select count(demand_id) countNum, ifnull(sum(evaluation), 0) evaluationSum, quarter(plan_demand_sub_time) yy
+        select count(demand_id) countNum, ifnull(sum(evaluation), 0) evaluationSum, quarter(create_time) yy
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
                  separator="," open="(" close=")">
             #{item}
         </foreach>
-        AND year(plan_demand_sub_time) = year(NOW() - 1)
-        group by concat(Year(plan_demand_sub_time), quarter(plan_demand_sub_time))
+        AND year(create_time) = year(NOW() - 1)
+        group by concat(Year(create_time), quarter(create_time))
     </select>
 
     <select id="purchaseProjectNumberAnalysisMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
         select count(demand_id) countNum,
         ifnull(sum(evaluation), 0) evaluationSum,
-        date_format(plan_demand_sub_time, '%m') yy
+        date_format(create_time, '%m') yy
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
                  separator="," open="(" close=")">
             #{item}
         </foreach>
-        AND year(plan_demand_sub_time) = year(NOW())
-        group by date_format(plan_demand_sub_time, '%y%m')
+        AND year(create_time) = year(NOW())
+        group by date_format(create_time, '%y%m')
     </select>
 
     <select id="purchaseProjectNumberAnalysisOldYearMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
-        select count(demand_id)                        countNum,
-               ifnull(sum(evaluation), 0)              evaluationSum,
-               date_format(plan_demand_sub_time, '%m') yy
+        select count(demand_id)               countNum,
+               ifnull(sum(evaluation), 0)     evaluationSum,
+               date_format(create_time, '%m') yy
         from pm_demand
         where purchase_dept_id = #{purchaseDeptId}
-          AND year(plan_demand_sub_time) = YEAR(NOW()) - 1
-        group by date_format(plan_demand_sub_time, '%y%m')
+          AND year(create_time) = YEAR(NOW()) - 1
+        group by date_format(create_time, '%y%m')
     </select>
 
     <select id="selectSTSLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
@@ -946,11 +949,13 @@
                  separator="," open="(" close=")">
             #{item}
         </foreach>
-        AND project_status in
-        <foreach collection="vo.projectStatusList" item="item" index="index"
-                 separator="," open="(" close=")">
-            #{item}
-        </foreach>
+        <if test="vo.projectStatusList!=null">
+            AND project_status in
+            <foreach collection="vo.projectStatusList" item="item" index="index"
+                     separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         AND real_purchase_finish_time &gt;plan_purchase_finish_time
     </sql>
 
@@ -982,7 +987,7 @@
             #{item}
         </foreach>
         AND project_status &gt; 8
-        AND YEAR(create_time) = YEAR(NOW())
+        # AND YEAR(create_time) = YEAR(NOW())
     </select>
 
     <select id="countProjecReaAndStatus" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
@@ -994,12 +999,81 @@
                  separator="," open="(" close=")">
             #{item}
         </foreach>
-        AND project_status in
-        <foreach collection="vo.projectStatusList" item="item" index="index"
+        <if test="vo.projectStatusList!=null">
+            AND project_status in
+            <foreach collection="vo.projectStatusList" item="item" index="index"
+                     separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        and YEAR(create_time) = YEAR(NOW())-1
+    </select>
+
+
+    <select id="countProjectACT_Year" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
+            parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
+        SELECT #{vo.year} columnName, de.num, de.evaluationTotal, ifnull(sum(c.contract_amount), 0)
+        evaluationContractTotal
+        FROM pm_demand d, pm_contract_info c,
+        (SELECT COUNT(demand_id) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE purchase_dept_id
+        in
+        <foreach collection="vo.deptList" item="item" index="index"
                  separator="," open="(" close=")">
             #{item}
         </foreach>
-        and YEAR(create_time) = YEAR(NOW())-1
+        AND real_purchase_finish_time > plan_purchase_finish_time AND YEAR(create_time)=#{vo.year} ) de
+        WHERE purchase_dept_id in
+        <foreach collection="vo.deptList" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        AND d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
+        YEAR(d.create_time)=#{vo.year}
+    </select>
+
+    <select id="countProjectACT_Qua" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
+            parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
+        SELECT #{vo.year} columnName, de.num, de.evaluationTotal, ifnull(sum(c.contract_amount), 0)
+        evaluationContractTotal
+        FROM pm_demand d, pm_contract_info c,
+        (SELECT COUNT(demand_id) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE purchase_dept_id
+        in
+        <foreach collection="vo.deptList" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        AND real_purchase_finish_time > plan_purchase_finish_time AND YEAR(create_time)=#{vo.year} AND
+        QUARTER(create_time)=#{vo.quarter}) de
+        WHERE purchase_dept_id in
+        <foreach collection="vo.deptList" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        AND d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
+        YEAR(d.create_time)=#{vo.year} AND QUARTER(d.create_time)=#{vo.quarter}
+    </select>
+
+    <select id="countProjectACT_Mon" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
+            parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">SELECT #{vo.year} columnName, de.num,
+        de.evaluationTotal, ifnull(sum(c.contract_amount), 0)
+        evaluationContractTotal
+        FROM pm_demand d, pm_contract_info c,
+        (SELECT COUNT(demand_id) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE purchase_dept_id
+        in
+        <foreach collection="vo.deptList" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        AND real_purchase_finish_time > plan_purchase_finish_time AND
+        YEAR(create_time)=#{vo.year} AND month(create_time)=#{vo.month}) de
+        WHERE purchase_dept_id in
+        <foreach collection="vo.deptList" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+
+        AND d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
+        YEAR(d.create_time)=#{vo.year} AND month(d.create_time)=#{vo.month}
     </select>