buzhanyi 2 年之前
父节点
当前提交
5d226312bf

+ 17 - 19
purchase-admin/src/main/java/com/ozs/web/controller/statisticalAnalysis/StatisticalAnalysisController.java

@@ -1,13 +1,11 @@
 package com.ozs.web.controller.statisticalAnalysis;
 package com.ozs.web.controller.statisticalAnalysis;
 
 
-import com.ozs.base.domain.BaseSupplier;
 import com.ozs.common.annotation.Log;
 import com.ozs.common.annotation.Log;
 import com.ozs.common.constant.ModularConstans;
 import com.ozs.common.constant.ModularConstans;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.StringUtils;
-import com.ozs.plan.service.PlanYearsService;
 import com.ozs.pm.doman.vo.requestVo.PmDemandReqVo;
 import com.ozs.pm.doman.vo.requestVo.PmDemandReqVo;
 import com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo;
 import com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo;
 import com.ozs.pm.service.IPmDemandService;
 import com.ozs.pm.service.IPmDemandService;
@@ -45,33 +43,33 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "项目属性分布")
     @ApiOperation(value = "项目属性分布")
     @PostMapping("/countByProjectAttr")
     @PostMapping("/countByProjectAttr")
-    @PreAuthorize("@ss.hasPermi('statistical:countByProjectAttr')")
+    //@PreAuthorize("@ss.hasPermi('statistical:countByProjectAttr')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult countByProjectAttr(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult countByProjectAttr(@RequestBody PmDemandReqVo pmDemandReqVo) {
         //按照项目属性统计所有的项目
         //按照项目属性统计所有的项目
         if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
         if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
             return error("登录账号的单位 不能为空!");
             return error("登录账号的单位 不能为空!");
         }
         }
-        List<StatisticalChartsResVo> resVos = pmDemandService.countByProjectAttr();
+        List<StatisticalChartsResVo> resVos = pmDemandService.countByProjectAttr(pmDemandReqVo);
         return AjaxResult.success(resVos);
         return AjaxResult.success(resVos);
     }
     }
 
 
     @ApiOperation(value = "采购方式分布")
     @ApiOperation(value = "采购方式分布")
     @PostMapping("/countByPurchaseMouth")
     @PostMapping("/countByPurchaseMouth")
-    @PreAuthorize("@ss.hasPermi('statistical:countByPurchaseMouth')")
+    //@PreAuthorize("@ss.hasPermi('statistical:countByPurchaseMouth')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult countByPurchaseMouth(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult countByPurchaseMouth(@RequestBody PmDemandReqVo pmDemandReqVo) {
         //按照项目属性统计所有的项目
         //按照项目属性统计所有的项目
         if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
         if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
             return error("登录账号的单位 不能为空!");
             return error("登录账号的单位 不能为空!");
         }
         }
-        List<StatisticalChartsResVo> resVos = pmDemandService.countByPurchaseMode();
+        List<StatisticalChartsResVo> resVos = pmDemandService.countByPurchaseMode(pmDemandReqVo);
         return AjaxResult.success(resVos);
         return AjaxResult.success(resVos);
     }
     }
 
 
     @ApiOperation(value = "项目金额分布")
     @ApiOperation(value = "项目金额分布")
     @PostMapping("/countByEvaluation")
     @PostMapping("/countByEvaluation")
-    @PreAuthorize("@ss.hasPermi('statistical:countByEvaluation')")
+    //@PreAuthorize("@ss.hasPermi('statistical:countByEvaluation')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult countByEvaluation(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult countByEvaluation(@RequestBody PmDemandReqVo pmDemandReqVo) {
         //按照概算金额统计所有的项目
         //按照概算金额统计所有的项目
@@ -85,7 +83,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "执行滞后采购项目情况")
     @ApiOperation(value = "执行滞后采购项目情况")
     @PostMapping("/countProjectExceed")
     @PostMapping("/countProjectExceed")
-    @PreAuthorize("@ss.hasPermi('statistical:countProjectExceed')")
+    //@PreAuthorize("@ss.hasPermi('statistical:countProjectExceed')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult countProjectExceed(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult countProjectExceed(@RequestBody PmDemandReqVo pmDemandReqVo) {
         //执行滞后采购项目:本年度所有的逾期项目数
         //执行滞后采购项目:本年度所有的逾期项目数
@@ -99,7 +97,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "滞后项目数量分析")
     @ApiOperation(value = "滞后项目数量分析")
     @PostMapping("/exceedAnalysis")
     @PostMapping("/exceedAnalysis")
-    @PreAuthorize("@ss.hasPermi('statistical:exceedAnalysis')")
+    //@PreAuthorize("@ss.hasPermi('statistical:exceedAnalysis')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult exceedAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult exceedAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
         //统计不同时间维度的逾期项目
         //统计不同时间维度的逾期项目
@@ -115,7 +113,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "滞后项目时长分析")
     @ApiOperation(value = "滞后项目时长分析")
     @PostMapping("/exceedMarketAnalysis")
     @PostMapping("/exceedMarketAnalysis")
-    @PreAuthorize("@ss.hasPermi('statistical:exceedMarketAnalysis')")
+    //@PreAuthorize("@ss.hasPermi('statistical:exceedMarketAnalysis')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult exceedMarketAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult exceedMarketAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
         //按照滞后时长统计项目数量
         //按照滞后时长统计项目数量
@@ -128,7 +126,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "采购项目信息统计")
     @ApiOperation(value = "采购项目信息统计")
     @PostMapping("/purchaseProjectStatistical")
     @PostMapping("/purchaseProjectStatistical")
-    @PreAuthorize("@ss.hasPermi('statistical:purchaseProjectStatistical')")
+    //@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectStatistical')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult purchaseProjectStatistical(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult purchaseProjectStatistical(@RequestBody PmDemandReqVo pmDemandReqVo) {
         // 需求单位可查看本单位及其下属单位的统计数据
         // 需求单位可查看本单位及其下属单位的统计数据
@@ -153,7 +151,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "任务数量趋势分析")
     @ApiOperation(value = "任务数量趋势分析")
     @PostMapping("/taskQuantityAnalysis")
     @PostMapping("/taskQuantityAnalysis")
-    @PreAuthorize("@ss.hasPermi('statistical:taskQuantityAnalysis')")
+    //@PreAuthorize("@ss.hasPermi('statistical:taskQuantityAnalysis')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult taskQuantityAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult taskQuantityAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
         //任务数量趋势分析:按照月、季度、年统计“项目属性”字段中“重大规划”属性的项目
         //任务数量趋势分析:按照月、季度、年统计“项目属性”字段中“重大规划”属性的项目
@@ -169,7 +167,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "各阶段采购任务数量分布")
     @ApiOperation(value = "各阶段采购任务数量分布")
     @PostMapping("/countEveryStatusNum")
     @PostMapping("/countEveryStatusNum")
-    @PreAuthorize("@ss.hasPermi('statistical:countEveryStatusNum')")
+    //@PreAuthorize("@ss.hasPermi('statistical:countEveryStatusNum')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult countEveryStatusNum(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult countEveryStatusNum(@RequestBody PmDemandReqVo pmDemandReqVo) {
         //指项目进行到各个阶段的数量
         //指项目进行到各个阶段的数量
@@ -183,7 +181,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "项目执行进度统计")
     @ApiOperation(value = "项目执行进度统计")
     @PostMapping("/purchaseProjectExecute")
     @PostMapping("/purchaseProjectExecute")
-    @PreAuthorize("@ss.hasPermi('statistical:purchaseProjectExecute')")
+    //@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectExecute')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult purchaseProjectExecute(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult purchaseProjectExecute(@RequestBody PmDemandReqVo pmDemandReqVo) {
         // 需求单位可查看本单位及其下属单位的统计数据
         // 需求单位可查看本单位及其下属单位的统计数据
@@ -196,7 +194,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "已完成项目数量统计")
     @ApiOperation(value = "已完成项目数量统计")
     @PostMapping("/purchaseProjectCompleteNumber")
     @PostMapping("/purchaseProjectCompleteNumber")
-    @PreAuthorize("@ss.hasPermi('statistical:purchaseProjectCompleteNumber')")
+    //@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectCompleteNumber')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult purchaseProjectCompleteNumber(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult purchaseProjectCompleteNumber(@RequestBody PmDemandReqVo pmDemandReqVo) {
         // 需求单位可查看本单位及其下属单位的统计数据
         // 需求单位可查看本单位及其下属单位的统计数据
@@ -212,7 +210,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "已完成采购任务数量")
     @ApiOperation(value = "已完成采购任务数量")
     @PostMapping("/purchaseTaskFinish")
     @PostMapping("/purchaseTaskFinish")
-    @PreAuthorize("@ss.hasPermi('statistical:purchaseTaskFinish')")
+    //@PreAuthorize("@ss.hasPermi('statistical:purchaseTaskFinish')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult purchaseTaskFinish(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult purchaseTaskFinish(@RequestBody PmDemandReqVo pmDemandReqVo) {
         // 需求单位可查看本单位及其下属单位的统计数据
         // 需求单位可查看本单位及其下属单位的统计数据
@@ -228,7 +226,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "各阶段项目数量分布")
     @ApiOperation(value = "各阶段项目数量分布")
     @PostMapping("/purchaseProjectDistribution")
     @PostMapping("/purchaseProjectDistribution")
-    @PreAuthorize("@ss.hasPermi('statistical:purchaseProjectDistribution')")
+    //@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectDistribution')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult purchaseProjectDistribution(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult purchaseProjectDistribution(@RequestBody PmDemandReqVo pmDemandReqVo) {
         // 需求单位可查看本单位及其下属单位的统计数据
         // 需求单位可查看本单位及其下属单位的统计数据
@@ -241,7 +239,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "采购项目--项目数量分析/预算金额(万元)")
     @ApiOperation(value = "采购项目--项目数量分析/预算金额(万元)")
     @PostMapping("/purchaseProjectNumberAnalysis")
     @PostMapping("/purchaseProjectNumberAnalysis")
-    @PreAuthorize("@ss.hasPermi('statistical:purchaseProjectNumberAnalysis')")
+    //@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectNumberAnalysis')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult purchaseProjectNumberAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
     public AjaxResult purchaseProjectNumberAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
         // 需求单位可查看本单位及其下属单位的统计数据
         // 需求单位可查看本单位及其下属单位的统计数据
@@ -257,7 +255,7 @@ public class StatisticalAnalysisController extends BaseController {
 
 
     @ApiOperation(value = "生成分析报告")
     @ApiOperation(value = "生成分析报告")
     @PostMapping("/generateAnalysisReport")
     @PostMapping("/generateAnalysisReport")
-    @PreAuthorize("@ss.hasPermi('statistical:generateAnalysisReport')")
+    //@PreAuthorize("@ss.hasPermi('statistical:generateAnalysisReport')")
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
     public AjaxResult generateAnalysisReport(@RequestBody SysFileInfo file) {
     public AjaxResult generateAnalysisReport(@RequestBody SysFileInfo file) {
         //  创建一个document对象,相当于新建一个word文档(后缀名为.docx)。
         //  创建一个document对象,相当于新建一个word文档(后缀名为.docx)。

+ 45 - 13
purchase-system/src/main/java/com/ozs/pm/doman/vo/requestVo/PmDemandReqVo.java

@@ -23,42 +23,59 @@ import java.util.List;
 @NoArgsConstructor
 @NoArgsConstructor
 @Builder
 @Builder
 @ApiModel("采购需求查询对象")
 @ApiModel("采购需求查询对象")
-public class PmDemandReqVo extends PageVo
-{
-    /** 主键 */
+public class PmDemandReqVo extends PageVo {
+    /**
+     * 主键
+     */
     @ApiModelProperty("主键")
     @ApiModelProperty("主键")
     private Long demandId;
     private Long demandId;
 
 
-    /** 项目名称 */
+    /**
+     * 项目名称
+     */
     @ApiModelProperty("项目名称")
     @ApiModelProperty("项目名称")
     private String projectName;
     private String projectName;
 
 
-    /** 采购服务站 */
+    /**
+     * 采购服务站
+     */
     @ApiModelProperty("采购服务站")
     @ApiModelProperty("采购服务站")
     private String purchaseServices;
     private String purchaseServices;
 
 
 
 
-    /** 项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:任务待下达,8:任务已下达,9:中标信息待填制,10:中标信息已填制,11:合同待填制,12:合同已填制,13:项目建设中,14:项目建设完成) */
+    /**
+     * 项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:任务待下达,8:任务已下达,9:中标信息待填制,10:中标信息已填制,11:合同待填制,12:合同已填制,13:项目建设中,14:项目建设完成)
+     */
     @ApiModelProperty("项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:任务待下达,8:任务已下达,9:中标信息待填制,10:中标信息已填制,11:合同待填制,12:合同已填制,13:项目建设中,14:项目建设完成)")
     @ApiModelProperty("项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:任务待下达,8:任务已下达,9:中标信息待填制,10:中标信息已填制,11:合同待填制,12:合同已填制,13:项目建设中,14:项目建设完成)")
     private Long projectStatus;
     private Long projectStatus;
 
 
-    /** 预警状态(0:正常,1:需求提报预警,2:采购完成预警,3:计划交付预警 */
+    /**
+     * 预警状态(0:正常,1:需求提报预警,2:采购完成预警,3:计划交付预警
+     */
     @ApiModelProperty("预警状态(0:正常,1:需求提报预警,2:采购完成预警,3:计划交付预警")
     @ApiModelProperty("预警状态(0:正常,1:需求提报预警,2:采购完成预警,3:计划交付预警")
     private String warnStatus;
     private String warnStatus;
 
 
-    /** 是否为超限额计划(0:未超额,1:超额) */
+    /**
+     * 是否为超限额计划(0:未超额,1:超额)
+     */
     @ApiModelProperty("是否为超限额计划(0:未超额,1:超额)")
     @ApiModelProperty("是否为超限额计划(0:未超额,1:超额)")
     private Integer isExcess;
     private Integer isExcess;
 
 
-    /** 开始日期 */
+    /**
+     * 开始日期
+     */
     @ApiModelProperty("开始日期 yyyy-MM-dd")
     @ApiModelProperty("开始日期 yyyy-MM-dd")
     private String beginDate;
     private String beginDate;
 
 
-    /** 结束日期 */
+    /**
+     * 结束日期
+     */
     @ApiModelProperty("结束日期 yyyy-MM-dd")
     @ApiModelProperty("结束日期 yyyy-MM-dd")
     private String endDate;
     private String endDate;
 
 
-    /** 退回原因 */
+    /**
+     * 退回原因
+     */
     @ApiModelProperty("退回原因")
     @ApiModelProperty("退回原因")
     private String refuseReason;
     private String refuseReason;
     /**
     /**
@@ -73,17 +90,32 @@ public class PmDemandReqVo extends PageVo
     @ApiModelProperty("上传附件")
     @ApiModelProperty("上传附件")
     private List<SysFileRef> sysFileRefs;
     private List<SysFileRef> sysFileRefs;
 
 
-    /** 流程图中的模块名称 */
+    /**
+     * 流程图中的模块名称
+     */
     @ApiModelProperty("流程图中的模块名称")
     @ApiModelProperty("流程图中的模块名称")
     private String moduleName;
     private String moduleName;
 
 
-    /** 查看详情的类型 */
+    /**
+     * 查看详情的类型
+     */
     @ApiModelProperty("详情类型,1项目计划,2需求建档,3任务下达,4中标信息,5合同信息,6建设情况")
     @ApiModelProperty("详情类型,1项目计划,2需求建档,3任务下达,4中标信息,5合同信息,6建设情况")
     private String detailType;
     private String detailType;
 
 
     @ApiModelProperty("采购单位(登录账号的单位)")
     @ApiModelProperty("采购单位(登录账号的单位)")
     private Integer purchaseDeptId;
     private Integer purchaseDeptId;
 
 
+    /**
+     * 金额
+     */
+    private Integer evaluation;
+    private Integer evaluationEnd;
+
+    /**
+     * 查询统计参数,年、季度、月
+     */
+    private Integer year, quarter, month;
+
     @ApiModelProperty("统计时间类型 1:年度,2:季度,3:月份")
     @ApiModelProperty("统计时间类型 1:年度,2:季度,3:月份")
     private String timeType;
     private String timeType;
 
 

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

@@ -74,76 +74,76 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
      *
      *
      * @return
      * @return
      */
      */
-    List<StatisticalChartsResVo> countByProjectAttr();
+    List<StatisticalChartsResVo> countByProjectAttr(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 按照采购方式统计所有的项目
      * 按照采购方式统计所有的项目
      *
      *
      * @return
      * @return
      */
      */
-    List<StatisticalChartsResVo> countByPurchaseMode();
+    List<StatisticalChartsResVo> countByPurchaseMode(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 按照概算金额统计所有的项目
      * 按照概算金额统计所有的项目
      *
      *
      * @return
      * @return
      */
      */
-    StatisticalChartsResVo countByEvaluationLt(Integer evaluation);
+    StatisticalChartsResVo countByEvaluationLt(PmDemandReqVo pmDemandReqVo);
 
 
-    StatisticalChartsResVo countByEvaluationBet(@Param("evaluation") Integer evaluation, @Param("evaluationEnd") Integer evaluationEnd);
+    StatisticalChartsResVo countByEvaluationBet(PmDemandReqVo pmDemandReqVo);
 
 
-    StatisticalChartsResVo countByEvaluationGt(Integer evaluation);
+    StatisticalChartsResVo countByEvaluationGt(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 本年度所有的逾期项目数
      * 本年度所有的逾期项目数
      *
      *
      * @return
      * @return
      */
      */
-    StatisticalChartsResVo countProjectExceed();
+    StatisticalChartsResVo countProjectExceed(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 年度逾期项目数量
      * 年度逾期项目数量
      *
      *
      * @return
      * @return
      */
      */
-    Integer countThisYear();
+    Integer countThisYear(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 统计不同时间维度的逾期项目
      * 统计不同时间维度的逾期项目
      *
      *
      * @return
      * @return
      */
      */
-    LinkedList<StatisticalChartsResVo> countProjectExceedYear();
+    LinkedList<StatisticalChartsResVo> countProjectExceedYear(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 统计不同时间维度的逾期项目
      * 统计不同时间维度的逾期项目
      *
      *
      * @return
      * @return
      */
      */
-    StatisticalChartsResVo countProjectExceedMonth(@Param("month") Integer month, @Param("year") Integer year);
+    StatisticalChartsResVo countProjectExceedMonth(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 统计不同时间维度的逾期项目
      * 统计不同时间维度的逾期项目
      *
      *
      * @return
      * @return
      */
      */
-    StatisticalChartsResVo countProjectExceedQuarter(@Param("quarter") Integer quarter, @Param("year") Integer year);
+    StatisticalChartsResVo countProjectExceedQuarter(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 所有滞后
      * 所有滞后
      *
      *
      * @return
      * @return
      */
      */
-    List<PmDemand> countProjectExceedAll();
+    List<PmDemand> countProjectExceedAll(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * //***状态:指本年度正在进行中的项目属性为“重大规划”的项目数
      * //***状态:指本年度正在进行中的项目属性为“重大规划”的项目数
      * //预算金额:指本年度正在进行中的项目属性为“重大规划”的项目累加的预算金额
      * //预算金额:指本年度正在进行中的项目属性为“重大规划”的项目累加的预算金额
      *
      *
-     * @param code
+     * @param
      * @return
      * @return
      */
      */
-    StatisticalChartsResVo majorProjectByStatus(String code);
+    StatisticalChartsResVo majorProjectByStatus(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * //执行滞后数量:指本年度逾期项目中,项目属性为“重大规划”的项目数
      * //执行滞后数量:指本年度逾期项目中,项目属性为“重大规划”的项目数
@@ -166,7 +166,7 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
     /**
     /**
      * @return
      * @return
      */
      */
-    List<StatisticalChartsResVo> countEveryStatusNum();
+    List<StatisticalChartsResVo> countEveryStatusNum(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 通过计划ID查询项目
      * 通过计划ID查询项目
@@ -249,15 +249,15 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
 
 
     List<StatisticalChartsResVo> countProjectMajorByYear();
     List<StatisticalChartsResVo> countProjectMajorByYear();
 
 
-    StatisticalChartsResVo countProjectMajorByQuarter(@Param("quarter") Integer quarter, @Param("year") Integer year);
+    StatisticalChartsResVo countProjectMajorByQuarter(PmDemandReqVo pmDemandReqVo);
 
 
-    List<StatisticalChartsResVo> countProjectMajorByMonth();
+    List<StatisticalChartsResVo> countProjectMajorByMonth(PmDemandReqVo pmDemandReqVo);
 
 
     List<StatisticalChartsResVo> countEveryStatusNumTwo();
     List<StatisticalChartsResVo> countEveryStatusNumTwo();
 
 
-    StatisticalChartsResVo countMajorProjectExceed();
+    StatisticalChartsResVo countMajorProjectExceed(PmDemandReqVo pmDemandReqVo);
 
 
-    StatisticalChartsResVo countMajorProjectLastYear();
+    StatisticalChartsResVo countMajorProjectLastYear(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 各阶段项目数量分布
      * 各阶段项目数量分布

+ 4 - 2
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandService.java

@@ -238,7 +238,7 @@ public interface IPmDemandService extends IService<PmDemand> {
      * @param
      * @param
      * @return
      * @return
      */
      */
-    List<StatisticalChartsResVo> countByProjectAttr();
+    List<StatisticalChartsResVo> countByProjectAttr(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 统计分析-按照采购方式统计所有的项目
      * 统计分析-按照采购方式统计所有的项目
@@ -246,7 +246,7 @@ public interface IPmDemandService extends IService<PmDemand> {
      * @param
      * @param
      * @return
      * @return
      */
      */
-    List<StatisticalChartsResVo> countByPurchaseMode();
+    List<StatisticalChartsResVo> countByPurchaseMode(PmDemandReqVo pmDemandReqVo);
 
 
     /**
     /**
      * 统计分析-按照概算金额统计所有的项目
      * 统计分析-按照概算金额统计所有的项目
@@ -308,6 +308,7 @@ public interface IPmDemandService extends IService<PmDemand> {
 
 
     /**
     /**
      * 项目执行进度统计
      * 项目执行进度统计
+     *
      * @param pmDemandReqVo
      * @param pmDemandReqVo
      * @return
      * @return
      */
      */
@@ -339,6 +340,7 @@ public interface IPmDemandService extends IService<PmDemand> {
 
 
     /**
     /**
      * 项目数量分析
      * 项目数量分析
+     *
      * @param pmDemandReqVo
      * @param pmDemandReqVo
      * @return
      * @return
      */
      */

+ 49 - 31
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -1029,7 +1029,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         }
         }
 
 
         String professional = pmBaseExpertExtractReqVo.getProfessional();
         String professional = pmBaseExpertExtractReqVo.getProfessional();
-        if ( ObjectUtils.isEmpty(professional)) {
+        if (ObjectUtils.isEmpty(professional)) {
             throw new Exception("必须选择专家专业");
             throw new Exception("必须选择专家专业");
         }
         }
 
 
@@ -1110,7 +1110,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                 String[] arr2 = majorType.split(",");
                 String[] arr2 = majorType.split(",");
                 List<String> majorTypeList = Arrays.asList(arr2);
                 List<String> majorTypeList = Arrays.asList(arr2);
                 if (!hasIntersection(professionalList, majorTypeList)) { //不符合专业类型
                 if (!hasIntersection(professionalList, majorTypeList)) { //不符合专业类型
-                   continue;
+                    continue;
                 }
                 }
             }
             }
             //备用专家
             //备用专家
@@ -1156,24 +1156,24 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         }
         }
 
 
         List<Integer> allExpertIdList = new ArrayList<>();
         List<Integer> allExpertIdList = new ArrayList<>();
-        if(!ObjectUtils.isEmpty(alltExpertList)){
-            for(BaseExpert baseExpert : alltExpertList){
+        if (!ObjectUtils.isEmpty(alltExpertList)) {
+            for (BaseExpert baseExpert : alltExpertList) {
                 allExpertIdList.add(baseExpert.getId());
                 allExpertIdList.add(baseExpert.getId());
             }
             }
         }
         }
 
 
         if (!ObjectUtils.isEmpty(spareExpertList)) {
         if (!ObjectUtils.isEmpty(spareExpertList)) {
             List<BaseExpert> spareExpertListNew = new ArrayList<>();
             List<BaseExpert> spareExpertListNew = new ArrayList<>();
-            if(!ObjectUtils.isEmpty(allExpertIdList)){ //去重
-                for(BaseExpert baseExpert : spareExpertList){
-                    if(!allExpertIdList.contains(baseExpert.getId())){
+            if (!ObjectUtils.isEmpty(allExpertIdList)) { //去重
+                for (BaseExpert baseExpert : spareExpertList) {
+                    if (!allExpertIdList.contains(baseExpert.getId())) {
                         spareExpertListNew.add(baseExpert);
                         spareExpertListNew.add(baseExpert);
                     }
                     }
                 }
                 }
             } else {
             } else {
                 spareExpertListNew = spareExpertList;
                 spareExpertListNew = spareExpertList;
             }
             }
-            if(!ObjectUtils.isEmpty(spareExpertListNew)){
+            if (!ObjectUtils.isEmpty(spareExpertListNew)) {
                 alltExpertList.addAll(RandomUtil.getRandomList(spareExpertListNew, spareExpertNumber));
                 alltExpertList.addAll(RandomUtil.getRandomList(spareExpertListNew, spareExpertNumber));
             }
             }
         }
         }
@@ -1775,8 +1775,8 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     }
     }
 
 
     @Override
     @Override
-    public List<StatisticalChartsResVo> countByProjectAttr() {
-        List<StatisticalChartsResVo> resVos = pmDemandMapper.countByProjectAttr();
+    public List<StatisticalChartsResVo> countByProjectAttr(PmDemandReqVo pmDemandReqVo) {
+        List<StatisticalChartsResVo> resVos = pmDemandMapper.countByProjectAttr(pmDemandReqVo);
         for (StatisticalChartsResVo chartsResVo : resVos) {
         for (StatisticalChartsResVo chartsResVo : resVos) {
             for (PmProjectStatus value : PmProjectStatus.values()) {
             for (PmProjectStatus value : PmProjectStatus.values()) {
                 if (value.getCode().equals(chartsResVo.getColumnName())) {
                 if (value.getCode().equals(chartsResVo.getColumnName())) {
@@ -1789,8 +1789,8 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     }
     }
 
 
     @Override
     @Override
-    public List<StatisticalChartsResVo> countByPurchaseMode() {
-        List<StatisticalChartsResVo> resVos = pmDemandMapper.countByPurchaseMode();
+    public List<StatisticalChartsResVo> countByPurchaseMode(PmDemandReqVo pmDemandReqVo) {
+        List<StatisticalChartsResVo> resVos = pmDemandMapper.countByPurchaseMode(pmDemandReqVo);
         for (StatisticalChartsResVo chartsResVo : resVos) {
         for (StatisticalChartsResVo chartsResVo : resVos) {
             for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
             for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
                 if (value.getCode().equals(chartsResVo.getColumnName())) {
                 if (value.getCode().equals(chartsResVo.getColumnName())) {
@@ -1806,22 +1806,32 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     public List<StatisticalChartsResVo> countByEvaluation(PmDemandReqVo pmDemandReqVo) {
     public List<StatisticalChartsResVo> countByEvaluation(PmDemandReqVo pmDemandReqVo) {
         List<StatisticalChartsResVo> resVos = new ArrayList<>();
         List<StatisticalChartsResVo> resVos = new ArrayList<>();
         //概算金额包括:100万以下采购任务、100至500万元采购任务、500至1000万元采购任务、1000至5000万元采购任务、5000至1亿元采购任务、1亿元及以上采购任务
         //概算金额包括:100万以下采购任务、100至500万元采购任务、500至1000万元采购任务、1000至5000万元采购任务、5000至1亿元采购任务、1亿元及以上采购任务
-        StatisticalChartsResVo resVo = pmDemandMapper.countByEvaluationLt(100);
+        pmDemandReqVo.setEvaluation(100);
+        StatisticalChartsResVo resVo = pmDemandMapper.countByEvaluationLt(pmDemandReqVo);
         resVo.setColumnName("100万以下采购任务");
         resVo.setColumnName("100万以下采购任务");
         resVos.add(resVo);
         resVos.add(resVo);
-        StatisticalChartsResVo resVo1 = pmDemandMapper.countByEvaluationBet(100, 500);
+        pmDemandReqVo.setEvaluation(100);
+        pmDemandReqVo.setEvaluationEnd(500);
+        StatisticalChartsResVo resVo1 = pmDemandMapper.countByEvaluationBet(pmDemandReqVo);
         resVo1.setColumnName("100至500万元采购任务");
         resVo1.setColumnName("100至500万元采购任务");
         resVos.add(resVo1);
         resVos.add(resVo1);
-        StatisticalChartsResVo resVo2 = pmDemandMapper.countByEvaluationBet(500, 1000);
+        pmDemandReqVo.setEvaluation(500);
+        pmDemandReqVo.setEvaluationEnd(1000);
+        StatisticalChartsResVo resVo2 = pmDemandMapper.countByEvaluationBet(pmDemandReqVo);
         resVo2.setColumnName("500至1000万元采购任务");
         resVo2.setColumnName("500至1000万元采购任务");
         resVos.add(resVo2);
         resVos.add(resVo2);
-        StatisticalChartsResVo resVo3 = pmDemandMapper.countByEvaluationBet(1000, 5000);
+        pmDemandReqVo.setEvaluation(1000);
+        pmDemandReqVo.setEvaluationEnd(5000);
+        StatisticalChartsResVo resVo3 = pmDemandMapper.countByEvaluationBet(pmDemandReqVo);
         resVo3.setColumnName("1000至5000万元采购任务");
         resVo3.setColumnName("1000至5000万元采购任务");
         resVos.add(resVo3);
         resVos.add(resVo3);
-        StatisticalChartsResVo resVo4 = pmDemandMapper.countByEvaluationBet(5000, 10000);
+        pmDemandReqVo.setEvaluation(5000);
+        pmDemandReqVo.setEvaluationEnd(10000);
+        StatisticalChartsResVo resVo4 = pmDemandMapper.countByEvaluationBet(pmDemandReqVo);
         resVo4.setColumnName("5000至1亿元采购任务");
         resVo4.setColumnName("5000至1亿元采购任务");
         resVos.add(resVo4);
         resVos.add(resVo4);
-        StatisticalChartsResVo resVo5 = pmDemandMapper.countByEvaluationGt(10000);
+        pmDemandReqVo.setEvaluation(10000);
+        StatisticalChartsResVo resVo5 = pmDemandMapper.countByEvaluationGt(pmDemandReqVo);
         resVo5.setColumnName("1亿元及以上采购任务");
         resVo5.setColumnName("1亿元及以上采购任务");
         resVos.add(resVo5);
         resVos.add(resVo5);
         return resVos;
         return resVos;
@@ -1832,11 +1842,11 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         HashMap<String, String> resMap = new HashMap<>();
         HashMap<String, String> resMap = new HashMap<>();
         //执行滞后采购项目:本年度所有的逾期项目数
         //执行滞后采购项目:本年度所有的逾期项目数
         //预算金额:本年度所有逾期项目累加的预算金额
         //预算金额:本年度所有逾期项目累加的预算金额
-        StatisticalChartsResVo resVo = pmDemandMapper.countProjectExceed();
+        StatisticalChartsResVo resVo = pmDemandMapper.countProjectExceed(pmDemandReqVo);
         resMap.put("执行滞后采购项目", resVo.getNum());
         resMap.put("执行滞后采购项目", resVo.getNum());
         resMap.put("预算金额", resVo.getEvaluationTotal());
         resMap.put("预算金额", resVo.getEvaluationTotal());
         //滞后项目数量占比:指本年度逾期项目数量/本年度所有项目数量
         //滞后项目数量占比:指本年度逾期项目数量/本年度所有项目数量
-        Integer thisYear = pmDemandMapper.countThisYear();
+        Integer thisYear = pmDemandMapper.countThisYear(pmDemandReqVo);
         resMap.put("滞后项目数量占比", getPercent(Integer.parseInt(resVo.getNum()), thisYear));
         resMap.put("滞后项目数量占比", getPercent(Integer.parseInt(resVo.getNum()), thisYear));
         return AjaxResult.success(resMap);
         return AjaxResult.success(resMap);
     }
     }
@@ -1849,14 +1859,16 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     @Override
     @Override
     public AjaxResult exceedAnalysis(PmDemandReqVo pmDemandReqVo) {
     public AjaxResult exceedAnalysis(PmDemandReqVo pmDemandReqVo) {
         HashMap<String, List<StatisticalChartsResVo>> resMap = new HashMap<>();
         HashMap<String, List<StatisticalChartsResVo>> resMap = new HashMap<>();
-        List<StatisticalChartsResVo> byYear = pmDemandMapper.countProjectExceedYear();
+        List<StatisticalChartsResVo> byYear = pmDemandMapper.countProjectExceedYear(pmDemandReqVo);
         if (pmDemandReqVo.getTimeType().equals("1")) {
         if (pmDemandReqVo.getTimeType().equals("1")) {
             resMap.put("年", byYear);
             resMap.put("年", byYear);
         } else if (pmDemandReqVo.getTimeType().equals("2")) {
         } else if (pmDemandReqVo.getTimeType().equals("2")) {
             List<StatisticalChartsResVo> byQuarter = new LinkedList<>();
             List<StatisticalChartsResVo> byQuarter = new LinkedList<>();
             for (StatisticalChartsResVo chartsResVo : byYear) {
             for (StatisticalChartsResVo chartsResVo : byYear) {
+                pmDemandReqVo.setYear(Integer.parseInt(chartsResVo.getColumnName()));
                 for (int i = 1; i <= 4; i++) {
                 for (int i = 1; i <= 4; i++) {
-                    StatisticalChartsResVo quarter = pmDemandMapper.countProjectExceedQuarter(i, Integer.parseInt(chartsResVo.getColumnName()));
+                    pmDemandReqVo.setQuarter(i);
+                    StatisticalChartsResVo quarter = pmDemandMapper.countProjectExceedQuarter(pmDemandReqVo);
                     if (ObjectUtils.isEmpty(quarter)) {
                     if (ObjectUtils.isEmpty(quarter)) {
                         StatisticalChartsResVo vo = new StatisticalChartsResVo("", "0", "0");
                         StatisticalChartsResVo vo = new StatisticalChartsResVo("", "0", "0");
                         quarter = vo;
                         quarter = vo;
@@ -1870,8 +1882,10 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         } else if (pmDemandReqVo.getTimeType().equals("3")) {
         } else if (pmDemandReqVo.getTimeType().equals("3")) {
             List<StatisticalChartsResVo> byMonth = new LinkedList<>();
             List<StatisticalChartsResVo> byMonth = new LinkedList<>();
             for (StatisticalChartsResVo chartsResVo : byYear) {
             for (StatisticalChartsResVo chartsResVo : byYear) {
+                pmDemandReqVo.setYear(Integer.parseInt(chartsResVo.getColumnName()));
                 for (int i = 1; i <= 12; i++) {
                 for (int i = 1; i <= 12; i++) {
-                    StatisticalChartsResVo month = pmDemandMapper.countProjectExceedMonth(i, Integer.parseInt(chartsResVo.getColumnName()));
+                    pmDemandReqVo.setMonth(i);
+                    StatisticalChartsResVo month = pmDemandMapper.countProjectExceedMonth(pmDemandReqVo);
                     if (ObjectUtils.isEmpty(month)) {
                     if (ObjectUtils.isEmpty(month)) {
                         StatisticalChartsResVo vo = new StatisticalChartsResVo("", "0", "0");
                         StatisticalChartsResVo vo = new StatisticalChartsResVo("", "0", "0");
                         month = vo;
                         month = vo;
@@ -1896,15 +1910,17 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         } else if (pmDemandReqVo.getTimeType().equals("2")) {
         } else if (pmDemandReqVo.getTimeType().equals("2")) {
             List<StatisticalChartsResVo> byQuarter = new LinkedList<>();
             List<StatisticalChartsResVo> byQuarter = new LinkedList<>();
             for (StatisticalChartsResVo chartsResVo : byYear) {
             for (StatisticalChartsResVo chartsResVo : byYear) {
+                pmDemandReqVo.setYear(Integer.parseInt(chartsResVo.getColumnName()));
                 for (int i = 1; i <= 4; i++) {
                 for (int i = 1; i <= 4; i++) {
-                    StatisticalChartsResVo quarter = pmDemandMapper.countProjectMajorByQuarter(i, Integer.parseInt(chartsResVo.getColumnName()));
+                    pmDemandReqVo.setQuarter(i);
+                    StatisticalChartsResVo quarter = pmDemandMapper.countProjectMajorByQuarter(pmDemandReqVo);
                     quarter.setColumnName(chartsResVo.getColumnName() + "年第" + i + "季度");
                     quarter.setColumnName(chartsResVo.getColumnName() + "年第" + i + "季度");
                     byQuarter.add(quarter);
                     byQuarter.add(quarter);
                 }
                 }
             }
             }
             resMap.put("季度", byQuarter);
             resMap.put("季度", byQuarter);
         } else if (pmDemandReqVo.getTimeType().equals("3")) {
         } else if (pmDemandReqVo.getTimeType().equals("3")) {
-            List<StatisticalChartsResVo> byMonth = pmDemandMapper.countProjectMajorByMonth();
+            List<StatisticalChartsResVo> byMonth = pmDemandMapper.countProjectMajorByMonth(pmDemandReqVo);
             resMap.put("月", byMonth);
             resMap.put("月", byMonth);
         }
         }
         return AjaxResult.success(resMap);
         return AjaxResult.success(resMap);
@@ -1914,7 +1930,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     public AjaxResult countEveryStatusNum(PmDemandReqVo pmDemandReqVo) {
     public AjaxResult countEveryStatusNum(PmDemandReqVo pmDemandReqVo) {
         //指项目进行到各个阶段的数量
         //指项目进行到各个阶段的数量
         //阶段包括:待选取代理、待上传招标文件、待发布公告、待开标、待发布中标公告、中标公式中
         //阶段包括:待选取代理、待上传招标文件、待发布公告、待开标、待发布中标公告、中标公式中
-        List<StatisticalChartsResVo> everyStatusNum = pmDemandMapper.countEveryStatusNum();
+        List<StatisticalChartsResVo> everyStatusNum = pmDemandMapper.countEveryStatusNum(pmDemandReqVo);
         if (!ObjectUtils.isEmpty(everyStatusNum) && everyStatusNum.size() > 0) {
         if (!ObjectUtils.isEmpty(everyStatusNum) && everyStatusNum.size() > 0) {
             for (StatisticalChartsResVo vo : everyStatusNum) {
             for (StatisticalChartsResVo vo : everyStatusNum) {
                 switch (vo.getColumnName()) {
                 switch (vo.getColumnName()) {
@@ -1947,7 +1963,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     @Override
     @Override
     public AjaxResult exceedMarketAnalysis(PmDemandReqVo pmDemandReqVo) {
     public AjaxResult exceedMarketAnalysis(PmDemandReqVo pmDemandReqVo) {
         //所有滞后
         //所有滞后
-        List<PmDemand> demandList = pmDemandMapper.countProjectExceedAll();
+        List<PmDemand> demandList = pmDemandMapper.countProjectExceedAll(pmDemandReqVo);
         //滞后时长包括:滞后1个月以内的采购任务、滞后1至3个月采购任务、滞后3至6个月采购任务、滞后6个月至1年采购任务、滞后1年以上采购任务
         //滞后时长包括:滞后1个月以内的采购任务、滞后1至3个月采购任务、滞后3至6个月采购任务、滞后6个月至1年采购任务、滞后1年以上采购任务
         HashMap<String, Integer> map = new LinkedHashMap<>();
         HashMap<String, Integer> map = new LinkedHashMap<>();
         map.put("滞后1个月以内的采购任务", 0);
         map.put("滞后1个月以内的采购任务", 0);
@@ -1993,28 +2009,30 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         //数量:指本年度状态为“项目建设完成”的项目属性为“重大规划”的项目数
         //数量:指本年度状态为“项目建设完成”的项目属性为“重大规划”的项目数
         //预算金额:指本年度状态为“项目建设完成”的项目属性为“重大规划”的项目累加的预算金额
         //预算金额:指本年度状态为“项目建设完成”的项目属性为“重大规划”的项目累加的预算金额
         StatisticalChartsResVo resVo = new StatisticalChartsResVo();
         StatisticalChartsResVo resVo = new StatisticalChartsResVo();
-        resVo = pmDemandMapper.majorProjectByStatus(PmProjectStatus.COMPLETION_CONSTRUCTION.getCode());
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.COMPLETION_CONSTRUCTION.getCode()));
+        resVo = pmDemandMapper.majorProjectByStatus(pmDemandReqVo);
         resVo.setColumnName("今年已完成数量");
         resVo.setColumnName("今年已完成数量");
         resVos.add(resVo);
         resVos.add(resVo);
 
 
         //正常推进项目:指本年度正在进行中的项目属性为“重大规划”的项目数
         //正常推进项目:指本年度正在进行中的项目属性为“重大规划”的项目数
         //预算金额:指本年度正在进行中的项目属性为“重大规划”的项目累加的预算金额
         //预算金额:指本年度正在进行中的项目属性为“重大规划”的项目累加的预算金额
         StatisticalChartsResVo resVo1 = new StatisticalChartsResVo();
         StatisticalChartsResVo resVo1 = new StatisticalChartsResVo();
-        resVo1 = pmDemandMapper.majorProjectByStatus(PmProjectStatus.UNDER_CONSTRUCTION.getCode());
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.UNDER_CONSTRUCTION.getCode()));
+        resVo1 = pmDemandMapper.majorProjectByStatus(pmDemandReqVo);
         resVo1.setColumnName("正常推进数量");
         resVo1.setColumnName("正常推进数量");
         resVos.add(resVo1);
         resVos.add(resVo1);
 
 
         //执行滞后数量:指本年度逾期项目中,项目属性为“重大规划”的项目数
         //执行滞后数量:指本年度逾期项目中,项目属性为“重大规划”的项目数
         //预算金额:指本年度正在进行中的项目属性为“重大规划”的项目累加的预算金额
         //预算金额:指本年度正在进行中的项目属性为“重大规划”的项目累加的预算金额
         StatisticalChartsResVo resVo2 = new StatisticalChartsResVo();
         StatisticalChartsResVo resVo2 = new StatisticalChartsResVo();
-        resVo2 = pmDemandMapper.countMajorProjectExceed();
+        resVo2 = pmDemandMapper.countMajorProjectExceed(pmDemandReqVo);
         resVo2.setColumnName("执行滞后数量");
         resVo2.setColumnName("执行滞后数量");
         resVos.add(resVo2);
         resVos.add(resVo2);
 
 
         //上年度重大规划采购任务数量:指上年度项目中,项目属性为“重大规划”的项目数
         //上年度重大规划采购任务数量:指上年度项目中,项目属性为“重大规划”的项目数
         //预算金额:指上年度项目中,项目属性为“重大规划”的项目累加的预算金额
         //预算金额:指上年度项目中,项目属性为“重大规划”的项目累加的预算金额
         StatisticalChartsResVo resVo3 = new StatisticalChartsResVo();
         StatisticalChartsResVo resVo3 = new StatisticalChartsResVo();
-        resVo3 = pmDemandMapper.countMajorProjectLastYear();
+        resVo3 = pmDemandMapper.countMajorProjectLastYear(pmDemandReqVo);
         resVo3.setColumnName("上年度重大规划采购任务数量");
         resVo3.setColumnName("上年度重大规划采购任务数量");
         resVos.add(resVo3);
         resVos.add(resVo3);
 
 

+ 180 - 94
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml

@@ -29,13 +29,15 @@
             resultType="java.util.Map">
             resultType="java.util.Map">
         select count(demand_id) countId
         select count(demand_id) countId
         from pm_demand
         from pm_demand
+        WHERE purchase_dept_id = #{purchaseDeptId}
     </select>
     </select>
 
 
     <select id="purchaseProjectStatisticalYWC" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="purchaseProjectStatisticalYWC" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             resultType="java.util.Map">
         select count(demand_id) countYWC, ifnull(sum(evaluation), 0) evaluationYWC
         select count(demand_id) countYWC, ifnull(sum(evaluation), 0) evaluationYWC
         from pm_demand
         from pm_demand
-        where project_status = '17'
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND project_status = '17'
     </select>
     </select>
 
 
     <select id="purchaseProjectStatisticalXCJ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="purchaseProjectStatisticalXCJ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
@@ -43,7 +45,9 @@
         -- DATE_FORMAT(plan_demand_sub_time,'%Y')
         -- DATE_FORMAT(plan_demand_sub_time,'%Y')
         select count(demand_id) countXCJ, ifnull(sum(evaluation), 0) evaluationXCJ
         select count(demand_id) countXCJ, ifnull(sum(evaluation), 0) evaluationXCJ
         from pm_demand
         from pm_demand
-        where project_status != '17' and year(plan_demand_sub_time) = year(NOW())
+        where purchase_dept_id = #{purchaseDeptId}
+          AND project_status != '17'
+          and year(plan_demand_sub_time) = year(NOW())
     </select>
     </select>
 
 
     <select id="purchaseProjectStatisticalQNWC" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="purchaseProjectStatisticalQNWC" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
@@ -51,124 +55,149 @@
         -- DATE_FORMAT(plan_demand_sub_time,'%Y')
         -- DATE_FORMAT(plan_demand_sub_time,'%Y')
         select count(demand_id) countQNWC, ifnull(sum(evaluation), 0) evaluationQNWC
         select count(demand_id) countQNWC, ifnull(sum(evaluation), 0) evaluationQNWC
         from pm_demand
         from pm_demand
-        where project_status != '17'
+        where purchase_dept_id = #{purchaseDeptId}
+          AND project_status != '17'
           and year(plan_demand_sub_time) = year(NOW()) - 1
           and year(plan_demand_sub_time) = year(NOW()) - 1
     </select>
     </select>
 
 
-    <select id="countByProjectAttr" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countByProjectAttr" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT project_status columnName, COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT project_status columnName, COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
+        WHERE purchase_dept_id = #{purchaseDeptId}
         GROUP BY project_status
         GROUP BY project_status
     </select>
     </select>
 
 
-    <select id="countByPurchaseMode" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countByPurchaseMode" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT purchase_mode columnName, COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT purchase_mode columnName, COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
+        WHERE purchase_dept_id = #{purchaseDeptId}
         GROUP BY purchase_mode
         GROUP BY purchase_mode
     </select>
     </select>
 
 
-    <select id="countByEvaluationLt" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countByEvaluationLt" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE evaluation &lt; #{evaluation}
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND evaluation &lt; #{evaluation}
     </select>
     </select>
 
 
-    <select id="countByEvaluationBet" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countByEvaluationBet" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE evaluation BETWEEN #{evaluation} and #{evaluationEnd}
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND evaluation BETWEEN #{evaluation} and #{evaluationEnd}
     </select>
     </select>
-    <select id="countByEvaluationGt" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
-            parameterType="java.lang.Integer">
+    <select id="countByEvaluationGt" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE evaluation &gt; #{evaluation}
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND evaluation &gt; #{evaluation}
     </select>
     </select>
 
 
-    <select id="countProjectExceed" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countProjectExceed" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE (real_demand_commit_time > plan_demand_sub_time
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND (real_demand_commit_time > plan_demand_sub_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_deliver_time > plan_deliver_time)
             or real_deliver_time > plan_deliver_time)
-          and DATE_FORMAT(create_time, '%Y') = YEAR (NOW())
+          and DATE_FORMAT(create_time, '%Y') = YEAR(NOW())
     </select>
     </select>
 
 
-    <select id="countThisYear" resultType="java.lang.Integer">
+    <select id="countThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="java.lang.Integer">
         SELECT COUNT(demand_id) num
         SELECT COUNT(demand_id) num
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE DATE_FORMAT(create_time, '%Y') = YEAR (NOW())
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND DATE_FORMAT(create_time, '%Y') = YEAR(NOW())
     </select>
     </select>
 
 
-    <select id="countProjectExceedYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countProjectExceedYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT DATE_FORMAT(create_time, '%Y') columnName, COUNT(demand_id) num
         SELECT DATE_FORMAT(create_time, '%Y') columnName, COUNT(demand_id) num
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE (real_demand_commit_time > plan_demand_sub_time
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND (real_demand_commit_time > plan_demand_sub_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_deliver_time > plan_deliver_time)
             or real_deliver_time > plan_deliver_time)
         GROUP BY DATE_FORMAT(create_time, '%Y')
         GROUP BY DATE_FORMAT(create_time, '%Y')
         order by create_time asc
         order by create_time asc
     </select>
     </select>
 
 
-    <select id="countProjectExceedMonth" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countProjectExceedMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT DATE_FORMAT(create_time, '%Y-%m') columnName, COUNT(demand_id) num
         SELECT DATE_FORMAT(create_time, '%Y-%m') columnName, COUNT(demand_id) num
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE (real_demand_commit_time > plan_demand_sub_time
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND (real_demand_commit_time > plan_demand_sub_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_deliver_time > plan_deliver_time)
             or real_deliver_time > plan_deliver_time)
-            and MONTH (
-            create_time) = #{month}
+          and MONTH(
+                      create_time) = #{month}
           AND DATE_FORMAT(create_time
           AND DATE_FORMAT(create_time
-            , '%Y') = #{year}
+                  , '%Y') = #{year}
         GROUP BY DATE_FORMAT(create_time, '%Y-%m')
         GROUP BY DATE_FORMAT(create_time, '%Y-%m')
     </select>
     </select>
 
 
-    <select id="countProjectExceedQuarter" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countProjectExceedQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT DATE_FORMAT(create_time, '%Y-${quarter}季度') columnName, COUNT(demand_id) num
         SELECT DATE_FORMAT(create_time, '%Y-${quarter}季度') columnName, COUNT(demand_id) num
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE (real_demand_commit_time > plan_demand_sub_time
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND (real_demand_commit_time > plan_demand_sub_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_deliver_time > plan_deliver_time)
             or real_deliver_time > plan_deliver_time)
           and QUARTER(create_time) = #{quarter}
           and QUARTER(create_time) = #{quarter}
           AND DATE_FORMAT(create_time, '%Y') = #{year}
           AND DATE_FORMAT(create_time, '%Y') = #{year}
     </select>
     </select>
 
 
-    <select id="countProjectExceedAll" resultType="com.ozs.pm.doman.PmDemand">
+    <select id="countProjectExceedAll" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.PmDemand">
         SELECT *
         SELECT *
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE (real_demand_commit_time > plan_demand_sub_time
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND (real_demand_commit_time > plan_demand_sub_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_deliver_time > plan_deliver_time)
             or real_deliver_time > plan_deliver_time)
 
 
     </select>
     </select>
 
 
-    <select id="majorProjectByStatus" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
-            parameterType="java.lang.String">
+    <select id="majorProjectByStatus" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE find_in_set('1', project_attr)
-          AND `project_status` = #{code}
-          AND DATE_FORMAT(create_time, '%Y') = year (now())
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND find_in_set('1', project_attr)
+          AND `project_status` = #{projectStatus}
+          AND DATE_FORMAT(create_time, '%Y') = year(now())
     </select>
     </select>
 
 
     <select id="countMajorProjectExceed" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
     <select id="countMajorProjectExceed" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE (real_demand_commit_time > plan_demand_sub_time
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND (real_demand_commit_time > plan_demand_sub_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_deliver_time > plan_deliver_time)
             or real_deliver_time > plan_deliver_time)
           AND find_in_set('1', project_attr)
           AND find_in_set('1', project_attr)
-          and DATE_FORMAT(create_time, '%Y') = YEAR (NOW())
+          and DATE_FORMAT(create_time, '%Y') = YEAR(NOW())
     </select>
     </select>
 
 
-    <select id="taskQuantityYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
-        SELECT YEAR (NOW()) columnName, COUNT (demand_id) num
+    <select id="taskQuantityYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+        SELECT YEAR(NOW()) columnName, COUNT(demand_id) num
         FROM `pm_demand`
         FROM `pm_demand`
         WHERE find_in_set('1'
         WHERE find_in_set('1'
             , project_attr)
             , project_attr)
           AND `project_status` = #{code}
           AND `project_status` = #{code}
           and DATE_FORMAT(create_time
           and DATE_FORMAT(create_time
-            , '%Y') = YEAR (NOW())
+                  , '%Y') = YEAR(NOW())
     </select>
     </select>
 
 
     <select id="taskQuantityLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
     <select id="taskQuantityLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
@@ -182,11 +211,13 @@
             , '%Y') = YEAR (NOW()) - 1
             , '%Y') = YEAR (NOW()) - 1
     </select>
     </select>
 
 
-    <select id="countEveryStatusNum" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countEveryStatusNum" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT project_status columnName, COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT project_status columnName, COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE `project_status` IN (9, 10, 11, 12, 13, 14)
-          and DATE_FORMAT(create_time, '%Y') = YEAR (NOW())
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND `project_status` IN (9, 10, 11, 12, 13, 14)
+          and DATE_FORMAT(create_time, '%Y') = YEAR(NOW())
         GROUP BY project_status
         GROUP BY project_status
     </select>
     </select>
 
 
@@ -204,13 +235,13 @@
         where plan_id = #{planId} limit 1
         where plan_id = #{planId} limit 1
     </select>
     </select>
 
 
-    <select id="countMajorProjectLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countMajorProjectLastYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT YEAR(NOW()) - 1 columnName, COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT YEAR(NOW()) - 1 columnName, COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE find_in_set('1'
-            , project_attr)
-          and DATE_FORMAT(create_time
-                  , '%Y') = YEAR(NOW()) - 1
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND find_in_set('1', project_attr)
+          and DATE_FORMAT(create_time, '%Y') = YEAR(NOW()) - 1
     </select>
     </select>
 
 
     <select id="countProjectMajorByYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
     <select id="countProjectMajorByYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
@@ -224,14 +255,16 @@
     <select id="countProjectMajorByMonth" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
     <select id="countProjectMajorByMonth" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT DATE_FORMAT(create_time, '%Y-%m') columnName, COUNT(demand_id) num
         SELECT DATE_FORMAT(create_time, '%Y-%m') columnName, COUNT(demand_id) num
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE find_in_set('1', project_attr)
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND find_in_set('1', project_attr)
         GROUP BY DATE_FORMAT(create_time, '%Y-%m')
         GROUP BY DATE_FORMAT(create_time, '%Y-%m')
     </select>
     </select>
 
 
     <select id="countProjectMajorByQuarter" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
     <select id="countProjectMajorByQuarter" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT create_time columnName, COUNT(demand_id) num
         SELECT create_time columnName, COUNT(demand_id) num
         FROM `pm_demand`
         FROM `pm_demand`
-        WHERE find_in_set('1', project_attr)
+        WHERE purchase_dept_id = #{purchaseDeptId}
+          AND find_in_set('1', project_attr)
           and QUARTER(create_time) = #{quarter}
           and QUARTER(create_time) = #{quarter}
           AND DATE_FORMAT(create_time, '%Y') = #{year}
           AND DATE_FORMAT(create_time, '%Y') = #{year}
     </select>
     </select>
@@ -241,8 +274,9 @@
             resultType="java.util.Map">
             resultType="java.util.Map">
         select count(demand_id) countNormalPropulsion, ifnull(sum(evaluation), 0) evaluationNormalPropulsion
         select count(demand_id) countNormalPropulsion, ifnull(sum(evaluation), 0) evaluationNormalPropulsion
         from pm_demand
         from pm_demand
-        where project_status != '17'
-            and  (real_demand_commit_time > plan_demand_sub_time
+        where purchase_dept_id = #{purchaseDeptId}
+          AND project_status != '17'
+          and (real_demand_commit_time > plan_demand_sub_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_deliver_time > plan_deliver_time)
             or real_deliver_time > plan_deliver_time)
     </select>
     </select>
@@ -251,7 +285,8 @@
             resultType="java.util.Map">
             resultType="java.util.Map">
         select count(demand_id) countIncomplete, ifnull(sum(evaluation), 0) evaluationIncomplete
         select count(demand_id) countIncomplete, ifnull(sum(evaluation), 0) evaluationIncomplete
         from pm_demand
         from pm_demand
-        where project_status in (4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
+        where purchase_dept_id = #{purchaseDeptId}
+          AND project_status in (4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
     </select>
     </select>
 
 
     <select id="selectMinYear" resultType="java.lang.Integer">
     <select id="selectMinYear" resultType="java.lang.Integer">
@@ -261,88 +296,134 @@
 
 
     <select id="selectpurchaseProjectCompleteNumberYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="selectpurchaseProjectCompleteNumberYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             resultType="java.util.Map">
-        select count(a.demand_id) countNum, ifnull(sum(a.evaluation), 0) evaluation,
-            year(a.plan_demand_sub_time) yy, ifnull(sum(b.contract_amount), 0) contractAmount
+        select count(a.demand_id)                countNum,
+               ifnull(sum(a.evaluation), 0)      evaluation,
+               year(a.plan_demand_sub_time)      yy,
+               ifnull(sum(b.contract_amount), 0) contractAmount
         from (
         from (
-            select evaluation, plan_demand_sub_time, demand_id from pm_demand where project_status = '17'
-        ) a left join (
-            select contract_amount, demand_id from pm_contract_info
+                 select evaluation, plan_demand_sub_time, demand_id
+                 from pm_demand
+                 where purchase_dept_id = #{purchaseDeptId}
+                   AND project_status = '17'
+             ) a
+                 left join (
+            select contract_amount, demand_id
+            from pm_contract_info
         ) b on a.demand_id = b.demand_id
         ) b on a.demand_id = b.demand_id
+
         group by year(plan_demand_sub_time)
         group by year(plan_demand_sub_time)
     </select>
     </select>
 
 
     <select id="selectpurchaseProjectCompleteNumberQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="selectpurchaseProjectCompleteNumberQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             resultType="java.util.Map">
-        select ifnull(sum(a.evaluation), 0) evaluation, quarter(a.plan_demand_sub_time) yy, ifnull(sum(b.contract_amount), 0) contractAmount
+        select ifnull(sum(a.evaluation), 0)      evaluation,
+               quarter(a.plan_demand_sub_time)   yy,
+               ifnull(sum(b.contract_amount), 0) contractAmount
         from (
         from (
-            select evaluation, plan_demand_sub_time, demand_id from pm_demand
-            where project_status = '17' and year(plan_demand_sub_time) = year(NOW())
-        ) a left join (
-            select contract_amount, demand_id from pm_contract_info
+                 select evaluation, plan_demand_sub_time, demand_id
+                 from pm_demand
+                 where purchase_dept_id = #{purchaseDeptId}
+                   AND project_status = '17'
+                   and year(plan_demand_sub_time) = year(NOW())
+             ) a
+                 left join (
+            select contract_amount, demand_id
+            from pm_contract_info
         ) b on a.demand_id = b.demand_id
         ) 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.plan_demand_sub_time), quarter(a.plan_demand_sub_time))
     </select>
     </select>
 
 
     <select id="selectpurchaseProjectCompleteNumberMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="selectpurchaseProjectCompleteNumberMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             resultType="java.util.Map">
-        select ifnull(sum(a.evaluation), 0) evaluation, date_format(plan_demand_sub_time, '%m') yy, ifnull(sum(b.contract_amount), 0) contractAmount
+        select ifnull(sum(a.evaluation), 0)            evaluation,
+               date_format(plan_demand_sub_time, '%m') yy,
+               ifnull(sum(b.contract_amount), 0)       contractAmount
         from (
         from (
-            select evaluation, plan_demand_sub_time, demand_id from pm_demand
-            where project_status = '17' and year (plan_demand_sub_time) = year(NOW())
-        ) a left join (
-            select contract_amount, demand_id from pm_contract_info
+                 select evaluation, plan_demand_sub_time, demand_id
+                 from pm_demand
+                 where purchase_dept_id = #{purchaseDeptId}
+                   AND project_status = '17'
+                   and year(plan_demand_sub_time) = year(NOW())
+             ) a
+                 left join (
+            select contract_amount, demand_id
+            from pm_contract_info
         ) b on a.demand_id = b.demand_id
         ) b on a.demand_id = b.demand_id
         group by date_format(a.plan_demand_sub_time, '%y%m')
         group by date_format(a.plan_demand_sub_time, '%y%m')
     </select>
     </select>
 
 
     <select id="selectPurchaseTaskFinishYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="selectPurchaseTaskFinishYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             resultType="java.util.Map">
-        select count(demand_id) countNum, ifnull(sum(a.evaluation), 0) evaluation, year(a.plan_demand_sub_time) yy, ifnull(sum(b.contract_amount), 0) contractAmount
+        select count(demand_id)                  countNum,
+               ifnull(sum(a.evaluation), 0)      evaluation,
+               year(a.plan_demand_sub_time)      yy,
+               ifnull(sum(b.contract_amount), 0) contractAmount
         from (
         from (
-            select evaluation, plan_demand_sub_time, demand_id from pm_demand where project_status in (15, 16, 17)
-        ) a left join (
-            select contract_amount, demand_id from pm_contract_info
+                 select evaluation, plan_demand_sub_time, demand_id
+                 from pm_demand
+                 where purchase_dept_id = #{purchaseDeptId}
+                   AND project_status in (15, 16, 17)
+             ) a
+                 left join (
+            select contract_amount, demand_id
+            from pm_contract_info
         ) b on a.demand_id = b.demand_id
         ) b on a.demand_id = b.demand_id
-        group by year (a.plan_demand_sub_time)
+        group by year(a.plan_demand_sub_time)
     </select>
     </select>
 
 
     <select id="selectPurchaseTaskFinishQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="selectPurchaseTaskFinishQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             resultType="java.util.Map">
-        select ifnull(sum(a.evaluation), 0) evaluation, quarter(a.plan_demand_sub_time) yy, ifnull(sum(b.contract_amount), 0) contractAmount
+        select ifnull(sum(a.evaluation), 0)      evaluation,
+               quarter(a.plan_demand_sub_time)   yy,
+               ifnull(sum(b.contract_amount), 0) contractAmount
         from (
         from (
-            select evaluation, plan_demand_sub_time, demand_id from pm_demand
-            where project_status in (15, 16, 17) and year (plan_demand_sub_time) = year(NOW())
-        ) a left join (
-            select contract_amount, demand_id from pm_contract_info
+                 select evaluation, plan_demand_sub_time, demand_id
+                 from pm_demand
+                 where purchase_dept_id = #{purchaseDeptId}
+                   AND project_status in (15, 16, 17)
+                   and year(plan_demand_sub_time) = year(NOW())
+             ) a
+                 left join (
+            select contract_amount, demand_id
+            from pm_contract_info
         ) b on a.demand_id = b.demand_id
         ) 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.plan_demand_sub_time), quarter(a.plan_demand_sub_time))
     </select>
     </select>
 
 
     <select id="selectPurchaseTaskFinishMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="selectPurchaseTaskFinishMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             resultType="java.util.Map">
-        select ifnull(sum(a.evaluation), 0) evaluation, date_format(plan_demand_sub_time, '%m') yy, ifnull(sum(b.contract_amount), 0) contractAmount
+        select ifnull(sum(a.evaluation), 0)            evaluation,
+               date_format(plan_demand_sub_time, '%m') yy,
+               ifnull(sum(b.contract_amount), 0)       contractAmount
         from (
         from (
-            select evaluation, plan_demand_sub_time, demand_id from pm_demand
-            where project_status in (15, 16, 17) and year (plan_demand_sub_time) = year(NOW())
-        ) a left join (
-            select contract_amount, demand_id from pm_contract_info
+                 select evaluation, plan_demand_sub_time, demand_id
+                 from pm_demand
+                 where purchase_dept_id = #{purchaseDeptId}
+                   AND project_status in (15, 16, 17)
+                   and year(plan_demand_sub_time) = year(NOW())
+             ) a
+                 left join (
+            select contract_amount, demand_id
+            from pm_contract_info
         ) b on a.demand_id = b.demand_id
         ) b on a.demand_id = b.demand_id
         group by date_format(a.plan_demand_sub_time, '%y%m')
         group by date_format(a.plan_demand_sub_time, '%y%m')
     </select>
     </select>
 
 
-    <select id="countProjectExceedAndMajor" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+    <select id="countProjectExceedAndMajor" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
         FROM `pm_demand`
         FROM `pm_demand`
         WHERE (real_demand_commit_time > plan_demand_sub_time
         WHERE (real_demand_commit_time > plan_demand_sub_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_purchase_finish_time > plan_purchase_finish_time
             or real_deliver_time > plan_deliver_time)
             or real_deliver_time > plan_deliver_time)
           AND find_in_set('1', project_attr)
           AND find_in_set('1', project_attr)
-          and DATE_FORMAT(create_time, '%Y') = YEAR (NOW())
+          and DATE_FORMAT(create_time, '%Y') = YEAR(NOW())
     </select>
     </select>
 
 
     <select id="purchaseProjectDistribution" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="purchaseProjectDistribution" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             resultType="java.util.Map">
-        select count(demand_id) countNumber from pm_demand where project_status in
+        select count(demand_id) countNumber from pm_demand where purchase_dept_id=#{purchaseDeptId} AND project_status
+        in
         <foreach item="item" collection="projectStatusList" separator="," open="(" close=")">
         <foreach item="item" collection="projectStatusList" separator="," open="(" close=")">
             #{item}
             #{item}
         </foreach>
         </foreach>
@@ -352,14 +433,16 @@
             resultType="java.util.Map">
             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(plan_demand_sub_time) yy
         from pm_demand
         from pm_demand
-        group by year (plan_demand_sub_time)
+        where purchase_dept_id = #{purchaseDeptId}
+        group by year(plan_demand_sub_time)
     </select>
     </select>
 
 
     <select id="purchaseProjectNumberAnalysisQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="purchaseProjectNumberAnalysisQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             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(plan_demand_sub_time) yy
         from pm_demand
         from pm_demand
-        where year (plan_demand_sub_time) = year (NOW())
+        where purchase_dept_id = #{purchaseDeptId}
+          AND year(plan_demand_sub_time) = year(NOW())
         group by concat(Year(plan_demand_sub_time), quarter(plan_demand_sub_time))
         group by concat(Year(plan_demand_sub_time), quarter(plan_demand_sub_time))
     </select>
     </select>
 
 
@@ -367,27 +450,30 @@
             resultType="java.util.Map">
             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(plan_demand_sub_time) yy
         from pm_demand
         from pm_demand
-        where year(plan_demand_sub_time) = year(NOW() - 1)
+        where purchase_dept_id = #{purchaseDeptId}
+          AND year(plan_demand_sub_time) = year(NOW() - 1)
         group by concat(Year(plan_demand_sub_time), quarter(plan_demand_sub_time))
         group by concat(Year(plan_demand_sub_time), quarter(plan_demand_sub_time))
     </select>
     </select>
 
 
     <select id="purchaseProjectNumberAnalysisMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="purchaseProjectNumberAnalysisMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             resultType="java.util.Map">
-        select count(demand_id) countNum,
-               ifnull(sum(evaluation), 0) evaluationSum,
+        select count(demand_id)                        countNum,
+               ifnull(sum(evaluation), 0)              evaluationSum,
                date_format(plan_demand_sub_time, '%m') yy
                date_format(plan_demand_sub_time, '%m') yy
         from pm_demand
         from pm_demand
-        where year (plan_demand_sub_time) = year(NOW())
+        where purchase_dept_id = #{purchaseDeptId}
+          AND year(plan_demand_sub_time) = year(NOW())
         group by date_format(plan_demand_sub_time, '%y%m')
         group by date_format(plan_demand_sub_time, '%y%m')
     </select>
     </select>
 
 
     <select id="purchaseProjectNumberAnalysisOldYearMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
     <select id="purchaseProjectNumberAnalysisOldYearMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="java.util.Map">
             resultType="java.util.Map">
-        select count(demand_id) countNum,
-               ifnull(sum(evaluation), 0) evaluationSum,
+        select count(demand_id)                        countNum,
+               ifnull(sum(evaluation), 0)              evaluationSum,
                date_format(plan_demand_sub_time, '%m') yy
                date_format(plan_demand_sub_time, '%m') yy
         from pm_demand
         from pm_demand
-        where year(plan_demand_sub_time) = year(NOW() - 1)
+        where purchase_dept_id = #{purchaseDeptId}
+          AND year(plan_demand_sub_time) = year(NOW() - 1)
         group by date_format(plan_demand_sub_time, '%y%m')
         group by date_format(plan_demand_sub_time, '%y%m')
     </select>
     </select>
 </mapper>
 </mapper>