|
@@ -148,7 +148,8 @@
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
<include refid="deptListOrDemandIdAll"/>
|
|
|
- now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
|
|
|
+ ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
|
|
|
+ or (real_purchase_finish_time > plan_purchase_finish_time))
|
|
|
and YEAR(plan_demand_sub_time) = YEAR(NOW())
|
|
|
</select>
|
|
|
|
|
@@ -157,7 +158,8 @@
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
<include refid="deptListOrDemandIdAll"/>
|
|
|
- now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
|
|
|
+ ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
|
|
|
+ or (real_purchase_finish_time > plan_purchase_finish_time))
|
|
|
and quarter(plan_demand_sub_time) = quarter(NOW())
|
|
|
</select>
|
|
|
|
|
@@ -166,7 +168,8 @@
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
<include refid="deptListOrDemandIdAll"/>
|
|
|
- now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
|
|
|
+ ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
|
|
|
+ or (real_purchase_finish_time > plan_purchase_finish_time))
|
|
|
and MONTH(plan_demand_sub_time) = MONTH(NOW())
|
|
|
</select>
|
|
|
|
|
@@ -175,7 +178,8 @@
|
|
|
SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
|
|
|
FROM `pm_demand`
|
|
|
<include refid="deptListOrDemandIdAll"/>
|
|
|
- now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time)
|
|
|
+ ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
|
|
|
+ or (real_purchase_finish_time > plan_purchase_finish_time))
|
|
|
</select>
|
|
|
|
|
|
<select id="countProjectExceedTZ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
@@ -309,19 +313,19 @@
|
|
|
<select id="majorProjectByStatusThisMonthFi" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
|
|
|
<include refid="majorProjectByStatus"/>
|
|
|
- AND MONTH(plan_purchase_finish_time ) = MONTH(now())
|
|
|
+ AND MONTH(up_acceptance_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"/>
|
|
|
- AND QUARTER(plan_purchase_finish_time ) = QUARTER(now())
|
|
|
+ AND QUARTER(up_acceptance_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"/>
|
|
|
- AND YEAR(plan_purchase_finish_time ) = YEAR(now())
|
|
|
+ AND YEAR(up_acceptance_time ) = YEAR(now())
|
|
|
AND project_status >= #{vo.projectStatus}
|
|
|
</select>
|
|
|
<select id="majorProjectByStatusThisMonthFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
@@ -583,57 +587,60 @@
|
|
|
resultType="java.util.Map">
|
|
|
select count(a.demand_id) countNum,
|
|
|
ifnull(sum(a.evaluation), 0) evaluation,
|
|
|
- year(a.create_time) yy,
|
|
|
+ year(a.up_acceptance_time) yy,
|
|
|
ifnull(sum(b.contract_amount), 0) contractAmount
|
|
|
from (
|
|
|
- select evaluation, create_time, demand_id
|
|
|
+ select evaluation, up_acceptance_time, demand_id
|
|
|
from pm_demand
|
|
|
<include refid="deptListOrDemandIdAll"/>
|
|
|
project_status in (15, 16, 17)
|
|
|
+ and up_acceptance_time!=null
|
|
|
) a
|
|
|
left join (
|
|
|
select contract_amount, demand_id
|
|
|
from pm_contract_info
|
|
|
) b on a.demand_id = b.demand_id
|
|
|
- group by year(a.create_time)
|
|
|
+ group by year(a.up_acceptance_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.create_time) yy,
|
|
|
+ quarter(a.up_acceptance_time) yy,
|
|
|
ifnull(sum(b.contract_amount), 0) contractAmount
|
|
|
from (
|
|
|
- select evaluation, create_time, demand_id
|
|
|
+ select evaluation, up_acceptance_time, demand_id
|
|
|
from pm_demand
|
|
|
<include refid="deptListOrDemandIdAll"/>
|
|
|
project_status in (15, 16, 17)
|
|
|
- and year(create_time) = year(NOW())
|
|
|
+ and up_acceptance_time!=null
|
|
|
+ and year(up_acceptance_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.create_time), quarter(a.create_time))
|
|
|
+ group by concat(Year(a.up_acceptance_time), quarter(a.up_acceptance_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(create_time, '%m') yy,
|
|
|
+ date_format(up_acceptance_time, '%m') yy,
|
|
|
ifnull(sum(b.contract_amount), 0) contractAmount
|
|
|
from (
|
|
|
- select evaluation, create_time, demand_id
|
|
|
+ select evaluation, up_acceptance_time, demand_id
|
|
|
from pm_demand
|
|
|
<include refid="deptListOrDemandIdAll"/>
|
|
|
project_status in (15, 16, 17)
|
|
|
- and year(create_time) = year(NOW())
|
|
|
+ and up_acceptance_time!=null
|
|
|
+ and year(up_acceptance_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.create_time, '%y%m')
|
|
|
+ group by date_format(a.up_acceptance_time, '%y%m')
|
|
|
</select>
|
|
|
|
|
|
<select id="countProjectExceedAndMajor" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|