123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977 |
- <?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.steerinfo.ems.tcm0348.mapper.TCm0348Mapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.ems.tcm0348.model.TCm0348">
- <id column="RECORDID" jdbcType="VARCHAR" property="recordid" />
- <result column="ANALYST" jdbcType="VARCHAR" property="analyst" />
- <result column="DATADATE" jdbcType="TIMESTAMP" property="datadate" />
- <result column="DATASTATE" jdbcType="VARCHAR" property="datastate" />
- <result column="MONITORDATE" jdbcType="VARCHAR" property="monitordate" />
- <result column="MONITORINGVALUE" jdbcType="DECIMAL" property="monitoringvalue" />
- <result column="NOTE" jdbcType="VARCHAR" property="note" />
- <result column="PLANID" jdbcType="VARCHAR" property="planid" />
- <result column="POWERDETECDEPARTMENT" jdbcType="VARCHAR" property="powerdetecdepartment" />
- <result column="POWERMONITORNAME" jdbcType="VARCHAR" property="powermonitorname" />
- <result column="POWERSYSTEMNAME" jdbcType="VARCHAR" property="powersystemname" />
- <result column="UNIT" jdbcType="VARCHAR" property="unit" />
- <result column="SITEM" jdbcType="VARCHAR" property="sitem" />
- <result column="BATCHNO" jdbcType="VARCHAR" property="batchno" />
- <result column="TIMEGRANID" jdbcType="VARCHAR" property="timegranid" />
- <result column="ITEMID" jdbcType="VARCHAR" property="itemid" />
- <result column="INSERT_TIME" jdbcType="VARCHAR" property="insertTime" />
- <result column="QTYPE" jdbcType="VARCHAR" property="qtype" />
- <result column="BANBIE" jdbcType="VARCHAR" property="banbie" />
- <result column="BANCI" jdbcType="VARCHAR" property="banci" />
- <result column="LSH" jdbcType="VARCHAR" property="lsh" />
- <result column="TOTALNUM" jdbcType="VARCHAR" property="totalnum" />
- <result column="PASSNUM" jdbcType="VARCHAR" property="passnum" />
- <result column="PASSRATE" jdbcType="VARCHAR" property="passrate" />
- </resultMap>
- <!-- 动力监测计划制定界面修改 -->
- <update id="updatefromother" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
- update T_CM_0348
- <set>
- <if test="analyst != null">
- ANALYST = #{analyst,jdbcType=VARCHAR},
- </if>
- <if test="datadate != null">
- DATADATE = #{datadate,jdbcType=TIMESTAMP},
- </if>
- <if test="datastate != null">
- DATASTATE = #{datastate,jdbcType=VARCHAR},
- </if>
- <if test="monitordate != null">
- MONITORDATE = #{monitordate,jdbcType=VARCHAR},
- </if>
- <if test="monitoringvalue != null">
- MONITORINGVALUE = #{monitoringvalue,jdbcType=DECIMAL},
- </if>
- <if test="note != null">
- NOTE = #{note,jdbcType=VARCHAR},
- </if>
- </set>
- where RECORDID = #{recordid,jdbcType=VARCHAR}
- </update>
- <!-- 动力监测日月数据录入界面修改 -->
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
- update T_CM_0348
- <set>
- <if test="analyst != null">
- ANALYST = #{analyst,jdbcType=VARCHAR},
- </if>
- <if test="datadate != null">
- DATADATE = #{datadate,jdbcType=TIMESTAMP},
- </if>
- <if test="datastate != null">
- DATASTATE = #{datastate,jdbcType=VARCHAR},
- </if>
- <if test="monitordate != null">
- MONITORDATE = #{monitordate,jdbcType=VARCHAR},
- </if>
- <if test="monitoringvalue != null">
- MONITORINGVALUE = #{monitoringvalue,jdbcType=DECIMAL},
- </if>
- <if test="note != null">
- NOTE = #{note,jdbcType=VARCHAR},
- </if>
- </set>
- where RECORDID = #{recordid,jdbcType=VARCHAR}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select RECORDID, ANALYST, DATADATE, DATASTATE, POWERDETECDEPARTMENT, MONITORDATE,
- MONITORINGVALUE, NOTE, PLANID, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO,
- TIMEGRANID, INSERT_TIME
- from T_CM_0348
- where RECORDID = #{recordid,jdbcType=VARCHAR}
- </select>
- <!-- 动力监测日月数据录入界面查询 -->
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select RECORDID, ANALYST, DATADATE, DATASTATE, POWERDETECDEPARTMENT, MONITORDATE,
- MONITORINGVALUE, NOTE, PLANID, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO,
- TIMEGRANID, INSERT_TIME
- from T_CM_0348
- <where>
- <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
- and POWERDETECDEPARTMENT = #{powerdetecdepartment, jdbcType=VARCHAR}
- </if>
- <if test="planid != null and planid != ''">
- and PLANID = #{planid, jdbcType=VARCHAR}
- </if>
- <if test="powermonitorname != null and powermonitorname != ''">
- and POWERMONITORNAME in (${powermonitorname})
- </if>
- <if test="powersystemname != null and powersystemname != ''">
- and POWERSYSTEMNAME in (${powersystemname})
- </if>
- <if test="batchno != null and batchno != ''">
- and BATCHNO like '%${batchno}%'
- </if>
- <if test="timegranid != null and timegranid != ''">
- and TIMEGRANID = #{timegranid, jdbcType=VARCHAR}
- </if>
- <if test="sitem != null and sitem != ''">
- and SITEM in (${sitem})
- </if>
- <if test="startTime != null and startTime != '' and endTime != null and endTime !='' ">
- and
- to_date(MONITORDATE,'yyyy-mm-dd hh24:mi:ss')
- between to_date(#{startTime}, 'yyyy-mm-dd') and to_date(#{endTime}, 'yyyy-mm-dd')
- </if>
- </where>
- order by MONITORDATE desc
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into T_CM_0348
- (RECORDID, PLANID, POWERDETECDEPARTMENT, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO, TIMEGRANID, INSERT_TIME, MONITORDATE,MONITORINGVALUE,ANALYST,DATADATE)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.recordid, jdbcType=DECIMAL}, #{item.planid, jdbcType=VARCHAR}, #{item.powerdetecdepartment, jdbcType=VARCHAR}, #{item.powermonitorname, jdbcType=VARCHAR},
- #{item.sitem, jdbcType=VARCHAR}, #{item.powersystemname, jdbcType=VARCHAR}, #{item.unit, jdbcType=VARCHAR}, #{item.batchno, jdbcType=VARCHAR},
- #{item.timegranid, jdbcType=VARCHAR}, #{item.insertTime, jdbcType=VARCHAR}, #{item.monitordate, jdbcType=VARCHAR},#{item.monitoringvalue, jdbcType=DECIMAL},
- #{item.analyst, jdbcType=VARCHAR}, #{item.datadate,jdbcType=TIMESTAMP}
- from dual
- </foreach> )
- </insert>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from T_CM_0348
- where RECORDID = #{recordid,jdbcType=VARCHAR}
- </delete>
- <!-- 动力监测数据查询界面查询 -->
- <select id="dataQuery" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select RECORDID, ANALYST, DATADATE, DATASTATE, POWERDETECDEPARTMENT, MONITORDATE,
- MONITORINGVALUE, NOTE, PLANID, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO,
- TIMEGRANID, INSERT_TIME
- from T_CM_0348
- <where>
- <if test="analyst != null and analyst != ''">
- and ANALYST like '%${analyst}%'
- </if>
- <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
- and POWERDETECDEPARTMENT = #{powerdetecdepartment, jdbcType=VARCHAR}
- </if>
- <if test="powermonitorname != null and powermonitorname != ''">
- and POWERMONITORNAME = #{powermonitorname, jdbcType=VARCHAR}
- </if>
- <if test="powersystemname != null and powersystemname != ''">
- and POWERSYSTEMNAME = #{powersystemname, jdbcType=VARCHAR}
- </if>
- <if test="batchno != null and batchno != ''">
- and BATCHNO = #{batchno, jdbcType=VARCHAR}
- </if>
- <if test="timegranid != null and timegranid != ''">
- and TIMEGRANID = #{timegranid, jdbcType=VARCHAR}
- </if>
- <if test="monitordate != null and monitordate != ''">
- and MONITORDATE >= #{monitordate, jdbcType=VARCHAR}
- </if>
- <if test="monitordatee != null and monitordatee != ''">
- and MONITORDATE <= #{monitordatee, jdbcType=VARCHAR}
- </if>
- ORDER BY MONITORDATE, DATADATE
- </where>
- </select>
- <delete id="deleteprevious" parameterType="java.util.HashMap">
- delete from T_CM_0348
- where PLANID = #{planid, jdbcType=VARCHAR}
- and MONITORINGVALUE is null
- and DATADATE is null
- <if test="lowerpici != null and lowerpici !=''">
- and BATCHNO > #{lowerpici, jdbcType=VARCHAR}
- </if>
- <if test="upperpici != null and upperpici !=''">
- and BATCHNO <= #{upperpici, jdbcType=VARCHAR}
- </if>
- </delete>
- <select id="checkmaxdate" parameterType="java.lang.String" resultType="java.lang.String">
- select MAX(INSERT_TIME) as INSERT_TIME from T_CM_0348
- where PLANID = #{planid, jdbcType=VARCHAR}
- and MONITORDATE in (select MAX(MONITORDATE) from T_CM_0348)
- </select>
- <!-- 动力历史数据对比分析界面查询 -->
- <select id="datacomparison" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select t.UNIT, t.POWERDETECDEPARTMENT, t.POWERMONITORNAME, t.POWERSYSTEMNAME,
- t.MONITORDATE, t.SITEM, t.DATADATE, t2.CLOCKMAXVALUE, t2.CLOCKMINVALUE
- from
- T_CM_0348 t,
- ( select SITEM, max(MONITORINGVALUE) as CLOCKMAXVALUE, min(MONITORINGVALUE) as CLOCKMINVALUE from T_CM_0348 group by SITEM ) t2
- where
- t.SITEM = t2.SITEM
- and MONITORDATE = #{monitordate, jdbcType = VARCHAR}
- and TIMEGRANID = #{timegran, jdbcType = VARCHAR}
- <if test="powerdetectiondepartment != null and powerdetectiondepartment != ''">
- and POWERDETECDEPARTMENT = #{powerdetectiondepartment, jdbcType=VARCHAR}
- </if>
- <if test="powermonitorname != null and powermonitorname != ''">
- and POWERMONITORNAME = #{powermonitorname, jdbcType=VARCHAR}
- </if>
- <if test="powersystemname != null and powersystemname != ''">
- and POWERSYSTEMNAME = #{powersystemname, jdbcType=VARCHAR}
- </if>
- <if test="sitem != null and sitem != ''">
- and SITEM = #{sitem, jdbcType=VARCHAR}
- </if>
- union select t.UNIT, t.POWERDETECDEPARTMENT, t.POWERMONITORNAME, t.POWERSYSTEMNAME,
- t.MONITORDATE, t.SITEM, t.DATADATE, t2.COMPARECLOCKMAXVALUE, t2.COMPARECLOCKMINVALUE
- from
- T_CM_0348 t,
- ( select SITEM, max(MONITORINGVALUE) as COMPARECLOCKMAXVALUE, min(MONITORINGVALUE) as COMPARECLOCKMINVALUE from T_CM_0348 group by SITEM ) t2
- where
- t.SITEM = t2.SITEM
- and MONITORDATE = #{monitordatee, jdbcType = VARCHAR}
- and TIMEGRANID = #{timegran, jdbcType = VARCHAR}
- <if test="powerdetectiondepartment != null and powerdetectiondepartment != ''">
- and POWERDETECDEPARTMENT = #{powerdetectiondepartment, jdbcType=VARCHAR}
- </if>
- <if test="powermonitorname != null and powermonitorname != ''">
- and POWERMONITORNAME = #{powermonitorname, jdbcType=VARCHAR}
- </if>
- <if test="powersystemname != null and powersystemname != ''">
- and POWERSYSTEMNAME = #{powersystemname, jdbcType=VARCHAR}
- </if>
- <if test="sitem != null and sitem != ''">
- and SITEM = #{sitem, jdbcType=VARCHAR}
- </if>
- ORDER BY MONITORDATE
- </select>
- <!-- 动力质量考核指标统计界面查询 -->
- <select id="qualityassessment" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- SELECT
- sum( CASE WHEN a.MONITORINGVALUE <= c.UPPERLIMIT AND a.MONITORINGVALUE >= c.LOWERLIMIT THEN 1 ELSE 0 END ) AS PASSNUM,
- count( a.SITEM ) AS TOTALNUM,
- round( 100 * sum( CASE WHEN a.MONITORINGVALUE <= c.UPPERLIMIT AND a.MONITORINGVALUE >= c.LOWERLIMIT THEN 1 ELSE 0 END ) / count( a.SITEM ), 2 ) AS PASSRATE,
- a.POWERDETECDEPARTMENT,
- a.POWERMONITORNAME,
- a.POWERSYSTEMNAME
- FROM T_CM_0348 a, T_CM_0323 b, T_CM_0324 c
- WHERE
- b.ITEMCODE = a.SITEM
- and b.CHECKSTATE = 'Check'
- and a.POWERDETECDEPARTMENT = c.POWERDETECDEPARTMENT
- and a.POWERSYSTEMNAME = c.POWERSYSTEMNAME
- and a.POWERMONITORNAME = c.POWERMONITORNAME
- and a.SITEM = c.ITEMNAME
- and instr( a.MONITORDATE, c.CREATYEAR ) > 0
- <if test="monitordate != null and monitordate != ''">
- and instr( a.MONITORDATE, #{monitordate, jdbcType=VARCHAR}) > 0
- </if>
- <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
- and POWERDETECDEPARTMENT = #{powerdetecdepartment, jdbcType=VARCHAR}
- </if>
- <if test="powersystemname != null and powersystemname != ''">
- and POWERSYSTEMNAME = #{powersystemname, jdbcType=VARCHAR}
- </if>
- GROUP BY a.POWERDETECDEPARTMENT, a.POWERMONITORNAME, a.POWERSYSTEMNAME
- </select>
- <!--
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select RECORDID, ANALYST, DATADATE, DATASTATE, POWERDETECDEPARTMENT, MONITORDATE,
- MONITORINGVALUE, NOTE, PLANID, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO,
- TIMEGRANID, INSERT_TIME
- from T_CM_0348
- <where>
- <if test="recordid != null">
- and RECORDID = #{recordid}
- </if>
- <if test="analyst != null and analyst != ''">
- and ANALYST LIKE '%${analyst}%'
- </if>
- <if test="datadate != null and datadate != ''">
- and DATADATE LIKE '%${datadate}%'
- </if>
- <if test="datastate != null and datastate != ''">
- and DATASTATE LIKE '%${datastate}%'
- </if>
- <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
- and POWERDETECDEPARTMENT LIKE '%${powerdetecdepartment}%'
- </if>
- <if test="monitordate != null and monitordate != ''">
- and MONITORDATE LIKE '%${monitordate}%'
- </if>
- <if test="monitoringvalue != null">
- and MONITORINGVALUE = #{monitoringvalue}
- </if>
- <if test="note != null and note != ''">
- and NOTE LIKE '%${note}%'
- </if>
- <if test="planid != null and planid != ''">
- and PLANID LIKE '%${planid}%'
- </if>
- <if test="powermonitorname != null and powermonitorname != ''">
- and POWERMONITORNAME LIKE '%${powermonitorname}%'
- </if>
- <if test="sitem != null and sitem != ''">
- and SITEM LIKE '%${sitem}%'
- </if>
- <if test="powersystemname != null and powersystemname != ''">
- and POWERSYSTEMNAME LIKE '%${powersystemname}%'
- </if>
- <if test="unit != null and unit != ''">
- and UNIT LIKE '%${unit}%'
- </if>
- <if test="batchno != null and batchno != ''">
- and BATCHNO LIKE '%${batchno}%'
- </if>
- <if test="timegranid != null and timegranid != ''">
- and TIMEGRANID LIKE '%${timegranid}%'
- </if>
- <if test="inserttime != null and inserttime != ''">
- and INSERT_TIME LIKE '%${inserttime}%'
- </if>
- </where>
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from T_CM_0348
- where RECORDID = #{recordid,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from T_CM_0348
- where 1!=1
- <if test="analyst != null and analyst != ''">
- and ANALYST = #{analyst}
- </if>
- <if test="datadate != null and datadate != ''">
- and DATADATE = #{datadate}
- </if>
- <if test="datastate != null and datastate != ''">
- and DATASTATE = #{datastate}
- </if>
- <if test="monitordate != null and monitordate != ''">
- and MONITORDATE = #{monitordate}
- </if>
- <if test="monitoringvalue != null">
- and MONITORINGVALUE = #{monitoringvalue}
- </if>
- <if test="note != null and note != ''">
- and NOTE = #{note}
- </if>
- <if test="planid != null and planid != ''">
- and PLANID = #{planid}
- </if>
- <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
- and POWERDETECDEPARTMENT = #{powerdetecdepartment}
- </if>
- <if test="powermonitorname != null and powermonitorname != ''">
- and POWERMONITORNAME = #{powermonitorname}
- </if>
- <if test="powersystemname != null and powersystemname != ''">
- and POWERSYSTEMNAME = #{powersystemname}
- </if>
- <if test="unit != null and unit != ''">
- and UNIT = #{unit}
- </if>
- <if test="sitem != null and sitem != ''">
- and SITEM = #{sitem}
- </if>
- <if test="batchno != null and batchno != ''">
- and BATCHNO = #{batchno}
- </if>
- <if test="timegranid != null and timegranid != ''">
- and TIMEGRANID = #{timegranid}
- </if>
- <if test="itemid != null and itemid != ''">
- and ITEMID = #{itemid}
- </if>
- <if test="insertTime != null and insertTime != ''">
- and INSERT_TIME = #{insertTime}
- </if>
- <if test="qtype != null and qtype != ''">
- and QTYPE = #{qtype}
- </if>
- <if test="banbie != null and banbie != ''">
- and BANBIE = #{banbie}
- </if>
- <if test="banci != null and banci != ''">
- and BANCI = #{banci}
- </if>
- <if test="lsh != null and lsh != ''">
- and LSH = #{lsh}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
- insert into T_CM_0348 (RECORDID, ANALYST, DATADATE,
- DATASTATE, MONITORDATE,
- MONITORINGVALUE, NOTE, PLANID,
- POWERDETECDEPARTMENT, POWERMONITORNAME,
- POWERSYSTEMNAME, UNIT, SITEM,
- BATCHNO, TIMEGRANID, ITEMID,
- INSERT_TIME, QTYPE, BANBIE,
- BANCI, LSH)
- values (#{recordid,jdbcType=DECIMAL}, #{analyst,jdbcType=VARCHAR}, #{datadate,jdbcType=VARCHAR},
- #{datastate,jdbcType=VARCHAR}, #{monitordate,jdbcType=VARCHAR},
- #{monitoringvalue,jdbcType=DECIMAL}, #{note,jdbcType=VARCHAR}, #{planid,jdbcType=VARCHAR},
- #{powerdetecdepartment,jdbcType=VARCHAR}, #{powermonitorname,jdbcType=VARCHAR},
- #{powersystemname,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{sitem,jdbcType=VARCHAR},
- #{batchno,jdbcType=VARCHAR}, #{timegranid,jdbcType=VARCHAR}, #{itemid,jdbcType=VARCHAR},
- #{insertTime,jdbcType=VARCHAR}, #{qtype,jdbcType=VARCHAR}, #{banbie,jdbcType=VARCHAR},
- #{banci,jdbcType=VARCHAR}, #{lsh,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
- insert into T_CM_0348
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="recordid != null">
- RECORDID,
- </if>
- <if test="analyst != null">
- ANALYST,
- </if>
- <if test="datadate != null">
- DATADATE,
- </if>
- <if test="datastate != null">
- DATASTATE,
- </if>
- <if test="monitordate != null">
- MONITORDATE,
- </if>
- <if test="monitoringvalue != null">
- MONITORINGVALUE,
- </if>
- <if test="note != null">
- NOTE,
- </if>
- <if test="planid != null">
- PLANID,
- </if>
- <if test="powerdetecdepartment != null">
- POWERDETECDEPARTMENT,
- </if>
- <if test="powermonitorname != null">
- POWERMONITORNAME,
- </if>
- <if test="powersystemname != null">
- POWERSYSTEMNAME,
- </if>
- <if test="unit != null">
- UNIT,
- </if>
- <if test="sitem != null">
- SITEM,
- </if>
- <if test="batchno != null">
- BATCHNO,
- </if>
- <if test="timegranid != null">
- TIMEGRANID,
- </if>
- <if test="itemid != null">
- ITEMID,
- </if>
- <if test="insertTime != null">
- INSERT_TIME,
- </if>
- <if test="qtype != null">
- QTYPE,
- </if>
- <if test="banbie != null">
- BANBIE,
- </if>
- <if test="banci != null">
- BANCI,
- </if>
- <if test="lsh != null">
- LSH,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="recordid != null">
- #{recordid,jdbcType=DECIMAL},
- </if>
- <if test="analyst != null">
- #{analyst,jdbcType=VARCHAR},
- </if>
- <if test="datadate != null">
- #{datadate,jdbcType=VARCHAR},
- </if>
- <if test="datastate != null">
- #{datastate,jdbcType=VARCHAR},
- </if>
- <if test="monitordate != null">
- #{monitordate,jdbcType=VARCHAR},
- </if>
- <if test="monitoringvalue != null">
- #{monitoringvalue,jdbcType=DECIMAL},
- </if>
- <if test="note != null">
- #{note,jdbcType=VARCHAR},
- </if>
- <if test="planid != null">
- #{planid,jdbcType=VARCHAR},
- </if>
- <if test="powerdetecdepartment != null">
- #{powerdetecdepartment,jdbcType=VARCHAR},
- </if>
- <if test="powermonitorname != null">
- #{powermonitorname,jdbcType=VARCHAR},
- </if>
- <if test="powersystemname != null">
- #{powersystemname,jdbcType=VARCHAR},
- </if>
- <if test="unit != null">
- #{unit,jdbcType=VARCHAR},
- </if>
- <if test="sitem != null">
- #{sitem,jdbcType=VARCHAR},
- </if>
- <if test="batchno != null">
- #{batchno,jdbcType=VARCHAR},
- </if>
- <if test="timegranid != null">
- #{timegranid,jdbcType=VARCHAR},
- </if>
- <if test="itemid != null">
- #{itemid,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- #{insertTime,jdbcType=VARCHAR},
- </if>
- <if test="qtype != null">
- #{qtype,jdbcType=VARCHAR},
- </if>
- <if test="banbie != null">
- #{banbie,jdbcType=VARCHAR},
- </if>
- <if test="banci != null">
- #{banci,jdbcType=VARCHAR},
- </if>
- <if test="lsh != null">
- #{lsh,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
- update T_CM_0348
- set ANALYST = #{analyst,jdbcType=VARCHAR},
- DATADATE = #{datadate,jdbcType=VARCHAR},
- DATASTATE = #{datastate,jdbcType=VARCHAR},
- MONITORDATE = #{monitordate,jdbcType=VARCHAR},
- MONITORINGVALUE = #{monitoringvalue,jdbcType=DECIMAL},
- NOTE = #{note,jdbcType=VARCHAR},
- PLANID = #{planid,jdbcType=VARCHAR},
- POWERDETECDEPARTMENT = #{powerdetecdepartment,jdbcType=VARCHAR},
- POWERMONITORNAME = #{powermonitorname,jdbcType=VARCHAR},
- POWERSYSTEMNAME = #{powersystemname,jdbcType=VARCHAR},
- UNIT = #{unit,jdbcType=VARCHAR},
- SITEM = #{sitem,jdbcType=VARCHAR},
- BATCHNO = #{batchno,jdbcType=VARCHAR},
- TIMEGRANID = #{timegranid,jdbcType=VARCHAR},
- ITEMID = #{itemid,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=VARCHAR},
- QTYPE = #{qtype,jdbcType=VARCHAR},
- BANBIE = #{banbie,jdbcType=VARCHAR},
- BANCI = #{banci,jdbcType=VARCHAR},
- LSH = #{lsh,jdbcType=VARCHAR}
- where RECORDID = #{recordid,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
- update T_CM_0348
- <set>
- <if test="analyst != null">
- ANALYST = #{analyst,jdbcType=VARCHAR},
- </if>
- <if test="datadate != null">
- DATADATE = #{datadate,jdbcType=VARCHAR},
- </if>
- <if test="datastate != null">
- DATASTATE = #{datastate,jdbcType=VARCHAR},
- </if>
- <if test="monitordate != null">
- MONITORDATE = #{monitordate,jdbcType=VARCHAR},
- </if>
- <if test="monitoringvalue != null">
- MONITORINGVALUE = #{monitoringvalue,jdbcType=DECIMAL},
- </if>
- <if test="note != null">
- NOTE = #{note,jdbcType=VARCHAR},
- </if>
- <if test="planid != null">
- PLANID = #{planid,jdbcType=VARCHAR},
- </if>
- <if test="powerdetecdepartment != null">
- POWERDETECDEPARTMENT = #{powerdetecdepartment,jdbcType=VARCHAR},
- </if>
- <if test="powermonitorname != null">
- POWERMONITORNAME = #{powermonitorname,jdbcType=VARCHAR},
- </if>
- <if test="powersystemname != null">
- POWERSYSTEMNAME = #{powersystemname,jdbcType=VARCHAR},
- </if>
- <if test="unit != null">
- UNIT = #{unit,jdbcType=VARCHAR},
- </if>
- <if test="sitem != null">
- SITEM = #{sitem,jdbcType=VARCHAR},
- </if>
- <if test="batchno != null">
- BATCHNO = #{batchno,jdbcType=VARCHAR},
- </if>
- <if test="timegranid != null">
- TIMEGRANID = #{timegranid,jdbcType=VARCHAR},
- </if>
- <if test="itemid != null">
- ITEMID = #{itemid,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- INSERT_TIME = #{insertTime,jdbcType=VARCHAR},
- </if>
- <if test="qtype != null">
- QTYPE = #{qtype,jdbcType=VARCHAR},
- </if>
- <if test="banbie != null">
- BANBIE = #{banbie,jdbcType=VARCHAR},
- </if>
- <if test="banci != null">
- BANCI = #{banci,jdbcType=VARCHAR},
- </if>
- <if test="lsh != null">
- LSH = #{lsh,jdbcType=VARCHAR},
- </if>
- </set>
- where RECORDID = #{recordid,jdbcType=VARCHAR}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select RECORDID, ANALYST, DATADATE, DATASTATE, MONITORDATE, MONITORINGVALUE,
- NOTE, PLANID, POWERDETECDEPARTMENT, POWERMONITORNAME, POWERSYSTEMNAME, UNIT, SITEM,
- BATCHNO, TIMEGRANID, ITEMID, INSERT_TIME, QTYPE, BANBIE, BANCI, LSH
- from T_CM_0348
- where RECORDID = #{recordid,jdbcType=VARCHAR}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select RECORDID, ANALYST, DATADATE, DATASTATE, MONITORDATE, MONITORINGVALUE,
- NOTE, PLANID, POWERDETECDEPARTMENT, POWERMONITORNAME, POWERSYSTEMNAME, UNIT, SITEM,
- BATCHNO, TIMEGRANID, ITEMID, INSERT_TIME, QTYPE, BANBIE, BANCI, LSH
- from T_CM_0348
- <where>
- <if test="analyst != null and analyst != ''">
- and ANALYST = #{analyst}
- </if>
- <if test="datadate != null and datadate != ''">
- and DATADATE = #{datadate}
- </if>
- <if test="datastate != null and datastate != ''">
- and DATASTATE = #{datastate}
- </if>
- <if test="monitordate != null and monitordate != ''">
- and MONITORDATE = #{monitordate}
- </if>
- <if test="monitoringvalue != null">
- and MONITORINGVALUE = #{monitoringvalue}
- </if>
- <if test="note != null and note != ''">
- and NOTE = #{note}
- </if>
- <if test="planid != null and planid != ''">
- and PLANID = #{planid}
- </if>
- <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
- and POWERDETECDEPARTMENT = #{powerdetecdepartment}
- </if>
- <if test="powermonitorname != null and powermonitorname != ''">
- and POWERMONITORNAME = #{powermonitorname}
- </if>
- <if test="powersystemname != null and powersystemname != ''">
- and POWERSYSTEMNAME = #{powersystemname}
- </if>
- <if test="unit != null and unit != ''">
- and UNIT = #{unit}
- </if>
- <if test="sitem != null and sitem != ''">
- and SITEM = #{sitem}
- </if>
- <if test="batchno != null and batchno != ''">
- and BATCHNO = #{batchno}
- </if>
- <if test="timegranid != null and timegranid != ''">
- and TIMEGRANID = #{timegranid}
- </if>
- <if test="itemid != null and itemid != ''">
- and ITEMID = #{itemid}
- </if>
- <if test="insertTime != null and insertTime != ''">
- and INSERT_TIME = #{insertTime}
- </if>
- <if test="qtype != null and qtype != ''">
- and QTYPE = #{qtype}
- </if>
- <if test="banbie != null and banbie != ''">
- and BANBIE = #{banbie}
- </if>
- <if test="banci != null and banci != ''">
- and BANCI = #{banci}
- </if>
- <if test="lsh != null and lsh != ''">
- and LSH = #{lsh}
- </if>
- </where>
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select RECORDID, ANALYST, DATADATE, DATASTATE, MONITORDATE, MONITORINGVALUE,
- NOTE, PLANID, POWERDETECDEPARTMENT, POWERMONITORNAME, POWERSYSTEMNAME, UNIT, SITEM,
- BATCHNO, TIMEGRANID, ITEMID, INSERT_TIME, QTYPE, BANBIE, BANCI, LSH
- from T_CM_0348
- <where>
- <if test="analyst != null and analyst != ''">
- and ANALYST LIKE '%${analyst}%'
- </if>
- <if test="datadate != null and datadate != ''">
- and DATADATE LIKE '%${datadate}%'
- </if>
- <if test="datastate != null and datastate != ''">
- and DATASTATE LIKE '%${datastate}%'
- </if>
- <if test="monitordate != null and monitordate != ''">
- and MONITORDATE LIKE '%${monitordate}%'
- </if>
- <if test="monitoringvalue != null">
- and MONITORINGVALUE = #{monitoringvalue}
- </if>
- <if test="note != null and note != ''">
- and NOTE LIKE '%${note}%'
- </if>
- <if test="planid != null and planid != ''">
- and PLANID LIKE '%${planid}%'
- </if>
- <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
- and POWERDETECDEPARTMENT LIKE '%${powerdetecdepartment}%'
- </if>
- <if test="powermonitorname != null and powermonitorname != ''">
- and POWERMONITORNAME LIKE '%${powermonitorname}%'
- </if>
- <if test="powersystemname != null and powersystemname != ''">
- and POWERSYSTEMNAME LIKE '%${powersystemname}%'
- </if>
- <if test="unit != null and unit != ''">
- and UNIT LIKE '%${unit}%'
- </if>
- <if test="sitem != null and sitem != ''">
- and SITEM LIKE '%${sitem}%'
- </if>
- <if test="batchno != null and batchno != ''">
- and BATCHNO LIKE '%${batchno}%'
- </if>
- <if test="timegranid != null and timegranid != ''">
- and TIMEGRANID LIKE '%${timegranid}%'
- </if>
- <if test="itemid != null and itemid != ''">
- and ITEMID LIKE '%${itemid}%'
- </if>
- <if test="insertTime != null and insertTime != ''">
- and INSERT_TIME LIKE '%${insertTime}%'
- </if>
- <if test="qtype != null and qtype != ''">
- and QTYPE LIKE '%${qtype}%'
- </if>
- <if test="banbie != null and banbie != ''">
- and BANBIE LIKE '%${banbie}%'
- </if>
- <if test="banci != null and banci != ''">
- and BANCI LIKE '%${banci}%'
- </if>
- <if test="lsh != null and lsh != ''">
- and LSH LIKE '%${lsh}%'
- </if>
- </where>
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into T_CM_0348
- (RECORDID,
- ANALYST, DATADATE, DATASTATE, MONITORDATE, MONITORINGVALUE,
- NOTE, PLANID, POWERDETECDEPARTMENT,
- POWERMONITORNAME, POWERSYSTEMNAME,
- UNIT, SITEM, BATCHNO,
- TIMEGRANID, ITEMID, INSERT_TIME,
- QTYPE, BANBIE, BANCI,
- LSH)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.recordid,jdbcType=DECIMAL},
- #{item.analyst,jdbcType=VARCHAR}, #{item.datadate,jdbcType=VARCHAR}, #{item.datastate,jdbcType=VARCHAR}, #{item.monitordate,jdbcType=VARCHAR}, #{item.monitoringvalue,jdbcType=DECIMAL},
- #{item.note,jdbcType=VARCHAR}, #{item.planid,jdbcType=VARCHAR}, #{item.powerdetecdepartment,jdbcType=VARCHAR},
- #{item.powermonitorname,jdbcType=VARCHAR}, #{item.powersystemname,jdbcType=VARCHAR},
- #{item.unit,jdbcType=VARCHAR}, #{item.sitem,jdbcType=VARCHAR}, #{item.batchno,jdbcType=VARCHAR},
- #{item.timegranid,jdbcType=VARCHAR}, #{item.itemid,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=VARCHAR},
- #{item.qtype,jdbcType=VARCHAR}, #{item.banbie,jdbcType=VARCHAR}, #{item.banci,jdbcType=VARCHAR},
- #{item.lsh,jdbcType=VARCHAR} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update T_CM_0348
- set
- RECORDID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.recordid,jdbcType=DECIMAL}
- </foreach>
- ,ANALYST=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.analyst,jdbcType=VARCHAR}
- </foreach>
- ,DATADATE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.datadate,jdbcType=VARCHAR}
- </foreach>
- ,DATASTATE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.datastate,jdbcType=VARCHAR}
- </foreach>
- ,MONITORDATE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.monitordate,jdbcType=VARCHAR}
- </foreach>
- ,MONITORINGVALUE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.monitoringvalue,jdbcType=DECIMAL}
- </foreach>
- ,NOTE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.note,jdbcType=VARCHAR}
- </foreach>
- ,PLANID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.planid,jdbcType=VARCHAR}
- </foreach>
- ,POWERDETECDEPARTMENT=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.powerdetecdepartment,jdbcType=VARCHAR}
- </foreach>
- ,POWERMONITORNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.powermonitorname,jdbcType=VARCHAR}
- </foreach>
- ,POWERSYSTEMNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.powersystemname,jdbcType=VARCHAR}
- </foreach>
- ,UNIT=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.unit,jdbcType=VARCHAR}
- </foreach>
- ,SITEM=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.sitem,jdbcType=VARCHAR}
- </foreach>
- ,BATCHNO=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.batchno,jdbcType=VARCHAR}
- </foreach>
- ,TIMEGRANID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.timegranid,jdbcType=VARCHAR}
- </foreach>
- ,ITEMID=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.itemid,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=VARCHAR}
- </foreach>
- ,QTYPE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.qtype,jdbcType=VARCHAR}
- </foreach>
- ,BANBIE=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.banbie,jdbcType=VARCHAR}
- </foreach>
- ,BANCI=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.banci,jdbcType=VARCHAR}
- </foreach>
- ,LSH=
- <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
- when #{item.recordid,jdbcType=DECIMAL} then #{item.lsh,jdbcType=VARCHAR}
- </foreach>
- where RECORDID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.recordid,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from T_CM_0348
- where RECORDID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- -->
- <select id="getDateforbfhyd" parameterType="java.lang.String" resultMap="BaseResultMap">
- select 'QualityInspectionCenter' as POWERDETECDEPARTMENT,
- t2.powercode as POWERSYSTEMNAME,
- t1.POWERMONITORCODE as POWERMONITORNAME ,
- t.ITEMNAME as SITEM,
- to_char(to_date(BFHYD_HYRQ, 'yyyymmdd hh24miss'),
- 'yyyy-mm-dd hh24:mi:ss') as MONITORDATE,
- t.BFHYD_ZJDH as BATCHNO,
- t.MONITORINGVALUE,
- t3.unit as UNIT,
- t.TS as DATADATE,
- t.BFHYD_ZJR as ANALYST
- from BFHYD unpivot(MONITORINGVALUE for ITEMNAME
- in(BFHYD_01,
- BFHYD_02,
- BFHYD_03,
- BFHYD_04,
- BFHYD_05,
- BFHYD_06,
- BFHYD_07,
- BFHYD_08,
- BFHYD_09,
- BFHYD_10,
- BFHYD_11,
- BFHYD_12)) t
- left join t_cm_0325 t2
- on t.BFHYD_27 = t2.powername
- left join t_cm_0323 t3
- on t.ITEMNAME = t3.itemcode
- left join t_cm_0316 t1
- on t.BFHYD_26 = t1.powermonitorname and t2.powercode = t1.powersystemname
- where t.BFHYD_ZJDH = #{bfhydzjdh}
- </select>
- <update id="updates" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
- update t_cm_0348
- <set>
- <if test="monitoringvalue != null ">
- MONITORINGVALUE = #{monitoringvalue},
- </if>
- <if test="note != null and note != ''">
- NOTE = #{note}
- </if>
- </set>
- <where>
- <if test="powermonitorname != null and powermonitorname != ''">
- and POWERMONITORNAME = #{powermonitorname}
- </if>
- <if test="batchno != null and batchno != ''">
- and BATCHNO = #{batchno}
- </if>
- <if test="sitem != null and sitem != ''">
- and SITEM = #{sitem}
- </if>
- <if test="powersystemname != null and powersystemname != ''">
- and POWERSYSTEMNAME = #{powersystemname}
- </if>
- <if test="monitordate != null and monitordate != ''">
- and MONITORDATE = #{monitordate}
- </if>
- <if test="unit != null and unit != ''">
- and UNIT = #{unit}
- </if>
- <if test="analyst != null and analyst != ''">
- and ANALYST = #{analyst}
- </if>
- </where>
- </update>
- </mapper>
|