12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ozs.pm.mapper.PmDemandMapper">
- <select id="selectByDemandIdList" parameterType="java.util.List" resultType="com.ozs.pm.doman.PmDemand">
- select * from pm_demand where project_status > 12 and demand_id in
- <foreach item="item" collection="demandIdList" separator="," open="(" close=")" index="">
- #{item}
- </foreach>
- </select>
- <select id="selectExtractionExpert" parameterType="com.ozs.base.domain.vo.BaseExpertVo"
- resultType="com.ozs.pm.doman.PmDemand">
- select * from pm_demand where demand_id in (select demand_id from pm_demand_expert_ref group by demand_id)
- <if test="projectName != null and projectName != ''">
- and project_name like '%' + #{projectName} + '%'
- </if>
- <if test="startTime != null "><!-- 开始时间检索 -->
- and date_format(plan_demand_sub_time,'%y%m%d') > date_format(#{startTime},'%y%m%d')
- </if>
- <if test="endTime != null "><!-- 结束时间检索 -->
- and date_format(plan_demand_sub_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
- </if>
- </select>
- <select id="purchaseProjectStatistical" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="java.util.Map">
- select ifnull(COUNT(demand_id), 0) countId
- from pm_demand
- WHERE purchase_dept_id in
- <foreach collection="vo.deptList" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </select>
- <select id="purchaseProjectStatisticalYWC" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="java.util.Map">
- select count(d.demand_id) countYWC, ifnull(sum(c.contract_amount), 0) evaluationYWC
- from pm_demand d, pm_contract_info c,
- (SELECT ifnull(COUNT(demand_id), 0) countYWC ,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 =21 ) de
- where d.demand_id = c.demand_id
- AND d.purchase_dept_id in
- <foreach collection="vo.deptList" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- AND d.project_status =21
- </select>
- <select id="purchaseProjectStatisticalXCJ" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="java.util.Map">
- select ifnull(COUNT(demand_id), 0) countXCJ, ifnull(sum(evaluation), 0) evaluationXCJ
- from pm_demand
- where purchase_dept_id in
- <foreach collection="vo.deptList" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- AND project_status !=17
- and year(create_time) = year(NOW())
- </select>
- <select id="purchaseProjectStatisticalQNWC" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="java.util.Map">
- select de.countYWC, ifnull(sum(c.contract_amount), 0) evaluationQNWC
- from pm_demand d, pm_contract_info c,
- (SELECT ifnull(COUNT(demand_id), 0) countYWC ,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 =21 and year(create_time) = year(NOW())-1) de
- WHERE d.demand_id = c.demand_id
- AND d.purchase_dept_id in
- <foreach collection="vo.deptList" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- AND d.project_status =21 and year(d.create_time) = year(NOW())-1
- </select>
- <select id="countByProjectAttr" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT project_attr columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
- FROM `pm_demand`
- <include refid="deptListOrDemandIdAll"/>
- find_in_set(#{vo.projectAttr},project_attr)
- </select>
- <select id="countByTaskAttr" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT project_attr columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
- FROM `pm_demand`
- <include refid="deptListOrDemandIdAll"/>
- find_in_set(#{vo.projectAttr},project_attr)
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="countByPurchaseMode" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT purchase_mode columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
- FROM `pm_demand`
- <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
- <include refid="deptListOrDemandIdAll"/>
- </if>
- purchase_mode=#{vo.purchaseMode}
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="countByEvaluationLt" 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`
- <include refid="deptListOrDemandIdAll"/>
- evaluation < #{vo.evaluation}
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="countByEvaluationBet" 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`
- <include refid="deptListOrDemandIdAll"/>
- evaluation BETWEEN #{vo.evaluation} and #{vo.evaluationEnd}
- AND project_status > #{vo.projectStatus}
- </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`
- <include refid="deptListOrDemandIdAll"/>
- evaluation > #{vo.evaluation}
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="countProjectExceedThisYear" 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`
- <include refid="deptListOrDemandIdAll"/>
- ((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>
- <select id="countProjectExceedThisQua" 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`
- <include refid="deptListOrDemandIdAll"/>
- ((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>
- <select id="countProjectExceedThisMonth" 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`
- <include refid="deptListOrDemandIdAll"/>
- ((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>
- <select id="countProjectExceedAllNum" 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`
- <include refid="deptListOrDemandIdAll"/>
- ((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"
- 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>
- </select>
- <select id="countThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="java.lang.Integer">
- SELECT ifnull(COUNT(demand_id), 0) num
- 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())
- </select>
- <select id="countProjectExceedYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT DATE_FORMAT(create_time, '%Y') columnName, ifnull(COUNT(demand_id), 0) num
- 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)
- GROUP BY DATE_FORMAT(create_time, '%Y')
- order by create_time asc
- </select>
- <select id="countProjectExceedMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT DATE_FORMAT(create_time, '%Y-%m') columnName, ifnull(COUNT(demand_id), 0) num
- 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) = #{vo.month}
- AND DATE_FORMAT(create_time
- , '%Y') = #{vo.year}
- GROUP BY DATE_FORMAT(create_time, '%Y-%m')
- </select>
- <select id="countProjectExceedQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT DATE_FORMAT(create_time, '%Y-${quarter}季度') columnName, ifnull(COUNT(demand_id), 0) num
- 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) = #{vo.quarter}
- AND DATE_FORMAT(create_time, '%Y') = #{vo.year}
- </select>
- <select id="countProjectExceedAll" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.PmDemand">
- SELECT *
- FROM `pm_demand`
- <include refid="deptListOrDemandIdAll"/>
- ((now()> plan_purchase_finish_time and ISNULL(real_purchase_finish_time))
- or (real_purchase_finish_time > plan_purchase_finish_time))
- </select>
- <sql id="majorProjectByStatus">
- SELECT ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
- FROM `pm_demand`
- <include refid="deptListOrDemandIdAll"/>
- find_in_set('1', project_attr)
- </sql>
- <select id="majorProjectByStatusThisMonthSub" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND MONTH(plan_demand_sub_time ) = MONTH(now())
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="majorProjectByStatusThisQuaSub" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND QUARTER(plan_demand_sub_time ) = QUARTER(now())
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="majorProjectByStatusThisYearSub" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND YEAR(plan_demand_sub_time ) = YEAR(now())
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="majorProjectByStatusThisMonthNew" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND MONTH(task_release_time ) = MONTH(now())
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="majorProjectByStatusThisQuaNew" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND QUARTER(task_release_time ) = QUARTER(now())
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="majorProjectByStatusThisYearNew" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND YEAR(task_release_time ) = YEAR(now())
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="majorProjectByStatusThisMonthFi" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- 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(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(up_acceptance_time ) = YEAR(now())
- AND project_status >= #{vo.projectStatus}
- </select>
- <select id="majorProjectByStatusThisMonthFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND MONTH(plan_demand_sub_time ) = MONTH(now())
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="majorProjectByStatusThisQuaFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND QUARTER(plan_demand_sub_time ) = QUARTER(now())
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="majorProjectByStatusThisYearFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND YEAR(plan_demand_sub_time ) = YEAR(now())
- AND project_status > #{vo.projectStatus}
- </select>
- <select id="majorProjectByStatusLastYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND YEAR(plan_demand_sub_time ) = YEAR(now())-1
- <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=")">
- #{item}
- </foreach>
- </if>
- </select>
- <select id="majorProjectByStatusToThisYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND project_status >= #{vo.projectStatus}
- AND YEAR(plan_demand_sub_time ) = YEAR(now())
- </select>
- <select id="majorProjectByStatusWei" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND real_purchase_finish_time <plan_purchase_finish_time
- </select>
- <select id="majorProjectByStatusChao" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- <include refid="majorProjectByStatus"/>
- AND real_purchase_finish_time >plan_purchase_finish_time
- </select>
- <select id="countMajorProjectExceed" 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 (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 find_in_set('1', project_attr)
- and YEAR(create_time ) = YEAR(NOW())
- </select>
- <select id="taskQuantityYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT YEAR(NOW()) columnName, ifnull(COUNT(demand_id), 0) num
- FROM `pm_demand`
- WHERE find_in_set('1'
- , project_attr)
- AND `project_status` = #{code}
- and YEAR(create_time) = YEAR(NOW())
- </select>
- <select id="taskQuantityLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
- parameterType="java.lang.String">
- SELECT YEAR(NOW()) - 1 columnName, ifnull(COUNT(demand_id), 0) num
- FROM `pm_demand`
- WHERE find_in_set('1'
- , project_attr)
- AND `project_status` = #{code}
- and YEAR(create_time) = YEAR(NOW()) - 1
- </select>
- <select id="countEveryStatusNum" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- 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`
- <include refid="deptListOrDemandIdAll"/>
- YEAR(create_time) = YEAR(NOW())
- and `project_status`=#{vo.projectStatus}
- </select>
- <select id="selectByPlanId" parameterType="java.lang.Long" resultType="com.ozs.pm.doman.PmDemand">
- select *
- from pm_demand
- where plan_id = #{planId}
- limit 1
- </select>
- <select id="countMajorProjectLastYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- # AND find_in_set('1', project_attr)
- SELECT YEAR(NOW()) - 1 columnName, de.num, ifnull(sum(c.contract_amount), 0) 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>
- AND find_in_set('1', project_attr) AND YEAR(create_time) =YEAR(NOW()) - 1 ) de
- WHERE d.demand_id = c.demand_id
- AND find_in_set('1', d.project_attr)
- AND d.purchase_dept_id in
- <foreach collection="vo.deptList" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- AND YEAR(d.create_time) = YEAR(NOW()) - 1
- </select>
- <select id="countProjectMajorByYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT YEAR(create_time) columnName, ifnull(COUNT(demand_id), 0) num
- FROM `pm_demand`
- WHERE purchase_dept_id in
- <foreach collection="vo.deptList" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- AND find_in_set('1', project_attr)
- GROUP BY YEAR(create_time)
- order by create_time asc
- </select>
- <select id="countProjectMajorByMonth" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT DATE_FORMAT(create_time, '%Y-%m') columnName, ifnull(COUNT(demand_id), 0) num
- FROM `pm_demand`
- WHERE purchase_dept_id in
- <foreach collection="vo.deptList" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- AND find_in_set('1', project_attr)
- GROUP BY DATE_FORMAT(create_time, '%Y-%m')
- </select>
- <select id="countProjectMajorByQuarter" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT create_time columnName, ifnull(COUNT(demand_id), 0) num
- FROM `pm_demand`
- WHERE purchase_dept_id in
- <foreach collection="vo.deptList" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- AND find_in_set('1', project_attr)
- and QUARTER(create_time) = #{vo.quarter}
- AND YEAR(create_time) = #{vo.year}
- </select>
- <!-- 正常推进项目 -->
- <select id="purchaseProjectExecuteNormalPropulsion" 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
- <include refid="deptListOrDemandIdAll"/>
- project_status !=21
- 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)
- </select>
- <select id="purchaseProjectExecuteIncomplete" 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
- <include refid="deptListOrDemandIdAll"/>
- project_status !=21
- </select>
- <select id="selectMinYear" resultType="java.lang.Integer">
- select ifnull(min(year(create_time)), year(now())) mYear
- from pm_demand
- </select>
- <select id="selectpurchaseProjectCompleteNumberYear" 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.create_time) yy,
- ifnull(sum(b.contract_amount), 0) contractAmount
- 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>
- AND project_status = '21'
- ) a
- left join (
- select contract_amount, demand_id
- from pm_contract_info
- ) b on a.demand_id = b.demand_id
- 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.create_time) yy,
- ifnull(sum(b.contract_amount), 0) contractAmount
- 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>
- AND project_status = '21'
- 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.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(create_time, '%m') yy,
- ifnull(sum(b.contract_amount), 0) contractAmount
- 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>
- AND project_status = '21'
- 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.create_time, '%y%m')
- </select>
- <select id="selectPurchaseTaskFinishYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="java.util.Map">
- select count(de.num) countNum,
- de.evaluationTotal evaluation,
- year(c.up_acceptance_time) yy,
- ifnull(sum(c.contract_amount), 0) contractAmount
- FROM (SELECT ifnull(sum(c.contract_amount), 0) contract_amount,d.up_acceptance_time
- FROM pm_demand d
- left join pm_contract_info c
- on d.demand_id = c.demand_id
- <include refid="dDeptListOrDemandIdAll"/>
- d.project_status in (19,20,21)
- AND YEAR(d.up_acceptance_time) = YEAR(NOW())
- group by year(d.up_acceptance_time)) c
- LEFT JOIN
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal,up_acceptance_time FROM
- pm_demand
- <include refid="deptListOrDemandIdAll"/>
- project_status in (19,20,21) AND YEAR(up_acceptance_time) = YEAR(NOW())
- group by year(up_acceptance_time)) de
- ON c.up_acceptance_time=de.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.up_acceptance_time) yy,
- ifnull(sum(b.contract_amount), 0) contractAmount
- from (
- select evaluation, up_acceptance_time, demand_id
- from pm_demand
- <include refid="deptListOrDemandIdAll"/>
- project_status in (19,20,21)
- 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.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(up_acceptance_time, '%m') yy,
- ifnull(sum(b.contract_amount), 0) contractAmount
- from (
- select evaluation, up_acceptance_time, demand_id
- from pm_demand
- <include refid="deptListOrDemandIdAll"/>
- project_status in (19,20,21)
- 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.up_acceptance_time, '%y%m')
- </select>
- <select id="countProjectExceedAndMajor" 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 (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 find_in_set('1', project_attr)
- and YEAR(create_time) = YEAR(NOW())
- </select>
- <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
- <include refid="deptListOrDemandIdAllNoAnd"/>
- <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
- AND
- </if>
- <if test="vo.projectStatusList!=null and vo.projectStatusList.size != 0">
- 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 ifnull(COUNT(demand_id), 0) countNum, ifnull(sum(evaluation), 0) evaluationSum, year(task_release_time)
- yy
- from pm_demand
- <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
- <include refid="deptListOrDemandIdAllNoAnd"/>
- </if>
- group by year(task_release_time!=null)
- </select>
- <select id="purchaseProjectNumberAnalysisQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="java.util.Map">
- select ifnull(COUNT(demand_id), 0) countNum, ifnull(sum(evaluation), 0) evaluationSum,
- quarter(task_release_time) yy
- from pm_demand
- <include refid="deptListOrDemandIdAll"/>
- year(task_release_time) = year(NOW())
- group by concat(Year(task_release_time), quarter(task_release_time))
- </select>
- <select id="purchaseProjectNumberAnalysisOldYearQuarter" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="java.util.Map">
- select ifnull(COUNT(demand_id), 0) countNum, ifnull(sum(evaluation), 0) evaluationSum,
- quarter(task_release_time) yy
- from pm_demand
- <include refid="deptListOrDemandIdAll"/>
- year(task_release_time) = year(NOW() - 1)
- group by concat(Year(task_release_time), quarter(task_release_time))
- </select>
- <select id="purchaseProjectNumberAnalysisMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="java.util.Map">
- select ifnull(COUNT(demand_id), 0) countNum,
- ifnull(sum(evaluation), 0) evaluationSum,
- date_format(task_release_time, '%m') yy
- from pm_demand
- <include refid="deptListOrDemandIdAll"/>
- year(task_release_time) = year(NOW())
- group by date_format(task_release_time, '%y%m')
- </select>
- <select id="purchaseProjectNumberAnalysisOldYearMonth" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
- resultType="java.util.Map">
- select ifnull(COUNT(demand_id), 0) countNum,
- ifnull(sum(evaluation), 0) evaluationSum,
- date_format(create_time, '%m') yy
- from pm_demand
- where purchase_dept_id = #{purchaseDeptId}
- AND year(task_release_time) = YEAR(NOW()) - 1
- group by date_format(task_release_time, '%y%m')
- </select>
- <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`
- <include refid="deptListOrDemandIdAll"/>
- `project_status` IN (6,7,8,9,10,11,12,13,14,15, 16,
- 17)
- and YEAR(plan_demand_sub_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`
- <include refid="deptListOrDemandIdAll"/>
- `project_status` > 4
- and YEAR(plan_demand_sub_time) = YEAR(NOW())
- </select>
- <select id="selectmeiJiDu" 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`
- <include refid="deptListOrDemandIdAll"/>
- (real_demand_commit_time > plan_demand_sub_time)
- </select>
- <select id="selectByProjectType" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
- 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`
- <include refid="deptListOrDemandIdAll"/>
- 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`
- <include refid="deptListOrDemandIdAll"/>
- `project_status` > 4
- and YEAR(plan_demand_sub_time) = YEAR(NOW())
- </select>
- <select id="selectCGThisMonth" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
- parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
- SELECT MONTH(NOW()) columnName, de.num, de.evaluationTotal,ifnull(sum(c.contract_amount), 0)
- evaluationContractTotal
- FROM pm_demand d,pm_contract_info c,
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
- <include refid="deptListOrDemandIdAll"/>
- project_status > 16 AND MONTH(up_acceptance_time) =MONTH(NOW()) ) de
- <include refid="dDeptListOrDemandIdAll"/>
- d.demand_id = c.demand_id
- AND d.project_status > 16
- AND MONTH(d.up_acceptance_time) = MONTH(NOW())
- </select>
- <select id="selectCGThisQua" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
- parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
- SELECT QUARTER(NOW()) columnName, de.num, de.evaluationTotal,ifnull(sum(c.contract_amount), 0)
- evaluationContractTotal
- FROM pm_demand d,pm_contract_info c,
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
- <include refid="deptListOrDemandIdAll"/>
- project_status > 17 AND QUARTER(up_acceptance_time) =QUARTER(NOW()) ) de
- <include refid="dDeptListOrDemandIdAll"/>
- d.demand_id = c.demand_id
- AND d.project_status > 17
- AND QUARTER(d.up_acceptance_time) = QUARTER(NOW())
- </select>
- <select id="selectZJLastYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
- parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
- SELECT YEAR(NOW())-1 columnName, de.num,de.evaluationTotal,ifnull(sum(c.contract_amount), 0)
- evaluationContractTotal
- FROM pm_demand d, pm_contract_info c,
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
- <include refid="deptListOrDemandIdAll"/>
- project_status IN (17,18) AND YEAR(up_acceptance_time) = YEAR(NOW())-1 ) de
- <include refid="dDeptListOrDemandIdAll"/>
- d.demand_id = c.demand_id
- AND d.project_status IN (17,18)
- AND YEAR(d.up_acceptance_time) = YEAR(NOW())-1
- </select>
- <select id="selectTBThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
- parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
- SELECT YEAR(NOW()) columnName, de.num,de.evaluationTotal,ifnull(sum(c.contract_amount), 0)
- evaluationContractTotal
- FROM pm_demand d, pm_contract_info c,
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
- <include refid="deptListOrDemandIdAll"/>
- project_status > 17 AND YEAR(up_acceptance_time) = YEAR(NOW()) ) de
- <include refid="dDeptListOrDemandIdAll"/>
- d.demand_id = c.demand_id
- AND d.project_status > 17
- AND YEAR(d.up_acceptance_time) = YEAR(NOW())
- </select>
- <select id="selectFInishAll" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
- parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
- SELECT YEAR(NOW()) columnName, de.num,de.evaluationTotal,ifnull(sum(c.contract_amount), 0)
- evaluationContractTotal
- FROM (SELECT c.contract_amount FROM pm_demand d
- left join pm_contract_info c
- on d.demand_id = c.demand_id
- <include refid="dDeptListOrDemandIdAll"/>
- d.project_status > 18
- AND YEAR(d.up_acceptance_time) = YEAR(NOW())) c
- ,
- (SELECT ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
- <include refid="deptListOrDemandIdAll"/>
- project_status > 18 AND YEAR(up_acceptance_time) = YEAR(NOW())) de
- </select>
- <select id="selectCCThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
- 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
- <include refid="deptListOrDemandIdAll"/>
- real_purchase_finish_time <=plan_purchase_finish_time
- AND YEAR(up_acceptance_time) = YEAR(NOW())
- </select>
- <sql id="countProjectExceedAndStatus">
- SELECT ifnull(COUNT(demand_id), 0) num,ifnull(sum(evaluation), 0) evaluationTotal
- FROM pm_demand
- <include refid="deptListOrDemandIdAllNoAnd"/>
- <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
- AND
- </if>
- <if test="vo.projectStatusList!=null and vo.projectStatusList.size != 0">
- 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>
- <select id="countProjectExceedAndStatus" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
- parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
- <include refid="countProjectExceedAndStatus"/>
- </select>
- <select id="countBaseAgencyWithWhite" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
- SELECT ifnull(COUNT(id), 0) num
- FROM base_agency
- WHERE status = 0
- </select>
- <select id="JZCGnum" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
- 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
- <include refid="deptListOrDemandIdAll"/>
- project_status > 8
- # AND YEAR(create_time) = YEAR(NOW())
- </select>
- <select id="countProjecReaAndStatus" 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
- <include refid="deptListOrDemandIdAllNoAnd"/>
- <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
- AND
- </if>
- <if test="vo.projectStatusList!=null and vo.projectStatusList.size != 0">
- 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 ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
- <include refid="deptListOrDemandIdAll"/>
- real_purchase_finish_time > plan_purchase_finish_time AND YEAR(create_time)=#{vo.year} ) de
- <include refid="dDeptListOrDemandIdAll"/>
- 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 ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
- <include refid="deptListOrDemandIdAll"/>
- real_purchase_finish_time > plan_purchase_finish_time AND YEAR(create_time)=#{vo.year} AND
- QUARTER(create_time)=#{vo.quarter}) de
- <include refid="dDeptListOrDemandIdAll"/>
- 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 ifnull(COUNT(demand_id), 0) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand
- <include refid="deptListOrDemandIdAll"/>
- real_purchase_finish_time > plan_purchase_finish_time AND
- YEAR(create_time)=#{vo.year} AND month(create_time)=#{vo.month}) de
- <include refid="dDeptListOrDemandIdAll"/>
- 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">
- 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>
- </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>
- <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
- AND
- </if>
- </sql>
- <sql id="deptListOrDemandIdAllNoAnd">
- 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>
- </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">
- WHERE
- <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>
- <if test="(vo.deptList != null and vo.deptList.size != 0) or (vo.demandIdAll != null and vo.demandIdAll.size != 0)">
- AND
- </if>
- </sql>
- <sql id="dDeptListOrDemandIdAllNoAnd">
- WHERE
- <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>
|