|
@@ -94,15 +94,8 @@
|
|
|
SELECT project_attr columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
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>
|
|
|
- AND
|
|
|
- </if>
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
+ AND
|
|
|
find_in_set(#{vo.projectAttr},project_attr)
|
|
|
</select>
|
|
|
|
|
@@ -122,11 +115,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND evaluation < #{vo.evaluation}
|
|
|
</select>
|
|
|
|
|
@@ -134,22 +124,16 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
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=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND 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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND evaluation > #{vo.evaluation}
|
|
|
</select>
|
|
|
|
|
@@ -157,11 +141,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND ( real_purchase_finish_time > plan_purchase_finish_time )
|
|
|
and YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
@@ -170,11 +151,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND ( real_purchase_finish_time > plan_purchase_finish_time )
|
|
|
and quarter(create_time) = quarter(NOW())
|
|
|
</select>
|
|
@@ -183,11 +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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND ( real_purchase_finish_time > plan_purchase_finish_time )
|
|
|
and MONTH(create_time) = MONTH(NOW())
|
|
|
</select>
|
|
@@ -196,11 +171,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND ( real_purchase_finish_time > plan_purchase_finish_time)
|
|
|
</select>
|
|
|
|
|
@@ -283,11 +255,8 @@
|
|
|
resultType="com.ozs.pm.doman.PmDemand">
|
|
|
SELECT *
|
|
|
FROM `pm_demand`
|
|
|
- WHERE purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
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)
|
|
@@ -297,11 +266,8 @@
|
|
|
<sql id="majorProjectByStatus">
|
|
|
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=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND find_in_set('1', project_attr)
|
|
|
</sql>
|
|
|
|
|
@@ -363,7 +329,7 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
<include refid="majorProjectByStatus"></include>
|
|
|
AND YEAR(create_time ) = YEAR(now())-1
|
|
|
- <if test="vo.projectStatusList!=null">
|
|
|
+ <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=")">
|
|
@@ -426,11 +392,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND `project_status` IN (9, 10, 11, 12, 13, 14,15,16,17)
|
|
|
and YEAR(create_time) = YEAR(NOW())
|
|
|
GROUP BY project_status
|
|
@@ -510,11 +473,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ where
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND project_status !=21
|
|
|
and (real_demand_commit_time < plan_demand_sub_time
|
|
|
or real_purchase_finish_time < plan_purchase_finish_time
|
|
@@ -525,11 +485,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ where
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND project_status !=21
|
|
|
</select>
|
|
|
|
|
@@ -617,11 +574,8 @@
|
|
|
from (
|
|
|
select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
- where purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ where
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND project_status in (15, 16, 17)
|
|
|
) a
|
|
|
left join (
|
|
@@ -639,11 +593,8 @@
|
|
|
from (
|
|
|
select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
- where purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ where
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND project_status in (15, 16, 17)
|
|
|
and year(create_time) = year(NOW())
|
|
|
) a
|
|
@@ -662,11 +613,8 @@
|
|
|
from (
|
|
|
select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
- where purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ where
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND project_status in (15, 16, 17)
|
|
|
and year(create_time) = year(NOW())
|
|
|
) a
|
|
@@ -691,12 +639,9 @@
|
|
|
<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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- <if test="vo.projectStatusList!=null">
|
|
|
+ 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=")">
|
|
@@ -708,12 +653,9 @@
|
|
|
<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=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- <if test="vo.projectStatusList!=null">
|
|
|
+ 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=")">
|
|
@@ -726,11 +668,8 @@
|
|
|
resultType="java.util.Map">
|
|
|
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"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ where
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
group by year(create_time)
|
|
|
</select>
|
|
|
|
|
@@ -738,11 +677,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ where
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND year(create_time) = year(NOW())
|
|
|
group by concat(Year(create_time), quarter(create_time))
|
|
|
</select>
|
|
@@ -751,11 +687,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ where
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND year(create_time) = year(NOW() - 1)
|
|
|
group by concat(Year(create_time), quarter(create_time))
|
|
|
</select>
|
|
@@ -766,11 +699,8 @@
|
|
|
ifnull(sum(evaluation), 0) evaluationSum,
|
|
|
date_format(create_time, '%m') yy
|
|
|
from pm_demand
|
|
|
- where purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ where
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND year(create_time) = year(NOW())
|
|
|
group by date_format(create_time, '%y%m')
|
|
|
</select>
|
|
@@ -789,24 +719,15 @@
|
|
|
<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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- AND `project_status` IN (6,7,8,9,10,11,12,13,14,15, 16, 17)
|
|
|
+ WHERE <include refid="deptListOrDemandIdAll"></include> and`project_status` IN (6,7,8,9,10,11,12,13,14,15, 16,
|
|
|
+ 17)
|
|
|
and YEAR(create_time) = YEAR(NOW())-1
|
|
|
</select>
|
|
|
|
|
|
<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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- AND `project_status` > 4
|
|
|
+ WHERE <include refid="deptListOrDemandIdAll"></include> and`project_status` > 4
|
|
|
and YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
|
|
|
@@ -814,11 +735,8 @@
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
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=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND (real_demand_commit_time > plan_demand_sub_time)
|
|
|
</select>
|
|
|
|
|
@@ -826,23 +744,17 @@
|
|
|
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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- GROUP BY project_type
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
+ and 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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND `project_status` > 4
|
|
|
and YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
@@ -853,18 +765,10 @@
|
|
|
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
|
|
|
- purchase_dept_id
|
|
|
- in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND project_status > 16 AND MONTH(create_time) =MONTH(NOW()) ) de
|
|
|
- where d.demand_id = c.demand_id and purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ where d.demand_id = c.demand_id and
|
|
|
+ <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
AND d.project_status > 16
|
|
|
AND MONTH(d.create_time) = MONTH(NOW())
|
|
|
</select>
|
|
@@ -875,18 +779,10 @@
|
|
|
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
|
|
|
- purchase_dept_id
|
|
|
- in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND project_status > 17 AND QUARTER(create_time) =QUARTER(NOW()) ) de
|
|
|
- WHERE d.demand_id = c.demand_id and purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE d.demand_id = c.demand_id and
|
|
|
+ <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
AND d.project_status > 17
|
|
|
AND QUARTER(d.create_time) = QUARTER(NOW())
|
|
|
</select>
|
|
@@ -897,18 +793,10 @@
|
|
|
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
|
|
|
- purchase_dept_id
|
|
|
- in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE d.demand_id = c.demand_id and
|
|
|
+ <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
AND d.project_status IN (17,18)
|
|
|
AND YEAR(d.create_time) = YEAR(NOW())-1
|
|
|
</select>
|
|
@@ -919,18 +807,10 @@
|
|
|
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
|
|
|
- purchase_dept_id
|
|
|
- in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND project_status > 17 AND YEAR(create_time) = YEAR(NOW()) ) de
|
|
|
- WHERE d.demand_id = c.demand_id and purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE d.demand_id = c.demand_id and
|
|
|
+ <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
AND d.project_status > 17
|
|
|
AND YEAR(d.create_time) = YEAR(NOW())
|
|
|
</select>
|
|
@@ -941,18 +821,10 @@
|
|
|
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
|
|
|
- purchase_dept_id
|
|
|
- in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND project_status > 17 ) de
|
|
|
- WHERE d.demand_id = c.demand_id and purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE d.demand_id = c.demand_id and
|
|
|
+ <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
AND d.project_status > 17
|
|
|
</select>
|
|
|
|
|
@@ -960,11 +832,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND real_purchase_finish_time <=plan_purchase_finish_time
|
|
|
AND YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
@@ -972,12 +841,9 @@
|
|
|
<sql id="countProjectExceedAndStatus">
|
|
|
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=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- <if test="vo.projectStatusList!=null">
|
|
|
+ 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=")">
|
|
@@ -990,13 +856,6 @@
|
|
|
<select id="countProjectExceedAndStatus" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
<include refid="countProjectExceedAndStatus"></include>
|
|
|
- <if test="vo.demandIdAll !=null ">
|
|
|
- AND demand_id in
|
|
|
- <foreach collection="vo.demandIdAll" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="countBaseAgencyWithWhite" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
@@ -1009,11 +868,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 purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND project_status > 8
|
|
|
# AND YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
@@ -1022,12 +878,9 @@
|
|
|
parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
|
|
|
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=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- <if test="vo.projectStatusList!=null">
|
|
|
+ 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=")">
|
|
@@ -1044,18 +897,10 @@
|
|
|
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
|
|
|
- purchase_dept_id
|
|
|
- in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND real_purchase_finish_time > plan_purchase_finish_time AND YEAR(create_time)=#{vo.year} ) de
|
|
|
- WHERE purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
AND d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
|
|
|
YEAR(d.create_time)=#{vo.year}
|
|
|
</select>
|
|
@@ -1066,19 +911,11 @@
|
|
|
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
|
|
|
- purchase_dept_id
|
|
|
- in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND real_purchase_finish_time > plan_purchase_finish_time AND YEAR(create_time)=#{vo.year} AND
|
|
|
QUARTER(create_time)=#{vo.quarter}) de
|
|
|
- WHERE purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ WHERE
|
|
|
+ <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
AND d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
|
|
|
YEAR(d.create_time)=#{vo.year} AND QUARTER(d.create_time)=#{vo.quarter}
|
|
|
</select>
|
|
@@ -1089,23 +926,60 @@
|
|
|
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
|
|
|
- purchase_dept_id
|
|
|
- in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <include refid="deptListOrDemandIdAll"></include>
|
|
|
AND real_purchase_finish_time > plan_purchase_finish_time AND
|
|
|
YEAR(create_time)=#{vo.year} AND month(create_time)=#{vo.month}) de
|
|
|
- WHERE purchase_dept_id in
|
|
|
- <foreach collection="vo.deptList" item="item" index="index"
|
|
|
- separator="," open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
-
|
|
|
+ WHERE
|
|
|
+ <include refid="dDeptListOrDemandIdAll"></include>
|
|
|
AND d.demand_id = c.demand_id AND d.real_purchase_finish_time > d.plan_purchase_finish_time AND
|
|
|
YEAR(d.create_time)=#{vo.year} AND month(d.create_time)=#{vo.month}
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 统计里查询全部or查询指定部门及下级超额项目-->
|
|
|
+ <sql id="deptListOrDemandIdAll">
|
|
|
+ <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">
|
|
|
+ <if test="vo.deptList != null and vo.deptList.size != 0 ">
|
|
|
+ d.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 ">
|
|
|
+ d.demand_id
|
|
|
+ in
|
|
|
+ <foreach collection="vo.demandIdAll" item="item" index="index"
|
|
|
+ separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
|
|
|
</mapper>
|