|
@@ -93,9 +93,7 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT project_attr columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
find_in_set(#{vo.projectAttr},project_attr)
|
|
|
</select>
|
|
|
|
|
@@ -103,11 +101,9 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
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"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
|
|
|
+ <include refid="deptListOrDemandIdAllNoAnd"/>
|
|
|
+ </if>
|
|
|
GROUP BY purchase_mode
|
|
|
</select>
|
|
|
|
|
@@ -115,35 +111,31 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND evaluation < #{vo.evaluation}
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ evaluation < #{vo.evaluation}
|
|
|
</select>
|
|
|
|
|
|
<select id="countByEvaluationBet" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND evaluation BETWEEN #{vo.evaluation} and #{vo.evaluationEnd}
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ evaluation BETWEEN #{vo.evaluation} and #{vo.evaluationEnd}
|
|
|
</select>
|
|
|
<select id="countByEvaluationGt" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND evaluation > #{vo.evaluation}
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ evaluation > #{vo.evaluation}
|
|
|
</select>
|
|
|
|
|
|
<select id="countProjectExceedThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND ( real_purchase_finish_time > plan_purchase_finish_time )
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ ( real_purchase_finish_time > plan_purchase_finish_time )
|
|
|
and YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
|
|
|
@@ -151,9 +143,8 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND ( real_purchase_finish_time > plan_purchase_finish_time )
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ ( real_purchase_finish_time > plan_purchase_finish_time )
|
|
|
and quarter(create_time) = quarter(NOW())
|
|
|
</select>
|
|
|
|
|
@@ -161,9 +152,8 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND ( real_purchase_finish_time > plan_purchase_finish_time )
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ ( real_purchase_finish_time > plan_purchase_finish_time )
|
|
|
and MONTH(create_time) = MONTH(NOW())
|
|
|
</select>
|
|
|
|
|
@@ -171,9 +161,8 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND ( real_purchase_finish_time > plan_purchase_finish_time)
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ ( real_purchase_finish_time > plan_purchase_finish_time)
|
|
|
</select>
|
|
|
|
|
|
<select id="countProjectExceedTZ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
@@ -255,9 +244,8 @@
|
|
|
resultType="com.ozs.pm.doman.PmDemand">
|
|
|
SELECT *
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND (real_demand_commit_time > plan_demand_sub_time
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ (real_demand_commit_time > plan_demand_sub_time
|
|
|
or real_purchase_finish_time > plan_purchase_finish_time
|
|
|
or real_deliver_time > plan_deliver_time)
|
|
|
|
|
@@ -266,68 +254,67 @@
|
|
|
<sql id="majorProjectByStatus">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND find_in_set('1', project_attr)
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ find_in_set('1', project_attr)
|
|
|
</sql>
|
|
|
|
|
|
<select id="majorProjectByStatusThisMonthNew" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND MONTH(create_time ) = MONTH(now())
|
|
|
AND project_status > #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusThisQuaNew" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND QUARTER(create_time ) = QUARTER(now())
|
|
|
AND project_status > #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusThisYearNew" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND YEAR(create_time ) = YEAR(now())
|
|
|
AND project_status > #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusThisMonthFi" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND MONTH(create_time ) = MONTH(now())
|
|
|
AND project_status < #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusThisQuaFi" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND QUARTER(create_time ) = QUARTER(now())
|
|
|
AND project_status < #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusThisYearFi" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND YEAR(create_time ) = YEAR(now())
|
|
|
AND project_status < #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusThisMonthFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND MONTH(create_time ) = MONTH(now())
|
|
|
AND project_status > #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusThisQuaFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND QUARTER(create_time ) = QUARTER(now())
|
|
|
AND project_status > #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusThisYearFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND YEAR(create_time ) = YEAR(now())
|
|
|
AND project_status > #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusLastYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND YEAR(create_time ) = YEAR(now())-1
|
|
|
<if test="vo.projectStatusList!=null and vo.projectStatusList.size != 0">
|
|
|
AND project_status in
|
|
@@ -339,17 +326,17 @@
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusToThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND project_status < #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusWei" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND real_purchase_finish_time <plan_purchase_finish_time
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusChao" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
- <include refid="majorProjectByStatus"></include>
|
|
|
+ <include refid="majorProjectByStatus"/>
|
|
|
AND real_purchase_finish_time >plan_purchase_finish_time
|
|
|
</select>
|
|
|
|
|
@@ -392,9 +379,8 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT project_status columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND `project_status` IN (9, 10, 11, 12, 13, 14,15,16,17)
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ `project_status` IN (9, 10, 11, 12, 13, 14,15,16,17)
|
|
|
and YEAR(create_time) = YEAR(NOW())
|
|
|
GROUP BY project_status
|
|
|
</select>
|
|
@@ -473,9 +459,8 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
select ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
from pm_demand
|
|
|
- where
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status !=21
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status !=21
|
|
|
and (real_demand_commit_time < plan_demand_sub_time
|
|
|
or real_purchase_finish_time < plan_purchase_finish_time
|
|
|
or real_deliver_time < plan_deliver_time)
|
|
@@ -485,9 +470,8 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
select ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
from pm_demand
|
|
|
- where
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status !=21
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status !=21
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMinYear" resultType="java.lang.Integer">
|
|
@@ -574,9 +558,8 @@
|
|
|
from (
|
|
|
select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
- where
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status in (15, 16, 17)
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status in (15, 16, 17)
|
|
|
) a
|
|
|
left join (
|
|
|
select contract_amount, demand_id
|
|
@@ -593,9 +576,8 @@
|
|
|
from (
|
|
|
select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
- where
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status in (15, 16, 17)
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status in (15, 16, 17)
|
|
|
and year(create_time) = year(NOW())
|
|
|
) a
|
|
|
left join (
|
|
@@ -613,9 +595,8 @@
|
|
|
from (
|
|
|
select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
- where
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status in (15, 16, 17)
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status in (15, 16, 17)
|
|
|
and year(create_time) = year(NOW())
|
|
|
) a
|
|
|
left join (
|
|
@@ -639,24 +620,13 @@
|
|
|
<select id="purchaseProjectDistribution" 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
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- <if test="vo.projectStatusList!=null and vo.projectStatusList.size != 0">
|
|
|
- AND project_status in
|
|
|
- <foreach collection="vo.projectStatusList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ from pm_demand
|
|
|
+ <include refid="deptListOrDemandIdAllNoAnd"/>
|
|
|
+ <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
|
|
|
+ AND
|
|
|
</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
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
<if test="vo.projectStatusList!=null and vo.projectStatusList.size != 0">
|
|
|
- AND project_status in
|
|
|
+ project_status in
|
|
|
<foreach collection="vo.projectStatusList" item="item" index="index"
|
|
|
separator="," open="(" close=")">
|
|
|
#{item}
|
|
@@ -668,8 +638,7 @@
|
|
|
resultType="java.util.Map">
|
|
|
select ifnull(COUNT(demand_id), 0) countNum, ifnull(sum(evaluation), 0) evaluationSum, year(create_time) yy
|
|
|
from pm_demand
|
|
|
- where
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
+ <include refid="deptListOrDemandIdAllNoAnd"/>
|
|
|
group by year(create_time)
|
|
|
</select>
|
|
|
|
|
@@ -677,9 +646,8 @@
|
|
|
resultType="java.util.Map">
|
|
|
select ifnull(COUNT(demand_id), 0) countNum, ifnull(sum(evaluation), 0) evaluationSum, quarter(create_time) yy
|
|
|
from pm_demand
|
|
|
- where
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND year(create_time) = year(NOW())
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ year(create_time) = year(NOW())
|
|
|
group by concat(Year(create_time), quarter(create_time))
|
|
|
</select>
|
|
|
|
|
@@ -687,9 +655,8 @@
|
|
|
resultType="java.util.Map">
|
|
|
select ifnull(COUNT(demand_id), 0) countNum, ifnull(sum(evaluation), 0) evaluationSum, quarter(create_time) yy
|
|
|
from pm_demand
|
|
|
- where
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND year(create_time) = year(NOW() - 1)
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ year(create_time) = year(NOW() - 1)
|
|
|
group by concat(Year(create_time), quarter(create_time))
|
|
|
</select>
|
|
|
|
|
@@ -699,9 +666,8 @@
|
|
|
ifnull(sum(evaluation), 0) evaluationSum,
|
|
|
date_format(create_time, '%m') yy
|
|
|
from pm_demand
|
|
|
- where
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND year(create_time) = year(NOW())
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ year(create_time) = year(NOW())
|
|
|
group by date_format(create_time, '%y%m')
|
|
|
</select>
|
|
|
|
|
@@ -719,7 +685,8 @@
|
|
|
<select id="selectSTSLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT ifnull(COUNT(demand_id),0)num, ifnull(sum(evaluation),0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE <include refid="deptListOrDemandIdAll"></include> and`project_status` IN (6,7,8,9,10,11,12,13,14,15, 16,
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ `project_status` IN (6,7,8,9,10,11,12,13,14,15, 16,
|
|
|
17)
|
|
|
and YEAR(create_time) = YEAR(NOW())-1
|
|
|
</select>
|
|
@@ -727,7 +694,8 @@
|
|
|
<select id="selectSTSThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
SELECT ifnull(COUNT(demand_id),0)num, ifnull(sum(evaluation),0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE <include refid="deptListOrDemandIdAll"></include> and`project_status` > 4
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ `project_status` > 4
|
|
|
and YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
|
|
|
@@ -735,27 +703,24 @@
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND (real_demand_commit_time > plan_demand_sub_time)
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ (real_demand_commit_time > plan_demand_sub_time)
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByProjectType" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
SELECT project_type columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- and project_type=#{vo.projectType}
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_type=#{vo.projectType}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectSTS" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
SELECT ifnull(COUNT(demand_id),0)num, ifnull(sum(evaluation),0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND `project_status` > 4
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ `project_status` > 4
|
|
|
and YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
|
|
|
@@ -764,11 +729,11 @@
|
|
|
SELECT MONTH(NOW()) columnName, de.num, de.evaluationTotal,ifnull(sum(c.contract_amount), 0)
|
|
|
evaluationContractTotal
|
|
|
FROM pm_demand d,pm_contract_info c,
|
|
|
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status > 16 AND MONTH(create_time) =MONTH(NOW()) ) de
|
|
|
- where d.demand_id = c.demand_id and
|
|
|
- <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status > 16 AND MONTH(create_time) =MONTH(NOW()) ) de
|
|
|
+ <include refid="dDeptListOrDemandIdAll"/>
|
|
|
+ d.demand_id = c.demand_id
|
|
|
AND d.project_status > 16
|
|
|
AND MONTH(d.create_time) = MONTH(NOW())
|
|
|
</select>
|
|
@@ -778,11 +743,11 @@
|
|
|
SELECT QUARTER(NOW()) columnName, de.num, de.evaluationTotal,ifnull(sum(c.contract_amount), 0)
|
|
|
evaluationContractTotal
|
|
|
FROM pm_demand d,pm_contract_info c,
|
|
|
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status > 17 AND QUARTER(create_time) =QUARTER(NOW()) ) de
|
|
|
- WHERE d.demand_id = c.demand_id and
|
|
|
- <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status > 17 AND QUARTER(create_time) =QUARTER(NOW()) ) de
|
|
|
+ <include refid="dDeptListOrDemandIdAll"/>
|
|
|
+ d.demand_id = c.demand_id
|
|
|
AND d.project_status > 17
|
|
|
AND QUARTER(d.create_time) = QUARTER(NOW())
|
|
|
</select>
|
|
@@ -792,11 +757,11 @@
|
|
|
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 ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status IN (17,18) AND YEAR(create_time) = YEAR(NOW())-1 ) de
|
|
|
- WHERE d.demand_id = c.demand_id and
|
|
|
- <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status IN (17,18) AND YEAR(create_time) = YEAR(NOW())-1 ) de
|
|
|
+ <include refid="dDeptListOrDemandIdAll"/>
|
|
|
+ d.demand_id = c.demand_id
|
|
|
AND d.project_status IN (17,18)
|
|
|
AND YEAR(d.create_time) = YEAR(NOW())-1
|
|
|
</select>
|
|
@@ -806,11 +771,11 @@
|
|
|
SELECT YEAR(NOW()) columnName, de.num,de.evaluationTotal,ifnull(sum(c.contract_amount), 0)
|
|
|
evaluationContractTotal
|
|
|
FROM pm_demand d, pm_contract_info c,
|
|
|
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status > 17 AND YEAR(create_time) = YEAR(NOW()) ) de
|
|
|
- WHERE d.demand_id = c.demand_id and
|
|
|
- <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status > 17 AND YEAR(create_time) = YEAR(NOW()) ) de
|
|
|
+ <include refid="dDeptListOrDemandIdAll"/>
|
|
|
+ d.demand_id = c.demand_id
|
|
|
AND d.project_status > 17
|
|
|
AND YEAR(d.create_time) = YEAR(NOW())
|
|
|
</select>
|
|
@@ -820,31 +785,31 @@
|
|
|
SELECT YEAR(NOW()) columnName, de.num,de.evaluationTotal,ifnull(sum(c.contract_amount), 0)
|
|
|
evaluationContractTotal
|
|
|
FROM pm_demand d, pm_contract_info c,
|
|
|
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status > 17 ) de
|
|
|
- WHERE d.demand_id = c.demand_id and
|
|
|
- <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
- AND d.project_status > 17
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status > 17 ) de
|
|
|
+ <include refid="dDeptListOrDemandIdAll"/>
|
|
|
+ d.demand_id = c.demand_id AND d.project_status > 17
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCCThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
SELECT YEAR(NOW()) columnName,ifnull(COUNT(demand_id), 0) num,ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM pm_demand
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND real_purchase_finish_time <=plan_purchase_finish_time
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ real_purchase_finish_time <=plan_purchase_finish_time
|
|
|
AND YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
|
|
|
|
<sql id="countProjectExceedAndStatus">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num,ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM pm_demand
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
+ <include refid="deptListOrDemandIdAllNoAnd"/>
|
|
|
+ <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
|
|
|
+ AND
|
|
|
+ </if>
|
|
|
<if test="vo.projectStatusList!=null and vo.projectStatusList.size != 0">
|
|
|
- AND project_status in
|
|
|
+ project_status in
|
|
|
<foreach collection="vo.projectStatusList" item="item" index="index"
|
|
|
separator="," open="(" close=")">
|
|
|
#{item}
|
|
@@ -855,7 +820,7 @@
|
|
|
|
|
|
<select id="countProjectExceedAndStatus" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
- <include refid="countProjectExceedAndStatus"></include>
|
|
|
+ <include refid="countProjectExceedAndStatus"/>
|
|
|
</select>
|
|
|
|
|
|
<select id="countBaseAgencyWithWhite" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
@@ -868,9 +833,8 @@
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
SELECT YEAR(NOW()) columnName,ifnull(COUNT(demand_id), 0) num,ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM pm_demand
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND project_status > 8
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ project_status > 8
|
|
|
# AND YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
|
|
|
@@ -878,10 +842,12 @@
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num,ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM pm_demand
|
|
|
- WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
+ <include refid="deptListOrDemandIdAllNoAnd"/>
|
|
|
+ <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
|
|
|
+ AND
|
|
|
+ </if>
|
|
|
<if test="vo.projectStatusList!=null and vo.projectStatusList.size != 0">
|
|
|
- AND project_status in
|
|
|
+ project_status in
|
|
|
<foreach collection="vo.projectStatusList" item="item" index="index"
|
|
|
separator="," open="(" close=")">
|
|
|
#{item}
|
|
@@ -896,12 +862,11 @@
|
|
|
SELECT #{vo.year} columnName, de.num, de.evaluationTotal, ifnull(sum(c.contract_amount), 0)
|
|
|
evaluationContractTotal
|
|
|
FROM pm_demand d, pm_contract_info c,
|
|
|
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND real_purchase_finish_time > plan_purchase_finish_time AND YEAR(create_time)=#{vo.year} ) de
|
|
|
- WHERE
|
|
|
- <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
- AND d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ real_purchase_finish_time > plan_purchase_finish_time AND YEAR(create_time)=#{vo.year} ) de
|
|
|
+ <include refid="dDeptListOrDemandIdAll"/>
|
|
|
+ d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
|
|
|
YEAR(d.create_time)=#{vo.year}
|
|
|
</select>
|
|
|
|
|
@@ -910,33 +875,33 @@
|
|
|
SELECT #{vo.year} columnName, de.num, de.evaluationTotal, ifnull(sum(c.contract_amount), 0)
|
|
|
evaluationContractTotal
|
|
|
FROM pm_demand d, pm_contract_info c,
|
|
|
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND real_purchase_finish_time > plan_purchase_finish_time AND YEAR(create_time)=#{vo.year} AND
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ real_purchase_finish_time > plan_purchase_finish_time AND YEAR(create_time)=#{vo.year} AND
|
|
|
QUARTER(create_time)=#{vo.quarter}) de
|
|
|
- WHERE
|
|
|
- <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
- AND d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
|
|
|
+ <include refid="dDeptListOrDemandIdAll"/>
|
|
|
+ d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
|
|
|
YEAR(d.create_time)=#{vo.year} AND QUARTER(d.create_time)=#{vo.quarter}
|
|
|
</select>
|
|
|
|
|
|
<select id="countProjectACT_Mon" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
- parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">SELECT #{vo.year} columnName, de.num,
|
|
|
+ parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
+ SELECT #{vo.year} columnName, de.num,
|
|
|
de.evaluationTotal, ifnull(sum(c.contract_amount), 0)
|
|
|
evaluationContractTotal
|
|
|
FROM pm_demand d, pm_contract_info c,
|
|
|
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE
|
|
|
- <include refid="deptListOrDemandIdAll"></include>
|
|
|
- AND real_purchase_finish_time > plan_purchase_finish_time AND
|
|
|
+ (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
|
|
|
+ <include refid="deptListOrDemandIdAll"/>
|
|
|
+ real_purchase_finish_time > plan_purchase_finish_time AND
|
|
|
YEAR(create_time)=#{vo.year} AND month(create_time)=#{vo.month}) de
|
|
|
- WHERE
|
|
|
- <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
- AND d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
|
|
|
+ <include refid="dDeptListOrDemandIdAll"/>
|
|
|
+ d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
|
|
|
YEAR(d.create_time)=#{vo.year} AND month(d.create_time)=#{vo.month}
|
|
|
</select>
|
|
|
|
|
|
<!-- 统计里查询全部or查询指定部门及下级超额项目-->
|
|
|
<sql id="deptListOrDemandIdAll">
|
|
|
+ WHERE
|
|
|
<if test="vo.deptList != null and vo.deptList.size != 0 ">
|
|
|
purchase_dept_id
|
|
|
in
|
|
@@ -945,7 +910,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="vo.deptList != null and vo.deptList.size != 0 and vo.demandIdAll != null and vo.demandIdAll.size != 0">
|
|
|
+ <if test="(vo.deptList != null and vo.deptList.size != 0) and (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
|
|
|
AND
|
|
|
</if>
|
|
|
<if test="vo.demandIdAll != null and vo.demandIdAll.size != 0 ">
|
|
@@ -956,10 +921,36 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
|
|
|
+ AND
|
|
|
+ </if>
|
|
|
</sql>
|
|
|
|
|
|
+ <sql id="deptListOrDemandIdAllNoAnd">
|
|
|
+ WHERE
|
|
|
+ <if test="vo.deptList != null and vo.deptList.size != 0 ">
|
|
|
+ purchase_dept_id
|
|
|
+ in
|
|
|
+ <foreach collection="vo.deptList" item="item" index="index"
|
|
|
+ separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="(vo.deptList != null and vo.deptList.size != 0) and (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
|
|
|
+ AND
|
|
|
+ </if>
|
|
|
+ <if test="vo.demandIdAll != null and vo.demandIdAll.size != 0 ">
|
|
|
+ demand_id
|
|
|
+ in
|
|
|
+ <foreach collection="vo.demandIdAll" item="item" index="index"
|
|
|
+ separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
|
|
|
<sql id="dDeptListOrDemandIdAll">
|
|
|
+ WHERE
|
|
|
<if test="vo.deptList != null and vo.deptList.size != 0 ">
|
|
|
d.purchase_dept_id
|
|
|
in
|
|
@@ -968,7 +959,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="vo.deptList != null and vo.deptList.size != 0 and vo.demandIdAll != null and vo.demandIdAll.size != 0">
|
|
|
+ <if test="(vo.deptList != null and vo.deptList.size != 0) and (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
|
|
|
AND
|
|
|
</if>
|
|
|
<if test="vo.demandIdAll != null and vo.demandIdAll.size != 0 ">
|
|
@@ -979,6 +970,9 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
|
|
|
+ AND
|
|
|
+ </if>
|
|
|
</sql>
|
|
|
|
|
|
|