|
@@ -202,4 +202,40 @@
|
|
|
from pm_demand
|
|
|
where project_status in (4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectMinYear" resultType="java.lang.Integer">
|
|
|
+ select min(year (plan_demand_sub_time))
|
|
|
+ from pm_demand
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectpurchaseProjectCompleteNumberYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
|
|
|
+ resultType="java.util.Map">
|
|
|
+ select ifnull(sum(a.evaluation), 0) evaluation, year (a.plan_demand_sub_time) yy, ifnull(sum(b.contract_amount), 0) contractAmount
|
|
|
+ from (
|
|
|
+ select evaluation, plan_demand_sub_time, demand_id from pm_demand where project_status = '17'
|
|
|
+ ) a left join (
|
|
|
+ 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)
|
|
|
+ </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, ifnull(sum(b.contract_amount), 0) contractAmount from (
|
|
|
+ select evaluation, plan_demand_sub_time, demand_id from pm_demand where project_status = '17' and year (plan_demand_sub_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))
|
|
|
+ </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, ifnull(sum(b.contract_amount), 0) contractAmount from (
|
|
|
+ select evaluation, plan_demand_sub_time, demand_id from pm_demand where project_status = '17' and year(plan_demand_sub_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')
|
|
|
+ </select>
|
|
|
</mapper>
|