123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753 |
- <?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="MonthProgressMapper">
-
- <!--表名 -->
- <sql id="tableName">
- tb_annualplan
- </sql>
-
- <!-- 字段 -->
- <sql id="Field">
- NAME,
- CTIME,
- MTIME,
- STATUS,
- ANNUALPLAN_ID
- </sql>
-
- <!-- 字段值 -->
- <sql id="FieldValue">
- #{NAME},
- #{CTIME},
- #{MTIME},
- #{STATUS},
- #{ANNUALPLAN_ID}
- </sql>
-
- <!-- 字段 -->
- <sql id="Fields">
- NAME,
- CTIME,
- MTIME,
- STATUS
- </sql>
-
- <!-- 字段值 -->
- <sql id="FieldValues">
- #{NAME},
- #{CTIME},
- #{MTIME},
- #{STATUS}
- </sql>
-
- <!--子表格类型 -->
- <sql id="tableType">
- ${TABLETYPE}
- </sql>
-
- <!-- 子表格字段 -->
- <sql id="tableField">
- serialNumber,
- road,
- designKm,
- careKm,
- dailyDesign,
- dailyComplete,
- dailyProportion,
- dailyKm,
- preventionDesign,
- preventionComplete,
- preventionProportion,
- preventionKm,
- minorRepairDesign,
- minorRepairComplete,
- minorRepairProportion,
- middleRepairDesign,
- middleRepairComplete,
- middleRepairProportion,
- overhaulDesign,
- overhaulComplete,
- overhaulProportion,
- specialDesign,
- specialComplete,
- specialProportion,
- testDesign,
- testComplete,
- testProportion,
- scientificDesign,
- scientificComplete,
- scientificProportion,
- deviceDesign,
- deviceComplete,
- deviceProportion,
- reserveDesign,
- reserveComplete,
- reserveProportion,
- totalDesign,
- totalComplete,
- totalProportion
- </sql>
-
- <!-- 新增-->
- <insert id="saveAnnualPlan" parameterType="pd">
- insert into
- <include refid="tableName"></include>
- (
- <include refid="Fields"></include>
- ) values (
- <include refid="FieldValues"></include>
- )
- </insert>
-
- <!-- 删除-->
- <delete id="delete" parameterType="pd">
- delete from
- <include refid="tableName"></include>
- where
- ANNUALPLAN_ID = #{ANNUALPLAN_ID}
- </delete>
-
- <!-- 修改 -->
- <update id="edit" parameterType="pd">
- update
- <include refid="tableName"></include>
- set
- NAME = #{NAME},
- FDESCRIBE = #{FDESCRIBE},
- PRICE = #{PRICE},
- ATTACHED_ID = ATTACHED_ID
- where
- ATTACHED_ID = #{ATTACHED_ID}
- </update>
-
- <!-- 显示子表格内容 -->
- <select id="showTableRecod" parameterType="pd" resultType="pd">
- select
- <include refid="tableField"></include>
- from
- <include refid="tableType"></include>
- where
- YEAR = #{YEAR} AND COMPANY=#{COMPANY}
- </select>
-
- <!-- 通过报告id获取相关报表列表 -->
- <select id="findReportById" parameterType="pd" resultType="pd">
- select
- ANNUAL_REPORT_ID, ANNUALPLAN_ID, ANNUAL_REPORT_NAME, STATUS
- from
- relation_annualPlan_report
- where
- annualPlan_ID = #{ANNUALPLAN_ID}
- </select>
-
- <!-- 通过报告id获取相关表格列表 -->
- <select id="findTableById" parameterType="pd" resultType="pd">
- select
- CONCAT (TABLEYEAR, TABLECOMPANY, TABLENAME) as NAME, CTIME, MTIME, STATUS, TABLETYPE
- from
- relation_annualPlan_table
- where
- annualPlanID = #{ANNUALPLAN_ID}
- </select>
-
- <!-- 通过报告id获取相关表格列表 -->
- <select id="getReportType" parameterType="pd" resultType="pd">
- select
- ID, reportType
- from
- tb_reportinfo
- </select>
-
- <!-- 列表 -->
- <select id="datalistPage" parameterType="page" resultType="pd">
- select
- <include refid="Field"></include>
- from
- <include refid="tableName"></include>
- where 1=1
- <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->
- and
- (
- NAME LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')
- )
- </if>
- </select>
-
- <select id="saveData" parameterType="pd">
- replace into examine_results (COMPANY,COMPANY_ID,YEAR,BZZL) values
- (
- #{COMPANY_NAME}, #{COMPANY_ID},#{YEAR}, #{BPOINT}
- )
-
-
- </select>
-
- <!-- 列表(全部) -->
- <select id="listAll" parameterType="pd" resultType="pd">
- select
- <include refid="Field"></include>
- from
- <include refid="tableName"></include>
- </select>
-
- <!-- 批量删除 -->
- <delete id="deleteAll" parameterType="String">
- delete from
- <include refid="tableName"></include>
- where
- ATTACHED_ID in
- <foreach item="item" index="index" collection="array" open="(" separator="," close=")">
- #{item}
- </foreach>
- </delete>
-
- <!-- 通过roleid获取角色名 -->
- <select id="getRoleName" parameterType="String" resultType="String">
- select
- ROLE_NAME
- from
- sys_role
- where ROLE_ID = #{roleID}
- </select>
-
- <!-- 通过username获取路公司和路段信息 -->
- <select id="getCompanyAndRoad" parameterType="String" resultType="pd">
- select
- COMPANY, ROAD, ROLE_ID
- from
- sys_user
- where USERNAME = #{username}
- </select>
-
- <!-- 通过路公司名称获取路公司ID -->
- <select id="getCompanyid" parameterType="String" resultType="String">
- select
- BIANMA
- from
- oa_department
- where NAME = #{company}
- </select>
-
- <!-- 通过月报表相关数据 -->
- <select id="getdata" parameterType="pd" resultType="pd">
- select a.*,b.status from (
- select DISTINCT * from(
- select h.COMPANY_ID,h.COMPANY,h.ROAD_ID,h.ROAD,h.YEAR,h.PROJECT_NAME,
- h.CATEGORY,h.PROJECT_SCALE,h.QUANTITIES,h.PROJECT_COST,IFNULL(h.AUDIT_FEE,h.PROJECT_COST) as AUDIT_FEE,h.OTHER_MATTER,
- h.SJWCGCL as ACTUAL_QUANTITIES,h.AUDIT_MAKER,
- m.ACTUAL_QUANTITIES_1,m.ACTUAL_COST_1,m.PAY_COST_1,m.RATIO_1,m.ACTUAL_QUANTITIES_2,m.ACTUAL_COST_2,m.PAY_COST_2,m.RATIO_2,m.ACTUAL_QUANTITIES_3,m.ACTUAL_COST_3,m.PAY_COST_3,m.RATIO_3,
- m.ACTUAL_QUANTITIES_4,m.ACTUAL_COST_4,m.PAY_COST_4,m.RATIO_4,m.ACTUAL_QUANTITIES_5,m.ACTUAL_COST_5,m.PAY_COST_5,m.RATIO_5,m.ACTUAL_QUANTITIES_6,m.ACTUAL_COST_6,m.PAY_COST_6,m.RATIO_6,
- m.ACTUAL_QUANTITIES_7,m.ACTUAL_COST_7,m.PAY_COST_7,m.RATIO_7,m.ACTUAL_QUANTITIES_8,m.ACTUAL_COST_8,m.PAY_COST_8,m.RATIO_8,m.ACTUAL_QUANTITIES_9,m.ACTUAL_COST_9,m.PAY_COST_9,m.RATIO_9,
- m.ACTUAL_QUANTITIES_10,m.ACTUAL_COST_10,m.PAY_COST_10,m.RATIO_10,m.ACTUAL_QUANTITIES_11,m.ACTUAL_COST_11,m.PAY_COST_11,m.RATIO_11,m.ACTUAL_QUANTITIES_12,m.ACTUAL_COST_12,m.PAY_COST_12,m.RATIO_12,
- m.PLAN_COST_1,m.PLAN_QUANTITIES_1,m.PLAN_COST_2,m.PLAN_QUANTITIES_2,m.PLAN_COST_3,m.PLAN_QUANTITIES_3,
- m.PLAN_COST_4,m.PLAN_QUANTITIES_4,m.PLAN_COST_5,m.PLAN_QUANTITIES_5,m.PLAN_COST_6,m.PLAN_QUANTITIES_6,
- m.PLAN_COST_7,m.PLAN_QUANTITIES_7,m.PLAN_COST_8,m.PLAN_QUANTITIES_8,m.PLAN_COST_9,m.PLAN_QUANTITIES_9,
- m.PLAN_COST_10,m.PLAN_QUANTITIES_10,m.PLAN_COST_11,m.PLAN_QUANTITIES_11,m.PLAN_COST_12,m.PLAN_QUANTITIES_12
- from ${planTable} h
- left join (
- select yb.COMPANY_ID,yb.ROAD_ID,yb.YEAR,yb.PROJECT_NAME
- ,max(ACTUAL_QUANTITIES_1) as ACTUAL_QUANTITIES_1,max(ACTUAL_COST_1) as ACTUAL_COST_1,max(PAY_COST_1) as PAY_COST_1,max(RATIO_1) as RATIO_1
- ,max(ACTUAL_QUANTITIES_2) as ACTUAL_QUANTITIES_2,max(ACTUAL_COST_2) as ACTUAL_COST_2,max(PAY_COST_2) as PAY_COST_2,max(RATIO_2) as RATIO_2
- ,max(ACTUAL_QUANTITIES_3) as ACTUAL_QUANTITIES_3,max(ACTUAL_COST_3) as ACTUAL_COST_3,max(PAY_COST_3) as PAY_COST_3,max(RATIO_3) as RATIO_3
- ,max(ACTUAL_QUANTITIES_4) as ACTUAL_QUANTITIES_4,max(ACTUAL_COST_4) as ACTUAL_COST_4,max(PAY_COST_4) as PAY_COST_4,max(RATIO_4) as RATIO_4
- ,max(ACTUAL_QUANTITIES_5) as ACTUAL_QUANTITIES_5,max(ACTUAL_COST_5) as ACTUAL_COST_5,max(PAY_COST_5) as PAY_COST_5,max(RATIO_5) as RATIO_5
- ,max(ACTUAL_QUANTITIES_6) as ACTUAL_QUANTITIES_6,max(ACTUAL_COST_6) as ACTUAL_COST_6,max(PAY_COST_6) as PAY_COST_6,max(RATIO_6) as RATIO_6
- ,max(ACTUAL_QUANTITIES_7) as ACTUAL_QUANTITIES_7,max(ACTUAL_COST_7) as ACTUAL_COST_7,max(PAY_COST_7) as PAY_COST_7,max(RATIO_7) as RATIO_7
- ,max(ACTUAL_QUANTITIES_8) as ACTUAL_QUANTITIES_8,max(ACTUAL_COST_8) as ACTUAL_COST_8,max(PAY_COST_8) as PAY_COST_8,max(RATIO_8) as RATIO_8
- ,max(ACTUAL_QUANTITIES_9) as ACTUAL_QUANTITIES_9,max(ACTUAL_COST_9) as ACTUAL_COST_9,max(PAY_COST_9) as PAY_COST_9,max(RATIO_9) as RATIO_9
- ,max(ACTUAL_QUANTITIES_10) as ACTUAL_QUANTITIES_10,max(ACTUAL_COST_10) as ACTUAL_COST_10,max(PAY_COST_10) as PAY_COST_10,max(RATIO_10) as RATIO_10
- ,max(ACTUAL_QUANTITIES_11) as ACTUAL_QUANTITIES_11,max(ACTUAL_COST_11) as ACTUAL_COST_11,max(PAY_COST_11) as PAY_COST_11,max(RATIO_11) as RATIO_11
- ,max(ACTUAL_QUANTITIES_12) as ACTUAL_QUANTITIES_12,max(ACTUAL_COST_12) as ACTUAL_COST_12,max(PAY_COST_12) as PAY_COST_12,max(RATIO_12) as RATIO_12
-
- ,max(PLAN_COST_1) as PLAN_COST_1,max(PLAN_QUANTITIES_1) as PLAN_QUANTITIES_1
- ,max(PLAN_COST_2) as PLAN_COST_2,max(PLAN_QUANTITIES_2) as PLAN_QUANTITIES_2
- ,max(PLAN_COST_3) as PLAN_COST_3,max(PLAN_QUANTITIES_3) as PLAN_QUANTITIES_3
- ,max(PLAN_COST_4) as PLAN_COST_4,max(PLAN_QUANTITIES_4) as PLAN_QUANTITIES_4
- ,max(PLAN_COST_5) as PLAN_COST_5,max(PLAN_QUANTITIES_5) as PLAN_QUANTITIES_5
- ,max(PLAN_COST_6) as PLAN_COST_6,max(PLAN_QUANTITIES_6) as PLAN_QUANTITIES_6
- ,max(PLAN_COST_7) as PLAN_COST_7,max(PLAN_QUANTITIES_7) as PLAN_QUANTITIES_7
- ,max(PLAN_COST_8) as PLAN_COST_8,max(PLAN_QUANTITIES_8) as PLAN_QUANTITIES_8
- ,max(PLAN_COST_9) as PLAN_COST_9,max(PLAN_QUANTITIES_9) as PLAN_QUANTITIES_9
- ,max(PLAN_COST_10) as PLAN_COST_10,max(PLAN_QUANTITIES_10) as PLAN_QUANTITIES_10
- ,max(PLAN_COST_11) as PLAN_COST_11,max(PLAN_QUANTITIES_11) as PLAN_QUANTITIES_11
- ,max(PLAN_COST_12) as PLAN_COST_12,max(PLAN_QUANTITIES_12) as PLAN_QUANTITIES_12
- from(
- select *
-
- ,case when month=1 then PLAN_COST else null end PLAN_COST_1
- ,case when month=1 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_1
-
- ,case when month=2 then PLAN_COST else null end PLAN_COST_2
- ,case when month=2 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_2
-
- ,case when month=3 then PLAN_COST else null end PLAN_COST_3
- ,case when month=3 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_3
-
- ,case when month=4 then PLAN_COST else null end PLAN_COST_4
- ,case when month=4 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_4
-
- ,case when month=5 then PLAN_COST else null end PLAN_COST_5
- ,case when month=5 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_5
-
- ,case when month=6 then PLAN_COST else null end PLAN_COST_6
- ,case when month=6 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_6
-
- ,case when month=7 then PLAN_COST else null end PLAN_COST_7
- ,case when month=7 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_7
-
- ,case when month=8 then PLAN_COST else null end PLAN_COST_8
- ,case when month=8 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_8
-
- ,case when month=9 then PLAN_COST else null end PLAN_COST_9
- ,case when month=9 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_9
-
- ,case when month=10 then PLAN_COST else null end PLAN_COST_10
- ,case when month=10 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_10
-
- ,case when month=11 then PLAN_COST else null end PLAN_COST_11
- ,case when month=11 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_11
-
- ,case when month=12 then PLAN_COST else null end PLAN_COST_12
- ,case when month=12 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_12
- from monthly_plan_record
- where PROJECT_TYPE = #{planTable} and YEAR = #{YEAR}
- <if test="ROADS != null and ROADS != ''">
- AND ROAD IN
- <foreach collection="ROADS" item="ROADS" index="index"
- open="(" close=")" separator=",">
- #{ROADS}
- </foreach>
- </if>
- )yb left join (
- select *
- ,case when month=1 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_1
- ,case when month=1 then ACTUAL_COST else null end ACTUAL_COST_1
- ,case when month=1 then PAY_COST else null end PAY_COST_1
- ,case when month=1 then RATIO else null end RATIO_1
- ,case when month=2 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_2
- ,case when month=2 then ACTUAL_COST else null end ACTUAL_COST_2
- ,case when month=2 then PAY_COST else null end PAY_COST_2
- ,case when month=2 then RATIO else null end RATIO_2
- ,case when month=3 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_3
- ,case when month=3 then ACTUAL_COST else null end ACTUAL_COST_3
- ,case when month=3 then PAY_COST else null end PAY_COST_3
- ,case when month=3 then RATIO else null end RATIO_3
- ,case when month=4 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_4
- ,case when month=4 then ACTUAL_COST else null end ACTUAL_COST_4
- ,case when month=4 then PAY_COST else null end PAY_COST_4
- ,case when month=4 then RATIO else null end RATIO_4
- ,case when month=5 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_5
- ,case when month=5 then ACTUAL_COST else null end ACTUAL_COST_5
- ,case when month=5 then PAY_COST else null end PAY_COST_5
- ,case when month=5 then RATIO else null end RATIO_5
- ,case when month=6 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_6
- ,case when month=6 then ACTUAL_COST else null end ACTUAL_COST_6
- ,case when month=6 then PAY_COST else null end PAY_COST_6
- ,case when month=6 then RATIO else null end RATIO_6
- ,case when month=7 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_7
- ,case when month=7 then ACTUAL_COST else null end ACTUAL_COST_7
- ,case when month=7 then PAY_COST else null end PAY_COST_7
- ,case when month=7 then RATIO else null end RATIO_7
- ,case when month=8 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_8
- ,case when month=8 then ACTUAL_COST else null end ACTUAL_COST_8
- ,case when month=8 then PAY_COST else null end PAY_COST_8
- ,case when month=8 then RATIO else null end RATIO_8
- ,case when month=9 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_9
- ,case when month=9 then ACTUAL_COST else null end ACTUAL_COST_9
- ,case when month=9 then PAY_COST else null end PAY_COST_9
- ,case when month=9 then RATIO else null end RATIO_9
- ,case when month=10 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_10
- ,case when month=10 then ACTUAL_COST else null end ACTUAL_COST_10
- ,case when month=10 then PAY_COST else null end PAY_COST_10
- ,case when month=10 then RATIO else null end RATIO_10
- ,case when month=11 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_11
- ,case when month=11 then ACTUAL_COST else null end ACTUAL_COST_11
- ,case when month=11 then PAY_COST else null end PAY_COST_11
- ,case when month=11 then RATIO else null end RATIO_11
- ,case when month=12 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_12
- ,case when month=12 then ACTUAL_COST else null end ACTUAL_COST_12
- ,case when month=12 then PAY_COST else null end PAY_COST_12
- ,case when month=12 then RATIO else null end RATIO_12
- from ${type}
- where YEAR = #{YEAR}
- )mpr on yb.YEAR = mpr.YEAR and yb.COMPANY_ID = mpr.COMPANY_ID and yb.ROAD_ID = mpr.ROAD_ID
- and yb.PROJECT_NAME = mpr.PROJECT_NAME
- group by yb.YEAR,yb.COMPANY_ID,yb.ROAD_ID,yb.PROJECT_NAME
- ) m
- on h.YEAR = m.YEAR and h.COMPANY_ID = m.COMPANY_ID and h.ROAD_ID = m.ROAD_ID and h.PROJECT_NAME = m.PROJECT_NAME
- where h.YEAR = #{YEAR}
- order by CATEGORY, PROJECT_NAME
- )e
- order by COMPANY_ID, ROAD_ID desc
- )a left join annual_plan_list b on a.year=b.year and a.company_id=b.company_id where b.STATUS='审批通过'
- </select>
-
- <!-- 列表 -->
- <select id="getCompPlanList" parameterType="page" resultType="pd">
- select
- distinct YEAR,COMPANY_ID
- from
- annual_plan_list
- WHERE STATUS='审批通过'
- <if test="COMPANY != null">
- AND COMPANY_NAME=#{COMPANY}
- </if>
- ORDER BY YEAR DESC
- </select>
-
- <!-- 通过试验检测、设备大修月报表相关数据 -->
- <select id="getTestdata" parameterType="pd" resultType="pd">
- select a.*,b.status from (
- select DISTINCT * from(
- select h.COMPANY_ID,h.COMPANY,h.ROAD_ID,h.ROAD,h.YEAR,h.PROJECT_NAME,
- h.CATEGORY,h.CONTENT,h.PROJECT_COST,
- IFNULL(h.AUDIT_FEE,h.PROJECT_COST) as AUDIT_FEE,h.AUDIT_MAKER,h.XMWCQKSM as ACTUAL_QUANTITIES,
- m.ACTUAL_QUANTITIES_1,m.ACTUAL_COST_1,m.PAY_COST_1,m.RATIO_1,m.ACTUAL_QUANTITIES_2,m.ACTUAL_COST_2,m.PAY_COST_2,m.RATIO_2,m.ACTUAL_QUANTITIES_3,m.ACTUAL_COST_3,m.PAY_COST_3,m.RATIO_3,
- m.ACTUAL_QUANTITIES_4,m.ACTUAL_COST_4,m.PAY_COST_4,m.RATIO_4,m.ACTUAL_QUANTITIES_5,m.ACTUAL_COST_5,m.PAY_COST_5,m.RATIO_5,m.ACTUAL_QUANTITIES_6,m.ACTUAL_COST_6,m.PAY_COST_6,m.RATIO_6,
- m.ACTUAL_QUANTITIES_7,m.ACTUAL_COST_7,m.PAY_COST_7,m.RATIO_7,m.ACTUAL_QUANTITIES_8,m.ACTUAL_COST_8,m.PAY_COST_8,m.RATIO_8,m.ACTUAL_QUANTITIES_9,m.ACTUAL_COST_9,m.PAY_COST_9,m.RATIO_9,
- m.ACTUAL_QUANTITIES_10,m.ACTUAL_COST_10,m.PAY_COST_10,m.RATIO_10,m.ACTUAL_QUANTITIES_11,m.ACTUAL_COST_11,m.PAY_COST_11,m.RATIO_11,m.ACTUAL_QUANTITIES_12,m.ACTUAL_COST_12,m.PAY_COST_12,m.RATIO_12,
- m.PLAN_COST_1,m.PLAN_QUANTITIES_1,m.PLAN_COST_2,m.PLAN_QUANTITIES_2,m.PLAN_COST_3,m.PLAN_QUANTITIES_3,
- m.PLAN_COST_4,m.PLAN_QUANTITIES_4,m.PLAN_COST_5,m.PLAN_QUANTITIES_5,m.PLAN_COST_6,m.PLAN_QUANTITIES_6,
- m.PLAN_COST_7,m.PLAN_QUANTITIES_7,m.PLAN_COST_8,m.PLAN_QUANTITIES_8,m.PLAN_COST_9,m.PLAN_QUANTITIES_9,
- m.PLAN_COST_10,m.PLAN_QUANTITIES_10,m.PLAN_COST_11,m.PLAN_QUANTITIES_11,m.PLAN_COST_12,m.PLAN_QUANTITIES_12
- from ${planTable} h
- left join (
- select yb.COMPANY_ID,yb.ROAD_ID,yb.YEAR,yb.PROJECT_NAME
- ,max(ACTUAL_QUANTITIES_1) as ACTUAL_QUANTITIES_1,max(ACTUAL_COST_1) as ACTUAL_COST_1,max(PAY_COST_1) as PAY_COST_1,max(RATIO_1) as RATIO_1
- ,max(ACTUAL_QUANTITIES_2) as ACTUAL_QUANTITIES_2,max(ACTUAL_COST_2) as ACTUAL_COST_2,max(PAY_COST_2) as PAY_COST_2,max(RATIO_2) as RATIO_2
- ,max(ACTUAL_QUANTITIES_3) as ACTUAL_QUANTITIES_3,max(ACTUAL_COST_3) as ACTUAL_COST_3,max(PAY_COST_3) as PAY_COST_3,max(RATIO_3) as RATIO_3
- ,max(ACTUAL_QUANTITIES_4) as ACTUAL_QUANTITIES_4,max(ACTUAL_COST_4) as ACTUAL_COST_4,max(PAY_COST_4) as PAY_COST_4,max(RATIO_4) as RATIO_4
- ,max(ACTUAL_QUANTITIES_5) as ACTUAL_QUANTITIES_5,max(ACTUAL_COST_5) as ACTUAL_COST_5,max(PAY_COST_5) as PAY_COST_5,max(RATIO_5) as RATIO_5
- ,max(ACTUAL_QUANTITIES_6) as ACTUAL_QUANTITIES_6,max(ACTUAL_COST_6) as ACTUAL_COST_6,max(PAY_COST_6) as PAY_COST_6,max(RATIO_6) as RATIO_6
- ,max(ACTUAL_QUANTITIES_7) as ACTUAL_QUANTITIES_7,max(ACTUAL_COST_7) as ACTUAL_COST_7,max(PAY_COST_7) as PAY_COST_7,max(RATIO_7) as RATIO_7
- ,max(ACTUAL_QUANTITIES_8) as ACTUAL_QUANTITIES_8,max(ACTUAL_COST_8) as ACTUAL_COST_8,max(PAY_COST_8) as PAY_COST_8,max(RATIO_8) as RATIO_8
- ,max(ACTUAL_QUANTITIES_9) as ACTUAL_QUANTITIES_9,max(ACTUAL_COST_9) as ACTUAL_COST_9,max(PAY_COST_9) as PAY_COST_9,max(RATIO_9) as RATIO_9
- ,max(ACTUAL_QUANTITIES_10) as ACTUAL_QUANTITIES_10,max(ACTUAL_COST_10) as ACTUAL_COST_10,max(PAY_COST_10) as PAY_COST_10,max(RATIO_10) as RATIO_10
- ,max(ACTUAL_QUANTITIES_11) as ACTUAL_QUANTITIES_11,max(ACTUAL_COST_11) as ACTUAL_COST_11,max(PAY_COST_11) as PAY_COST_11,max(RATIO_11) as RATIO_11
- ,max(ACTUAL_QUANTITIES_12) as ACTUAL_QUANTITIES_12,max(ACTUAL_COST_12) as ACTUAL_COST_12,max(PAY_COST_12) as PAY_COST_12,max(RATIO_12) as RATIO_12
- ,max(PLAN_COST_1) as PLAN_COST_1,max(PLAN_QUANTITIES_1) as PLAN_QUANTITIES_1
- ,max(PLAN_COST_2) as PLAN_COST_2,max(PLAN_QUANTITIES_2) as PLAN_QUANTITIES_2
- ,max(PLAN_COST_3) as PLAN_COST_3,max(PLAN_QUANTITIES_3) as PLAN_QUANTITIES_3
- ,max(PLAN_COST_4) as PLAN_COST_4,max(PLAN_QUANTITIES_4) as PLAN_QUANTITIES_4
- ,max(PLAN_COST_5) as PLAN_COST_5,max(PLAN_QUANTITIES_5) as PLAN_QUANTITIES_5
- ,max(PLAN_COST_6) as PLAN_COST_6,max(PLAN_QUANTITIES_6) as PLAN_QUANTITIES_6
- ,max(PLAN_COST_7) as PLAN_COST_7,max(PLAN_QUANTITIES_7) as PLAN_QUANTITIES_7
- ,max(PLAN_COST_8) as PLAN_COST_8,max(PLAN_QUANTITIES_8) as PLAN_QUANTITIES_8
- ,max(PLAN_COST_9) as PLAN_COST_9,max(PLAN_QUANTITIES_9) as PLAN_QUANTITIES_9
- ,max(PLAN_COST_10) as PLAN_COST_10,max(PLAN_QUANTITIES_10) as PLAN_QUANTITIES_10
- ,max(PLAN_COST_11) as PLAN_COST_11,max(PLAN_QUANTITIES_11) as PLAN_QUANTITIES_11
- ,max(PLAN_COST_12) as PLAN_COST_12,max(PLAN_QUANTITIES_12) as PLAN_QUANTITIES_12
- from (
- select *
- ,case when month=1 then PLAN_COST else null end PLAN_COST_1
- ,case when month=1 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_1
- ,case when month=2 then PLAN_COST else null end PLAN_COST_2
- ,case when month=2 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_2
- ,case when month=3 then PLAN_COST else null end PLAN_COST_3
- ,case when month=3 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_3
- ,case when month=4 then PLAN_COST else null end PLAN_COST_4
- ,case when month=4 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_4
- ,case when month=5 then PLAN_COST else null end PLAN_COST_5
- ,case when month=5 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_5
- ,case when month=6 then PLAN_COST else null end PLAN_COST_6
- ,case when month=6 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_6
- ,case when month=7 then PLAN_COST else null end PLAN_COST_7
- ,case when month=7 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_7
- ,case when month=8 then PLAN_COST else null end PLAN_COST_8
- ,case when month=8 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_8
- ,case when month=9 then PLAN_COST else null end PLAN_COST_9
- ,case when month=9 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_9
- ,case when month=10 then PLAN_COST else null end PLAN_COST_10
- ,case when month=10 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_10
- ,case when month=11 then PLAN_COST else null end PLAN_COST_11
- ,case when month=11 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_11
- ,case when month=12 then PLAN_COST else null end PLAN_COST_12
- ,case when month=12 then PLAN_QUANTITIES else null end PLAN_QUANTITIES_12
- from monthly_plan_record
- where PROJECT_TYPE = #{planTable} and YEAR = #{YEAR}
- )yb
- left join (
- select *
- ,case when month=1 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_1
- ,case when month=1 then ACTUAL_COST else null end ACTUAL_COST_1
- ,case when month=1 then PAY_COST else null end PAY_COST_1
- ,case when month=1 then RATIO else null end RATIO_1
- ,case when month=2 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_2
- ,case when month=2 then ACTUAL_COST else null end ACTUAL_COST_2
- ,case when month=2 then PAY_COST else null end PAY_COST_2
- ,case when month=2 then RATIO else null end RATIO_2
- ,case when month=3 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_3
- ,case when month=3 then ACTUAL_COST else null end ACTUAL_COST_3
- ,case when month=3 then PAY_COST else null end PAY_COST_3
- ,case when month=3 then RATIO else null end RATIO_3
- ,case when month=4 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_4
- ,case when month=4 then ACTUAL_COST else null end ACTUAL_COST_4
- ,case when month=4 then PAY_COST else null end PAY_COST_4
- ,case when month=4 then RATIO else null end RATIO_4
- ,case when month=5 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_5
- ,case when month=5 then ACTUAL_COST else null end ACTUAL_COST_5
- ,case when month=5 then PAY_COST else null end PAY_COST_5
- ,case when month=5 then RATIO else null end RATIO_5
- ,case when month=6 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_6
- ,case when month=6 then ACTUAL_COST else null end ACTUAL_COST_6
- ,case when month=6 then PAY_COST else null end PAY_COST_6
- ,case when month=6 then RATIO else null end RATIO_6
- ,case when month=7 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_7
- ,case when month=7 then ACTUAL_COST else null end ACTUAL_COST_7
- ,case when month=7 then PAY_COST else null end PAY_COST_7
- ,case when month=7 then RATIO else null end RATIO_7
- ,case when month=8 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_8
- ,case when month=8 then ACTUAL_COST else null end ACTUAL_COST_8
- ,case when month=8 then PAY_COST else null end PAY_COST_8
- ,case when month=8 then RATIO else null end RATIO_8
- ,case when month=9 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_9
- ,case when month=9 then ACTUAL_COST else null end ACTUAL_COST_9
- ,case when month=9 then PAY_COST else null end PAY_COST_9
- ,case when month=9 then RATIO else null end RATIO_9
- ,case when month=10 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_10
- ,case when month=10 then ACTUAL_COST else null end ACTUAL_COST_10
- ,case when month=10 then PAY_COST else null end PAY_COST_10
- ,case when month=10 then RATIO else null end RATIO_10
- ,case when month=11 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_11
- ,case when month=11 then ACTUAL_COST else null end ACTUAL_COST_11
- ,case when month=11 then PAY_COST else null end PAY_COST_11
- ,case when month=11 then RATIO else null end RATIO_11
- ,case when month=12 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_12
- ,case when month=12 then ACTUAL_COST else null end ACTUAL_COST_12
- ,case when month=12 then PAY_COST else null end PAY_COST_12
- ,case when month=12 then RATIO else null end RATIO_12
- from ${type}
- where YEAR = #{YEAR}
-
-
- )mpr on yb.YEAR = mpr.YEAR and yb.COMPANY_ID = mpr.COMPANY_ID and yb.ROAD_ID = mpr.ROAD_ID
- and yb.PROJECT_NAME = mpr.PROJECT_NAME
- group by yb.YEAR,yb.COMPANY_ID,yb.ROAD_ID,yb.PROJECT_NAME
- ) m
- on h.YEAR = m.YEAR and h.COMPANY_ID = m.COMPANY_ID and h.ROAD_ID = m.ROAD_ID and h.PROJECT_NAME = m.PROJECT_NAME
- where h.YEAR = #{YEAR}
- )e
- order by COMPANY_ID, ROAD_ID desc
- )a left join annual_plan_list b on a.year=b.year and a.company_id=b.company_id where b.STATUS='审批通过'
- </select>
-
- <!-- 通过科研月报表相关数据 -->
- <select id="getScidata" parameterType="pd" resultType="pd">
- select a.*,b.status from (
- select DISTINCT * from(
- select h.COMPANY_ID,h.COMPANY,h.ROAD_ID,h.ROAD,h.YEAR,h.PROJECT_NAME,
- h.CATEGORY,h.CONTENT,h.YEAR_COST as PROJECT_COST ,IFNULL(h.AUDIT_FEE,h.YEAR_COST) as AUDIT_FEE,h.MATTER_YEAR,h.MATTER_NEW_CARRY,h.MATTER_CONSULT,
- h.XMWCQKSM as ACTUAL_QUANTITIES,
- m.ACTUAL_QUANTITIES_1,m.ACTUAL_COST_1,m.PAY_COST_1,m.RATIO_1,m.ACTUAL_QUANTITIES_2,m.ACTUAL_COST_2,m.PAY_COST_2,m.RATIO_2,m.ACTUAL_QUANTITIES_3,m.ACTUAL_COST_3,m.PAY_COST_3,m.RATIO_3,
- m.ACTUAL_QUANTITIES_4,m.ACTUAL_COST_4,m.PAY_COST_4,m.RATIO_4,m.ACTUAL_QUANTITIES_5,m.ACTUAL_COST_5,m.PAY_COST_5,m.RATIO_5,m.ACTUAL_QUANTITIES_6,m.ACTUAL_COST_6,m.PAY_COST_6,m.RATIO_6,
- m.ACTUAL_QUANTITIES_7,m.ACTUAL_COST_7,m.PAY_COST_7,m.RATIO_7,m.ACTUAL_QUANTITIES_8,m.ACTUAL_COST_8,m.PAY_COST_8,m.RATIO_8,m.ACTUAL_QUANTITIES_9,m.ACTUAL_COST_9,m.PAY_COST_9,m.RATIO_9,
- m.ACTUAL_QUANTITIES_10,m.ACTUAL_COST_10,m.PAY_COST_10,m.RATIO_10,m.ACTUAL_QUANTITIES_11,m.ACTUAL_COST_11,m.PAY_COST_11,m.RATIO_11,m.ACTUAL_QUANTITIES_12,m.ACTUAL_COST_12,m.PAY_COST_12,m.RATIO_12
- from ${planTable} h
- left join (
- select yb.COMPANY_ID,yb.ROAD_ID,yb.YEAR,yb.PROJECT_NAME
- ,max(ACTUAL_QUANTITIES_1) as ACTUAL_QUANTITIES_1,max(ACTUAL_COST_1) as ACTUAL_COST_1,max(PAY_COST_1) as PAY_COST_1,max(RATIO_1) as RATIO_1
- ,max(ACTUAL_QUANTITIES_2) as ACTUAL_QUANTITIES_2,max(ACTUAL_COST_2) as ACTUAL_COST_2,max(PAY_COST_2) as PAY_COST_2,max(RATIO_2) as RATIO_2
- ,max(ACTUAL_QUANTITIES_3) as ACTUAL_QUANTITIES_3,max(ACTUAL_COST_3) as ACTUAL_COST_3,max(PAY_COST_3) as PAY_COST_3,max(RATIO_3) as RATIO_3
- ,max(ACTUAL_QUANTITIES_4) as ACTUAL_QUANTITIES_4,max(ACTUAL_COST_4) as ACTUAL_COST_4,max(PAY_COST_4) as PAY_COST_4,max(RATIO_4) as RATIO_4
- ,max(ACTUAL_QUANTITIES_5) as ACTUAL_QUANTITIES_5,max(ACTUAL_COST_5) as ACTUAL_COST_5,max(PAY_COST_5) as PAY_COST_5,max(RATIO_5) as RATIO_5
- ,max(ACTUAL_QUANTITIES_6) as ACTUAL_QUANTITIES_6,max(ACTUAL_COST_6) as ACTUAL_COST_6,max(PAY_COST_6) as PAY_COST_6,max(RATIO_6) as RATIO_6
- ,max(ACTUAL_QUANTITIES_7) as ACTUAL_QUANTITIES_7,max(ACTUAL_COST_7) as ACTUAL_COST_7,max(PAY_COST_7) as PAY_COST_7,max(RATIO_7) as RATIO_7
- ,max(ACTUAL_QUANTITIES_8) as ACTUAL_QUANTITIES_8,max(ACTUAL_COST_8) as ACTUAL_COST_8,max(PAY_COST_8) as PAY_COST_8,max(RATIO_8) as RATIO_8
- ,max(ACTUAL_QUANTITIES_9) as ACTUAL_QUANTITIES_9,max(ACTUAL_COST_9) as ACTUAL_COST_9,max(PAY_COST_9) as PAY_COST_9,max(RATIO_9) as RATIO_9
- ,max(ACTUAL_QUANTITIES_10) as ACTUAL_QUANTITIES_10,max(ACTUAL_COST_10) as ACTUAL_COST_10,max(PAY_COST_10) as PAY_COST_10,max(RATIO_10) as RATIO_10
- ,max(ACTUAL_QUANTITIES_11) as ACTUAL_QUANTITIES_11,max(ACTUAL_COST_11) as ACTUAL_COST_11,max(PAY_COST_11) as PAY_COST_11,max(RATIO_11) as RATIO_11
- ,max(ACTUAL_QUANTITIES_12) as ACTUAL_QUANTITIES_12,max(ACTUAL_COST_12) as ACTUAL_COST_12,max(PAY_COST_12) as PAY_COST_12,max(RATIO_12) as RATIO_12
- from(
- select *
- ,case when month=1 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_1
- ,case when month=1 then ACTUAL_COST else null end ACTUAL_COST_1
- ,case when month=1 then PAY_COST else null end PAY_COST_1
- ,case when month=1 then RATIO else null end RATIO_1
- ,case when month=2 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_2
- ,case when month=2 then ACTUAL_COST else null end ACTUAL_COST_2
- ,case when month=2 then PAY_COST else null end PAY_COST_2
- ,case when month=2 then RATIO else null end RATIO_2
- ,case when month=3 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_3
- ,case when month=3 then ACTUAL_COST else null end ACTUAL_COST_3
- ,case when month=3 then PAY_COST else null end PAY_COST_3
- ,case when month=3 then RATIO else null end RATIO_3
- ,case when month=4 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_4
- ,case when month=4 then ACTUAL_COST else null end ACTUAL_COST_4
- ,case when month=4 then PAY_COST else null end PAY_COST_4
- ,case when month=4 then RATIO else null end RATIO_4
- ,case when month=5 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_5
- ,case when month=5 then ACTUAL_COST else null end ACTUAL_COST_5
- ,case when month=5 then PAY_COST else null end PAY_COST_5
- ,case when month=5 then RATIO else null end RATIO_5
- ,case when month=6 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_6
- ,case when month=6 then ACTUAL_COST else null end ACTUAL_COST_6
- ,case when month=6 then PAY_COST else null end PAY_COST_6
- ,case when month=6 then RATIO else null end RATIO_6
- ,case when month=7 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_7
- ,case when month=7 then ACTUAL_COST else null end ACTUAL_COST_7
- ,case when month=7 then PAY_COST else null end PAY_COST_7
- ,case when month=7 then RATIO else null end RATIO_7
- ,case when month=8 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_8
- ,case when month=8 then ACTUAL_COST else null end ACTUAL_COST_8
- ,case when month=8 then PAY_COST else null end PAY_COST_8
- ,case when month=8 then RATIO else null end RATIO_8
- ,case when month=9 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_9
- ,case when month=9 then ACTUAL_COST else null end ACTUAL_COST_9
- ,case when month=9 then PAY_COST else null end PAY_COST_9
- ,case when month=9 then RATIO else null end RATIO_9
- ,case when month=10 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_10
- ,case when month=10 then ACTUAL_COST else null end ACTUAL_COST_10
- ,case when month=10 then PAY_COST else null end PAY_COST_10
- ,case when month=10 then RATIO else null end RATIO_10
- ,case when month=11 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_11
- ,case when month=11 then ACTUAL_COST else null end ACTUAL_COST_11
- ,case when month=11 then PAY_COST else null end PAY_COST_11
- ,case when month=11 then RATIO else null end RATIO_11
- ,case when month=12 then ACTUAL_QUANTITIES else null end ACTUAL_QUANTITIES_12
- ,case when month=12 then ACTUAL_COST else null end ACTUAL_COST_12
- ,case when month=12 then PAY_COST else null end PAY_COST_12
- ,case when month=12 then RATIO else null end RATIO_12
- from ${type}
- where YEAR = #{YEAR}
- )yb group by yb.YEAR,yb.COMPANY_ID,yb.ROAD_ID,yb.PROJECT_NAME
- ) m
- on h.YEAR = m.YEAR and h.COMPANY_ID = m.COMPANY_ID and h.ROAD_ID = m.ROAD_ID and h.PROJECT_NAME = m.PROJECT_NAME
- where h.YEAR = #{YEAR}
- )e
- order by COMPANY_ID, ROAD_ID desc
- )a left join annual_plan_list b on a.year=b.year and a.company_id=b.company_id where b.STATUS='审批通过'
- </select>
-
- <!-- 根据年份查询养护计划考核 -->
- <select id="queryExamineResultByYear" parameterType="pd" resultType="pd">
- SELECT
- e.*,
- (IFNULL(WCL, 0) +
- IFNULL(SBJSL, 0) +
- IFNULL(BZZL, 0)) AS 'total_score'
- FROM
- examine_results e
- WHERE
- `YEAR` = #{year}
- </select>
-
- <!-- 根据年份删除养护计划考核 -->
- <delete id="deleExamineResultByYear" parameterType="String">
- DELETE
- FROM
- examine_results
- WHERE
- `YEAR` = #{year}
- </delete>
- <!-- 批量新增养护计划考核 -->
- <insert id="batchSaveExamineResult" parameterType="pd">
- insert into examine_results
- (
- COMPANY,
- COMPANY_ID,
- YEAR,
- BZZL
- )
- values
- <foreach collection ="list" item="item" separator =",">
- (
- #{item.COMPANY},
- #{item.COMPANY_ID},
- #{item.YEAR},
- #{item.BZZL}
- )
- </foreach >
- </insert>
-
- <!-- 查询养护计划考核 -->
- <select id="queryCompanyExamineResult" parameterType="pd" resultType="pd">
- SELECT
- o.BIANMA AS 'COMPANY_ID',
- o.NAME AS 'COMPANY',
- r.YEAR AS 'YEAR',
- BZZL
- FROM
- oa_department o
- LEFT JOIN examine_results r ON o.BIANMA = r.company_id AND r.year = #{year}
- WHERE o.parent_id = '0'
- ORDER BY (o.BIANMA+0) ASC
- </select>
-
- <!-- 查询公司完成率 -->
- <select id="queryWcl" parameterType="pd" resultType="pd">
-
- SELECT
- PCOMPANY_ID,
- PCOMPANY,
- (
- (
- SUM(IFNULL(DAILY_COMPLETE, 0)) +
- SUM(IFNULL(MINOR_PREVENTION_COMPLETE,0)) +
- SUM(IFNULL(MIDDLE_PREVENTION_COMPLETE,0)) +
- SUM(IFNULL(OVERHAUL_PREVENTION_COMPLETE,0)) +
- SUM(IFNULL(MINOR_REPAIR_COMPLETE, 0)) +
- SUM(IFNULL(MIDDLE_REPAIR_COMPLETE, 0)) +
- SUM(IFNULL(OVERHAUL_COMPLETE, 0)) +
- SUM(IFNULL(SPECIAL_COMPLETE, 0)) +
- SUM(IFNULL(TEST_COMPLETE, 0)) +
- SUM(IFNULL(SCIENTIFIC_COMPLETE, 0)) +
- SUM(IFNULL(DEVICE_COMPLETE, 0)) +
- SUM(IFNULL(RESERVE_COMPLETE, 0)) +
- SUM(IFNULL(EMERGENCY_COMPLETE,0))
- ) /
- (
- SUM(IFNULL(DAILY_DESIGN, 0)) +
- SUM(IFNULL(MINOR_PREVENTION_DESIGN, 0)) +
- SUM(IFNULL(MIDDLE_PREVENTION_DESIGN, 0)) +
- SUM(IFNULL(OVERHAUL_PREVENTION_DESIGN,0)) +
- SUM(IFNULL(MINOR_REPAIR_DESIGN, 0)) +
- SUM(IFNULL(MIDDLE_REPAIR_DESIGN, 0)) +
- SUM(IFNULL(OVERHAUL_DESIGN, 0)) +
- SUM(IFNULL(SPECIAL_DESIGN, 0)) +
- SUM(IFNULL(TEST_DESIGN, 0)) +
- SUM(IFNULL(SCIENTIFIC_DESIGN, 0)) +
- SUM(IFNULL(DEVICE_DESIGN, 0)) +
- SUM(IFNULL(RESERVE_DESIGN, 0)) +
- SUM(IFNULL(EMERGENCY_DESIGN,0))
- )
- ) AS 'WCL'
- FROM
- annual_comp_sumtable_view
- WHERE `YEAR` = #{year}
- GROUP BY
- PCOMPANY_ID,
- PCOMPANY
- </select>
-
- <!-- 查询上报及时率 -->
- <select id="querySbjsl" parameterType="pd" resultType="pd">
- SELECT
- p.*, s.sptime,
- CASE
- WHEN DATEDIFF(s.sptime, p.TJTIME) >= 0 THEN 5
- WHEN DATEDIFF(s.sptime, p.TJTIME) >= -7 THEN 3
- ELSE 1 END AS 'SBJSL'
- FROM
- annual_plan_list p
- LEFT JOIN sptime s ON p.`YEAR` = s.`YEAR`
- WHERE
- p.`YEAR` = #{year}
- AND TJTIME IS NOT NULL
- </select>
-
- <!-- 查询年度计划 -->
- <select id="queryAnnualPlanYear" parameterType="pd" resultType="pd" >
- SELECT
- DISTINCT
- `YEAR` AS 'year'
- FROM
- annual_plan_list
- ORDER BY
- YEAR DESC
- </select>
-
- <select id="getCompanyRoadList" parameterType="pd" resultType="pd">
- select * from ${table} ORDER BY (BIANMA+0) ASC
- </select>
- </mapper>
|