|
@@ -58,7 +58,6 @@
|
|
|
|
|
|
<select id="purchaseProjectStatisticalXCJ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
- -- DATE_FORMAT(plan_demand_sub_time,'%Y')
|
|
|
select count(demand_id) countXCJ, ifnull(sum(evaluation), 0) evaluationXCJ
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
@@ -67,12 +66,11 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
AND project_status !=17
|
|
|
- and year(plan_demand_sub_time) = year(NOW())
|
|
|
+ and year(create_time) = year(NOW())
|
|
|
</select>
|
|
|
|
|
|
<select id="purchaseProjectStatisticalQNWC" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
- -- DATE_FORMAT(plan_demand_sub_time,'%Y')
|
|
|
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
|
|
@@ -360,11 +358,13 @@
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
<include refid="majorProjectByStatus"></include>
|
|
|
AND YEAR(create_time ) = YEAR(now())-1
|
|
|
- AND project_status in
|
|
|
- <foreach collection="vo.projectStatusList" 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="majorProjectByStatusToThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
@@ -495,8 +495,8 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
AND find_in_set('1', project_attr)
|
|
|
- and QUARTER(create_time) = #{quarter}
|
|
|
- AND YEAR(create_time) = #{year}
|
|
|
+ and QUARTER(create_time) = #{vo.quarter}
|
|
|
+ AND YEAR(create_time) = #{vo.year}
|
|
|
</select>
|
|
|
|
|
|
<!-- 正常推进项目 -->
|
|
@@ -528,7 +528,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMinYear" resultType="java.lang.Integer">
|
|
|
- select min(year(plan_demand_sub_time))
|
|
|
+ select min(year(create_time))
|
|
|
from pm_demand
|
|
|
</select>
|
|
|
|
|
@@ -536,10 +536,10 @@
|
|
|
resultType="java.util.Map">
|
|
|
select count(a.demand_id) countNum,
|
|
|
ifnull(sum(a.evaluation), 0) evaluation,
|
|
|
- year(a.plan_demand_sub_time) yy,
|
|
|
+ year(a.create_time) yy,
|
|
|
ifnull(sum(b.contract_amount), 0) contractAmount
|
|
|
from (
|
|
|
- select evaluation, plan_demand_sub_time, demand_id
|
|
|
+ select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -553,16 +553,16 @@
|
|
|
from pm_contract_info
|
|
|
) b on a.demand_id = b.demand_id
|
|
|
|
|
|
- group by year(plan_demand_sub_time)
|
|
|
+ group by year(create_time)
|
|
|
</select>
|
|
|
|
|
|
<select id="selectpurchaseProjectCompleteNumberQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
select ifnull(sum(a.evaluation), 0) evaluation,
|
|
|
- quarter(a.plan_demand_sub_time) yy,
|
|
|
+ quarter(a.create_time) yy,
|
|
|
ifnull(sum(b.contract_amount), 0) contractAmount
|
|
|
from (
|
|
|
- select evaluation, plan_demand_sub_time, demand_id
|
|
|
+ select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -570,22 +570,22 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
AND project_status = '21'
|
|
|
- and year(plan_demand_sub_time) = year(NOW())
|
|
|
+ and year(create_time) = year(NOW())
|
|
|
) a
|
|
|
left join (
|
|
|
select contract_amount, demand_id
|
|
|
from pm_contract_info
|
|
|
) b on a.demand_id = b.demand_id
|
|
|
- group by concat(Year(a.plan_demand_sub_time), quarter(a.plan_demand_sub_time))
|
|
|
+ group by concat(Year(a.create_time), quarter(a.create_time))
|
|
|
</select>
|
|
|
|
|
|
<select id="selectpurchaseProjectCompleteNumberMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
select ifnull(sum(a.evaluation), 0) evaluation,
|
|
|
- date_format(plan_demand_sub_time, '%m') yy,
|
|
|
+ date_format(create_time, '%m') yy,
|
|
|
ifnull(sum(b.contract_amount), 0) contractAmount
|
|
|
from (
|
|
|
- select evaluation, plan_demand_sub_time, demand_id
|
|
|
+ select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -593,23 +593,23 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
AND project_status = '21'
|
|
|
- and year(plan_demand_sub_time) = year(NOW())
|
|
|
+ and year(create_time) = year(NOW())
|
|
|
) a
|
|
|
left join (
|
|
|
select contract_amount, demand_id
|
|
|
from pm_contract_info
|
|
|
) b on a.demand_id = b.demand_id
|
|
|
- group by date_format(a.plan_demand_sub_time, '%y%m')
|
|
|
+ group by date_format(a.create_time, '%y%m')
|
|
|
</select>
|
|
|
|
|
|
<select id="selectPurchaseTaskFinishYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
select count(a.demand_id) countNum,
|
|
|
ifnull(sum(a.evaluation), 0) evaluation,
|
|
|
- year(a.plan_demand_sub_time) yy,
|
|
|
+ year(a.create_time) yy,
|
|
|
ifnull(sum(b.contract_amount), 0) contractAmount
|
|
|
from (
|
|
|
- select evaluation, plan_demand_sub_time, demand_id
|
|
|
+ select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -622,16 +622,16 @@
|
|
|
select contract_amount, demand_id
|
|
|
from pm_contract_info
|
|
|
) b on a.demand_id = b.demand_id
|
|
|
- group by year(a.plan_demand_sub_time)
|
|
|
+ group by year(a.create_time)
|
|
|
</select>
|
|
|
|
|
|
<select id="selectPurchaseTaskFinishQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
select ifnull(sum(a.evaluation), 0) evaluation,
|
|
|
- quarter(a.plan_demand_sub_time) yy,
|
|
|
+ quarter(a.create_time) yy,
|
|
|
ifnull(sum(b.contract_amount), 0) contractAmount
|
|
|
from (
|
|
|
- select evaluation, plan_demand_sub_time, demand_id
|
|
|
+ select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -639,22 +639,22 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
AND project_status in (15, 16, 17)
|
|
|
- and year(plan_demand_sub_time) = year(NOW())
|
|
|
+ and year(create_time) = year(NOW())
|
|
|
) a
|
|
|
left join (
|
|
|
select contract_amount, demand_id
|
|
|
from pm_contract_info
|
|
|
) b on a.demand_id = b.demand_id
|
|
|
- group by concat(Year(a.plan_demand_sub_time), quarter(a.plan_demand_sub_time))
|
|
|
+ group by concat(Year(a.create_time), quarter(a.create_time))
|
|
|
</select>
|
|
|
|
|
|
<select id="selectPurchaseTaskFinishMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
select ifnull(sum(a.evaluation), 0) evaluation,
|
|
|
- date_format(plan_demand_sub_time, '%m') yy,
|
|
|
+ date_format(create_time, '%m') yy,
|
|
|
ifnull(sum(b.contract_amount), 0) contractAmount
|
|
|
from (
|
|
|
- select evaluation, plan_demand_sub_time, demand_id
|
|
|
+ select evaluation, create_time, demand_id
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
@@ -662,13 +662,13 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
AND project_status in (15, 16, 17)
|
|
|
- and year(plan_demand_sub_time) = year(NOW())
|
|
|
+ and year(create_time) = year(NOW())
|
|
|
) a
|
|
|
left join (
|
|
|
select contract_amount, demand_id
|
|
|
from pm_contract_info
|
|
|
) b on a.demand_id = b.demand_id
|
|
|
- group by date_format(a.plan_demand_sub_time, '%y%m')
|
|
|
+ group by date_format(a.create_time, '%y%m')
|
|
|
</select>
|
|
|
|
|
|
<select id="countProjectExceedAndMajor" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
@@ -690,74 +690,77 @@
|
|
|
separator="," open="(" close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
- AND project_status in
|
|
|
- <foreach item="item" collection="vo.projectStatusList" 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="purchaseProjectNumberAnalysisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
- select count(demand_id) countNum, ifnull(sum(evaluation), 0) evaluationSum, year(plan_demand_sub_time) yy
|
|
|
+ select count(demand_id) countNum, ifnull(sum(evaluation), 0) evaluationSum, year(create_time) yy
|
|
|
from pm_demand
|
|
|
where purchase_dept_id in
|
|
|
<foreach collection="vo.deptList" item="item" index="index"
|
|
|
separator="," open="(" close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
- group by year(plan_demand_sub_time)
|
|
|
+ group by year(create_time)
|
|
|
</select>
|
|
|
|
|
|
<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(plan_demand_sub_time) yy
|
|
|
+ select count(demand_id) 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>
|
|
|
- AND year(plan_demand_sub_time) = year(NOW())
|
|
|
- group by concat(Year(plan_demand_sub_time), quarter(plan_demand_sub_time))
|
|
|
+ AND year(create_time) = year(NOW())
|
|
|
+ group by concat(Year(create_time), quarter(create_time))
|
|
|
</select>
|
|
|
|
|
|
<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(plan_demand_sub_time) yy
|
|
|
+ select count(demand_id) 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>
|
|
|
- AND year(plan_demand_sub_time) = year(NOW() - 1)
|
|
|
- group by concat(Year(plan_demand_sub_time), quarter(plan_demand_sub_time))
|
|
|
+ AND year(create_time) = year(NOW() - 1)
|
|
|
+ group by concat(Year(create_time), quarter(create_time))
|
|
|
</select>
|
|
|
|
|
|
<select id="purchaseProjectNumberAnalysisMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
select count(demand_id) countNum,
|
|
|
ifnull(sum(evaluation), 0) evaluationSum,
|
|
|
- date_format(plan_demand_sub_time, '%m') yy
|
|
|
+ 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>
|
|
|
- AND year(plan_demand_sub_time) = year(NOW())
|
|
|
- group by date_format(plan_demand_sub_time, '%y%m')
|
|
|
+ AND year(create_time) = year(NOW())
|
|
|
+ group by date_format(create_time, '%y%m')
|
|
|
</select>
|
|
|
|
|
|
<select id="purchaseProjectNumberAnalysisOldYearMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="java.util.Map">
|
|
|
- select count(demand_id) countNum,
|
|
|
- ifnull(sum(evaluation), 0) evaluationSum,
|
|
|
- date_format(plan_demand_sub_time, '%m') yy
|
|
|
+ select count(demand_id) countNum,
|
|
|
+ ifnull(sum(evaluation), 0) evaluationSum,
|
|
|
+ date_format(create_time, '%m') yy
|
|
|
from pm_demand
|
|
|
where purchase_dept_id = #{purchaseDeptId}
|
|
|
- AND year(plan_demand_sub_time) = YEAR(NOW()) - 1
|
|
|
- group by date_format(plan_demand_sub_time, '%y%m')
|
|
|
+ AND year(create_time) = YEAR(NOW()) - 1
|
|
|
+ group by date_format(create_time, '%y%m')
|
|
|
</select>
|
|
|
|
|
|
<select id="selectSTSLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
@@ -946,11 +949,13 @@
|
|
|
separator="," open="(" close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
- AND project_status in
|
|
|
- <foreach collection="vo.projectStatusList" 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>
|
|
|
AND real_purchase_finish_time >plan_purchase_finish_time
|
|
|
</sql>
|
|
|
|
|
@@ -982,7 +987,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
AND project_status > 8
|
|
|
- AND YEAR(create_time) = YEAR(NOW())
|
|
|
+ # AND YEAR(create_time) = YEAR(NOW())
|
|
|
</select>
|
|
|
|
|
|
<select id="countProjecReaAndStatus" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
@@ -994,12 +999,81 @@
|
|
|
separator="," open="(" close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
- AND project_status in
|
|
|
- <foreach collection="vo.projectStatusList" item="item" index="index"
|
|
|
+ <if test="vo.projectStatusList!=null">
|
|
|
+ AND project_status in
|
|
|
+ <foreach collection="vo.projectStatusList" item="item" index="index"
|
|
|
+ separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and YEAR(create_time) = YEAR(NOW())-1
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="countProjectACT_Year" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
+ 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 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 YEAR(create_time) = YEAR(NOW())-1
|
|
|
+ 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>
|
|
|
+ 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>
|
|
|
+
|
|
|
+ <select id="countProjectACT_Qua" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
|
|
|
+ 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 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_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>
|
|
|
+ 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>
|
|
|
+
|
|
|
+ <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,
|
|
|
+ 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
|
|
|
+ in
|
|
|
+ <foreach collection="vo.deptList" item="item" index="index"
|
|
|
+ separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ 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>
|
|
|
+
|
|
|
+ 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>
|
|
|
|
|
|
|