|
@@ -150,7 +150,52 @@
|
|
AND evaluation > #{vo.evaluation}
|
|
AND evaluation > #{vo.evaluation}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="countProjectExceed" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
|
|
|
+ <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
|
|
|
|
+ FROM `pm_demand`
|
|
|
|
+ WHERE purchase_dept_id in
|
|
|
|
+ <foreach collection="vo.deptList" item="item" index="index"
|
|
|
|
+ separator="," open="(" close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ 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)
|
|
|
|
+ and YEAR(create_time) = YEAR(NOW())
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <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
|
|
|
|
+ FROM `pm_demand`
|
|
|
|
+ WHERE purchase_dept_id in
|
|
|
|
+ <foreach collection="vo.deptList" item="item" index="index"
|
|
|
|
+ separator="," open="(" close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ 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)
|
|
|
|
+ and quarter(create_time) = quarter(NOW())
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <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
|
|
|
|
+ FROM `pm_demand`
|
|
|
|
+ WHERE purchase_dept_id in
|
|
|
|
+ <foreach collection="vo.deptList" item="item" index="index"
|
|
|
|
+ separator="," open="(" close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ 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)
|
|
|
|
+ and MONTH(create_time) = MONTH(NOW())
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="countProjectExceedAllNum" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
SELECT COUNT(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
FROM `pm_demand`
|
|
FROM `pm_demand`
|
|
@@ -162,7 +207,6 @@
|
|
AND (real_demand_commit_time > plan_demand_sub_time
|
|
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())
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="countThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
<select id="countThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
@@ -174,7 +218,7 @@
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- AND DATE_FORMAT(create_time, '%Y') = YEAR(NOW())
|
|
|
|
|
|
+ AND YEAR(create_time) = YEAR(NOW())
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="countProjectExceedYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
<select id="countProjectExceedYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
@@ -254,7 +298,7 @@
|
|
</foreach>
|
|
</foreach>
|
|
AND find_in_set('1', project_attr)
|
|
AND find_in_set('1', project_attr)
|
|
AND `project_status` = #{vo.projectStatus}
|
|
AND `project_status` = #{vo.projectStatus}
|
|
- AND DATE_FORMAT(create_time, '%Y') = year(now())
|
|
|
|
|
|
+ AND YEAR(create_time ) = 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">
|
|
@@ -269,7 +313,7 @@
|
|
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 YEAR(create_time ) = YEAR(NOW())
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="taskQuantityYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
<select id="taskQuantityYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
@@ -279,19 +323,17 @@
|
|
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
|
|
|
|
- , '%Y') = YEAR(NOW())
|
|
|
|
|
|
+ and YEAR(create_time) = 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"
|
|
parameterType="java.lang.String">
|
|
parameterType="java.lang.String">
|
|
- SELECT YEAR (NOW()) - 1 columnName, COUNT (demand_id) num
|
|
|
|
|
|
+ SELECT YEAR(NOW()) - 1 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
|
|
|
|
- , '%Y') = YEAR (NOW()) - 1
|
|
|
|
|
|
+ and YEAR(create_time) = YEAR(NOW()) - 1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="countEveryStatusNum" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
<select id="countEveryStatusNum" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
@@ -304,7 +346,7 @@
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
AND `project_status` IN (9, 10, 11, 12, 13, 14,15,16,17)
|
|
AND `project_status` IN (9, 10, 11, 12, 13, 14,15,16,17)
|
|
- and DATE_FORMAT(create_time, '%Y') = YEAR(NOW())
|
|
|
|
|
|
+ and YEAR(create_time) = YEAR(NOW())
|
|
GROUP BY project_status
|
|
GROUP BY project_status
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -326,7 +368,7 @@
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- AND find_in_set('1', project_attr) AND DATE_FORMAT(create_time, '%Y') =YEAR(NOW()) - 1 ) de
|
|
|
|
|
|
+ AND find_in_set('1', project_attr) AND YEAR(create_time) =YEAR(NOW()) - 1 ) de
|
|
WHERE d.demand_id = c.demand_id
|
|
WHERE d.demand_id = c.demand_id
|
|
AND find_in_set('1', d.project_attr)
|
|
AND find_in_set('1', d.project_attr)
|
|
AND d.purchase_dept_id in
|
|
AND d.purchase_dept_id in
|
|
@@ -334,11 +376,11 @@
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- AND DATE_FORMAT(d.create_time, '%Y') = YEAR(NOW()) - 1
|
|
|
|
|
|
+ AND YEAR(d.create_time) = 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">
|
|
- SELECT DATE_FORMAT(create_time, '%Y') columnName, COUNT(demand_id) num
|
|
|
|
|
|
+ SELECT YEAR(create_time) columnName, COUNT(demand_id) num
|
|
FROM `pm_demand`
|
|
FROM `pm_demand`
|
|
WHERE purchase_dept_id in
|
|
WHERE purchase_dept_id in
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -346,7 +388,7 @@
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
AND find_in_set('1', project_attr)
|
|
AND find_in_set('1', project_attr)
|
|
- GROUP BY DATE_FORMAT(create_time, '%Y')
|
|
|
|
|
|
+ GROUP BY YEAR(create_time)
|
|
order by create_time asc
|
|
order by create_time asc
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -372,7 +414,7 @@
|
|
</foreach>
|
|
</foreach>
|
|
AND find_in_set('1', project_attr)
|
|
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 YEAR(create_time) = #{year}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 正常推进项目 -->
|
|
<!-- 正常推进项目 -->
|
|
@@ -555,7 +597,7 @@
|
|
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 YEAR(create_time) = 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"
|
|
@@ -644,7 +686,7 @@
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
AND `project_status` IN (6,7,8,9,10,11,12,13,14,15, 16, 17)
|
|
AND `project_status` IN (6,7,8,9,10,11,12,13,14,15, 16, 17)
|
|
- and DATE_FORMAT(create_time, '%Y') = YEAR(NOW())-1
|
|
|
|
|
|
+ and YEAR(create_time) = YEAR(NOW())-1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectSTSThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
<select id="selectSTSThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
@@ -656,7 +698,7 @@
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
AND `project_status` > 4
|
|
AND `project_status` > 4
|
|
- and DATE_FORMAT(create_time, '%Y') = YEAR(NOW())
|
|
|
|
|
|
+ and YEAR(create_time) = YEAR(NOW())
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectmeiJiDu" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
<select id="selectmeiJiDu" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
@@ -693,7 +735,7 @@
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
AND `project_status` > 4
|
|
AND `project_status` > 4
|
|
- and DATE_FORMAT(create_time, '%Y') = YEAR(NOW())
|
|
|
|
|
|
+ and YEAR(create_time) = YEAR(NOW())
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectCGThisMonth" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
<select id="selectCGThisMonth" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
@@ -707,14 +749,14 @@
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- AND project_status > 16 AND DATE_FORMAT(create_time, '%Y') =MONTH(NOW()) ) de
|
|
|
|
|
|
+ AND project_status > 16 AND MONTH(create_time) =MONTH(NOW()) ) de
|
|
where d.demand_id = c.demand_id and purchase_dept_id in
|
|
where d.demand_id = c.demand_id and purchase_dept_id in
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
AND d.project_status > 16
|
|
AND d.project_status > 16
|
|
- AND DATE_FORMAT(d.create_time, '%Y') = MONTH(NOW())
|
|
|
|
|
|
+ AND MONTH(d.create_time) = MONTH(NOW())
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectCGThisQua" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
<select id="selectCGThisQua" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
@@ -728,14 +770,14 @@
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- AND project_status > 17 AND DATE_FORMAT(create_time, '%Y') =QUARTER(NOW()) ) de
|
|
|
|
|
|
+ AND project_status > 17 AND QUARTER(create_time) =QUARTER(NOW()) ) de
|
|
WHERE d.demand_id = c.demand_id and purchase_dept_id in
|
|
WHERE d.demand_id = c.demand_id and purchase_dept_id in
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
AND d.project_status > 17
|
|
AND d.project_status > 17
|
|
- AND DATE_FORMAT(d.create_time, '%Y') = QUARTER(NOW())
|
|
|
|
|
|
+ AND QUARTER(d.create_time) = QUARTER(NOW())
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectZJLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
<select id="selectZJLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
@@ -749,14 +791,14 @@
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- AND project_status IN (17,18) AND DATE_FORMAT(create_time, '%Y') = YEAR(NOW())-1 ) de
|
|
|
|
|
|
+ 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
|
|
WHERE d.demand_id = c.demand_id and purchase_dept_id in
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
AND d.project_status IN (17,18)
|
|
AND d.project_status IN (17,18)
|
|
- AND DATE_FORMAT(d.create_time, '%Y') = YEAR(NOW())-1
|
|
|
|
|
|
+ AND YEAR(d.create_time) = YEAR(NOW())-1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectTBThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
<select id="selectTBThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
@@ -770,14 +812,14 @@
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
- AND project_status > 17 AND DATE_FORMAT(create_time, '%Y') = YEAR(NOW()) ) de
|
|
|
|
|
|
+ AND project_status > 17 AND YEAR(create_time) = YEAR(NOW()) ) de
|
|
WHERE d.demand_id = c.demand_id and purchase_dept_id in
|
|
WHERE d.demand_id = c.demand_id and purchase_dept_id in
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
separator="," open="(" close=")">
|
|
separator="," open="(" close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
AND d.project_status > 17
|
|
AND d.project_status > 17
|
|
- AND DATE_FORMAT(d.create_time, '%Y') = YEAR(NOW())
|
|
|
|
|
|
+ AND YEAR(d.create_time) = YEAR(NOW())
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectCCThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
<select id="selectCCThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|