|
@@ -27,7 +27,7 @@
|
|
|
|
|
|
<select id="purchaseProjectStatistical" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
- select count(demand_id) countId
|
|
|
+ select ifnull(COUNT(demand_id), 0) countId
|
|
|
from pm_demand
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -40,7 +40,7 @@
|
|
|
resultType="java.util.Map">
|
|
|
select count(d.demand_id) countYWC, ifnull(sum(c.contract_amount), 0) evaluationYWC
|
|
|
from pm_demand d, pm_contract_info c,
|
|
|
- (SELECT COUNT(demand_id) countYWC ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) countYWC ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
|
separator="," open="(" close=")">
|
|
@@ -58,7 +58,7 @@
|
|
|
|
|
|
<select id="purchaseProjectStatisticalXCJ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
- select count(demand_id) countXCJ, ifnull(sum(evaluation), 0) evaluationXCJ
|
|
|
+ select ifnull(COUNT(demand_id), 0) countXCJ, ifnull(sum(evaluation), 0) evaluationXCJ
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -73,7 +73,7 @@
|
|
|
resultType="java.util.Map">
|
|
|
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
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) countYWC ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
|
separator="," open="(" close=")">
|
|
@@ -91,7 +91,7 @@
|
|
|
|
|
|
<select id="countByProjectAttr" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT project_attr columnName, COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT project_attr columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -103,7 +103,7 @@
|
|
|
|
|
|
<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, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT purchase_mode columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -115,7 +115,7 @@
|
|
|
|
|
|
<select id="countByEvaluationLt" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -127,7 +127,7 @@
|
|
|
|
|
|
<select id="countByEvaluationBet" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -138,7 +138,7 @@
|
|
|
</select>
|
|
|
<select id="countByEvaluationGt" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -150,7 +150,7 @@
|
|
|
|
|
|
<select id="countProjectExceedThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -163,7 +163,7 @@
|
|
|
|
|
|
<select id="countProjectExceedThisQua" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -176,7 +176,7 @@
|
|
|
|
|
|
<select id="countProjectExceedThisMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -189,7 +189,7 @@
|
|
|
|
|
|
<select id="countProjectExceedAllNum" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -201,7 +201,7 @@
|
|
|
|
|
|
<select id="countProjectExceedTZ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -213,7 +213,7 @@
|
|
|
|
|
|
<select id="countThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.lang.Integer">
|
|
|
- SELECT COUNT(demand_id) num
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -225,7 +225,7 @@
|
|
|
|
|
|
<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, ifnull(COUNT(demand_id), 0) num
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -241,7 +241,7 @@
|
|
|
|
|
|
<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, ifnull(COUNT(demand_id), 0) num
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -260,7 +260,7 @@
|
|
|
|
|
|
<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, ifnull(COUNT(demand_id), 0) num
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -290,7 +290,7 @@
|
|
|
</select>
|
|
|
|
|
|
<sql id="majorProjectByStatus">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -383,7 +383,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="countMajorProjectExceed" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -399,7 +399,7 @@
|
|
|
|
|
|
<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
|
|
|
+ SELECT YEAR(NOW()) columnName, ifnull(COUNT(demand_id), 0) num
|
|
|
FROM `pm_demand`
|
|
|
WHERE find_in_set('1'
|
|
|
, project_attr)
|
|
@@ -409,7 +409,7 @@
|
|
|
|
|
|
<select id="taskQuantityLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
parameterType="java.lang.String">
|
|
|
- SELECT YEAR(NOW()) - 1 columnName, COUNT(demand_id) num
|
|
|
+ SELECT YEAR(NOW()) - 1 columnName, ifnull(COUNT(demand_id), 0) num
|
|
|
FROM `pm_demand`
|
|
|
WHERE find_in_set('1'
|
|
|
, project_attr)
|
|
@@ -419,7 +419,7 @@
|
|
|
|
|
|
<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, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT project_status columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -444,7 +444,8 @@
|
|
|
# AND find_in_set('1', project_attr)
|
|
|
SELECT YEAR(NOW()) - 1 columnName, de.num, 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
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) 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=")">
|
|
@@ -462,7 +463,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="countProjectMajorByYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT YEAR(create_time) columnName, COUNT(demand_id) num
|
|
|
+ SELECT YEAR(create_time) columnName, ifnull(COUNT(demand_id), 0) num
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -475,7 +476,7 @@
|
|
|
</select>
|
|
|
|
|
|
<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, ifnull(COUNT(demand_id), 0) num
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -487,7 +488,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="countProjectMajorByQuarter" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT create_time columnName, COUNT(demand_id) num
|
|
|
+ SELECT create_time columnName, ifnull(COUNT(demand_id), 0) num
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -502,7 +503,7 @@
|
|
|
<!-- 正常推进项目 -->
|
|
|
<select id="purchaseProjectExecuteNormalPropulsion" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- select count(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ select ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -517,7 +518,7 @@
|
|
|
|
|
|
<select id="purchaseProjectExecuteIncomplete" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- select count(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ select ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -673,7 +674,7 @@
|
|
|
|
|
|
<select id="countProjectExceedAndMajor" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE (real_demand_commit_time > plan_demand_sub_time
|
|
|
or real_purchase_finish_time > plan_purchase_finish_time
|
|
@@ -684,7 +685,24 @@
|
|
|
|
|
|
<select id="purchaseProjectDistribution" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
- select count(demand_id) countNumber,ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ select ifnull(count(demand_id), 0) countNumber,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>
|
|
|
+ <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="purchaseProjectDistributionTo" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
+ resultType="java.util.Map">
|
|
|
+ select ifnull(count(demand_id), 0) countNumber,ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
from pm_demand where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
|
separator="," open="(" close=")">
|
|
@@ -701,7 +719,7 @@
|
|
|
|
|
|
<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(create_time) yy
|
|
|
+ select ifnull(COUNT(demand_id), 0) 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"
|
|
@@ -713,7 +731,7 @@
|
|
|
|
|
|
<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(create_time) yy
|
|
|
+ select ifnull(COUNT(demand_id), 0) 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"
|
|
@@ -726,7 +744,7 @@
|
|
|
|
|
|
<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(create_time) yy
|
|
|
+ select ifnull(COUNT(demand_id), 0) 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"
|
|
@@ -739,7 +757,7 @@
|
|
|
|
|
|
<select id="purchaseProjectNumberAnalysisMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
- select count(demand_id) countNum,
|
|
|
+ select ifnull(COUNT(demand_id), 0) countNum,
|
|
|
ifnull(sum(evaluation), 0) evaluationSum,
|
|
|
date_format(create_time, '%m') yy
|
|
|
from pm_demand
|
|
@@ -754,7 +772,7 @@
|
|
|
|
|
|
<select id="purchaseProjectNumberAnalysisOldYearMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
- select count(demand_id) countNum,
|
|
|
+ select ifnull(COUNT(demand_id), 0) countNum,
|
|
|
ifnull(sum(evaluation), 0) evaluationSum,
|
|
|
date_format(create_time, '%m') yy
|
|
|
from pm_demand
|
|
@@ -789,7 +807,7 @@
|
|
|
|
|
|
<select id="selectmeiJiDu" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
- SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -801,7 +819,7 @@
|
|
|
|
|
|
<select id="selectByProjectType" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
- SELECT project_type columnName, COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
+ SELECT project_type columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
WHERE purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -829,7 +847,8 @@
|
|
|
SELECT MONTH(NOW()) 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
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) 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=")">
|
|
@@ -850,7 +869,8 @@
|
|
|
SELECT QUARTER(NOW()) 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
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) 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=")">
|
|
@@ -871,7 +891,8 @@
|
|
|
SELECT YEAR(NOW())-1 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
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) 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=")">
|
|
@@ -892,7 +913,8 @@
|
|
|
SELECT YEAR(NOW()) 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
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) 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=")">
|
|
@@ -913,7 +935,8 @@
|
|
|
SELECT YEAR(NOW()) 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
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) 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=")">
|
|
@@ -1015,7 +1038,8 @@
|
|
|
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
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) 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=")">
|
|
@@ -1036,7 +1060,8 @@
|
|
|
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
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) 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=")">
|
|
@@ -1058,7 +1083,8 @@
|
|
|
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
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) 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=")">
|