123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975 |
- <?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.trmactitem.mapper.TRmActItemMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.ems.trmactitem.model.TRmActItem">
- <id column="ITEMID" jdbcType="VARCHAR" property="itemid" />
- <result column="ITEMNAME" jdbcType="VARCHAR" property="itemname" />
- <result column="ITEMDESC" jdbcType="VARCHAR" property="itemdesc" />
- <result column="ITEMTYPE" jdbcType="VARCHAR" property="itemtype" />
- <result column="PROPERTYID" jdbcType="VARCHAR" property="propertyid" />
- <result column="WORKPROCID" jdbcType="VARCHAR" property="workprocid" />
- <result column="ENERGYID" jdbcType="VARCHAR" property="energyid" />
- <result column="UNITID" jdbcType="VARCHAR" property="unitid" />
- <result column="USEFLAG" jdbcType="VARCHAR" property="useflag" />
- <result column="ISSETTLE" jdbcType="VARCHAR" property="issettle" />
- <result column="DIGITS" jdbcType="DECIMAL" property="digits" />
- <result column="STATE" jdbcType="VARCHAR" property="state" />
- <result column="CLOCK" jdbcType="VARCHAR" property="clock" />
- <result column="USERID" jdbcType="VARCHAR" property="userid" />
- <result column="MODIFICATIONTIME" jdbcType="VARCHAR" property="modificationtime" />
- <result column="DEFAULTVALUE" jdbcType="DECIMAL" property="defaultvalue" />
- <result column="SHOWNO" jdbcType="DECIMAL" property="showno" />
- <result column="ISUP" jdbcType="VARCHAR" property="isup" />
- <result column="FID" jdbcType="VARCHAR" property="fid" />
- <result column="ASSOCIATEID" jdbcType="VARCHAR" property="associateid" />
- <result column="DEFAULMAN" jdbcType="VARCHAR" property="defaulman" />
- <result column="MINTIMEGRANID" jdbcType="VARCHAR" property="mintimegranid" />
- <result column="SEQNO" jdbcType="DECIMAL" property="seqno" />
- <result column="BZ" jdbcType="VARCHAR" property="bz" />
- <result column="RTPITEMID" jdbcType="VARCHAR" property="rtpitemid" />
- </resultMap>
- <sql id="columns">
- ITEMID, ITEMNAME, ITEMDESC, ITEMTYPE, PROPERTYID, WORKPROCID, ENERGYID, UNITID, USEFLAG,
- ISSETTLE, DIGITS, STATE, CLOCK, USERID, MODIFICATIONTIME, DEFAULTVALUE, SHOWNO, ISUP,
- FID, ASSOCIATEID, DEFAULMAN, MINTIMEGRANID, SEQNO, BZ
- </sql>
- <sql id="columns_alias">
- t.ITEMID, t.ITEMNAME, t.ITEMDESC, t.ITEMTYPE, t.PROPERTYID, t.WORKPROCID, t.ENERGYID,
- t.UNITID, t.USEFLAG, t.ISSETTLE, t.DIGITS, t.STATE, t.CLOCK, t.USERID, t.MODIFICATIONTIME,
- t.DEFAULTVALUE, t.SHOWNO, t.ISUP, t.FID, t.ASSOCIATEID, t.DEFAULMAN, t.MINTIMEGRANID,
- t.SEQNO, t.BZ
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM T_RM_ACT_ITEM t
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM T_RM_ACT_ITEM t
- </sql>
- <sql id="where">
- <where>
- <if test="itemname != null and itemname != ''">
- and ITEMNAME LIKE '%${itemname}%'
- </if>
- <if test="itemdesc != null and itemdesc != ''">
- and ITEMDESC = #{itemdesc}
- </if>
- <if test="itemtype != null and itemtype != ''">
- and ITEMTYPE = #{itemtype}
- </if>
- <if test="propertyid != null and propertyid != ''">
- and PROPERTYID = #{propertyid}
- </if>
- <if test="workprocid != null and workprocid != ''">
- and WORKPROCID = #{workprocid}
- </if>
- <if test="energyid != null and energyid != ''">
- and ENERGYID = #{energyid}
- </if>
- <if test="unitid != null and unitid != ''">
- and UNITID = #{unitid}
- </if>
- <if test="useflag != null and useflag != ''">
- and USEFLAG = #{useflag}
- </if>
- <if test="issettle != null and issettle != ''">
- and ISSETTLE = #{issettle}
- </if>
- <if test="digits != null">
- and DIGITS = #{digits}
- </if>
- <if test="state != null and state != ''">
- and STATE = #{state}
- </if>
- <if test="clock != null and clock != ''">
- and CLOCK = #{clock}
- </if>
- <if test="userid != null and userid != ''">
- and USERID = #{userid}
- </if>
- <if test="modificationtime != null and modificationtime != ''">
- and MODIFICATIONTIME = #{modificationtime}
- </if>
- <if test="defaultvalue != null">
- and DEFAULTVALUE = #{defaultvalue}
- </if>
- <if test="showno != null">
- and SHOWNO = #{showno}
- </if>
- <if test="isup != null and isup != ''">
- and ISUP = #{isup}
- </if>
- <if test="fid != null and fid != ''">
- and FID = #{fid}
- </if>
- <if test="associateid != null and associateid != ''">
- and ASSOCIATEID = #{associateid}
- </if>
- <if test="defaulman != null and defaulman != ''">
- and DEFAULMAN = #{defaulman}
- </if>
- <if test="mintimegranid != null and mintimegranid != ''">
- and MINTIMEGRANID = #{mintimegranid}
- </if>
- <if test="seqno != null">
- and SEQNO = #{seqno}
- </if>
- <if test="bz != null and bz != ''">
- and BZ = #{bz}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="itemid != null and itemid != ''">
- and t.ITEMID in (${itemid})
- </if>
- <if test="itemname != null and itemname != ''">
- and t.ITEMNAME LIKE '%${itemname}%'
- </if>
- <if test="itemdesc != null and itemdesc != ''">
- and t.ITEMDESC LIKE '%${itemdesc}%'
- </if>
- <if test="itemtype != null and itemtype != ''">
- and t.ITEMTYPE LIKE '%${itemtype}%'
- </if>
- <if test="propertyid != null and propertyid != ''">
- ${propertyid}
- </if>
- <if test="workprocid != null and workprocid != ''">
- ${workprocid}
- </if>
- <if test="energyid != null and energyid != ''">
- ${energyid}
- </if>
- <if test="unitid != null and unitid != ''">
- and t.UNITID LIKE '%${unitid}%'
- </if>
- <if test="useflag != null and useflag != ''">
- and t.USEFLAG =#{useflag}
- </if>
- <if test="seqno != null">
- and t.SEQNO LIKE '%${seqno}%'
- </if>
- <if test="issettle != null and issettle != ''">
- and t.ISSETTLE LIKE '%${issettle}%'
- </if>
- <if test="digits != null">
- and t.DIGITS = #{digits}
- </if>
- <if test="state !=null and state !='' ">
- and t.STATE =#{state}
- </if>
- <if test="defaultvalue != null">
- and t.DEFAULTVALUE = #{defaultvalue}
- </if>
- <if test="mintimegranid !=null and mintimegranid !='' ">
- and t.MINTIMEGRANID =#{mintimegranid}
- </if>
- <if test="bz !=null and bz !='' ">
- and t.BZ LIKE '%${bz}%'
- </if>
- <if test="fid != null and fid !='' ">
- and (t.FID = #{fid} or t.ITEMID = #{fid})
- </if>
- <if test="measureid != null and measureid != ''">
- and exists
- (select id from FORMULA where sourcecode like '%[${measureid}]%' and code = t.itemid)
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from T_RM_ACT_ITEM
- where ITEMID = #{itemid,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from T_RM_ACT_ITEM
- where 1!=1
- <if test="itemname != null and itemname != ''">
- or ITEMNAME = #{itemname}
- </if>
- <if test="itemdesc != null and itemdesc != ''">
- or ITEMDESC = #{itemdesc}
- </if>
- <if test="itemtype != null and itemtype != ''">
- or ITEMTYPE = #{itemtype}
- </if>
- <if test="propertyid != null and propertyid != ''">
- or PROPERTYID = #{propertyid}
- </if>
- <if test="workprocid != null and workprocid != ''">
- or WORKPROCID = #{workprocid}
- </if>
- <if test="energyid != null and energyid != ''">
- or ENERGYID = #{energyid}
- </if>
- <if test="unitid != null and unitid != ''">
- or UNITID = #{unitid}
- </if>
- <if test="useflag != null and useflag != ''">
- or USEFLAG = #{useflag}
- </if>
- <if test="issettle != null and issettle != ''">
- or ISSETTLE = #{issettle}
- </if>
- <if test="digits != null">
- or DIGITS = #{digits}
- </if>
- <if test="state != null and state != ''">
- or STATE = #{state}
- </if>
- <if test="clock != null and clock != ''">
- or CLOCK = #{clock}
- </if>
- <if test="userid != null and userid != ''">
- or USERID = #{userid}
- </if>
- <if test="modificationtime != null and modificationtime != ''">
- or MODIFICATIONTIME = #{modificationtime}
- </if>
- <if test="defaultvalue != null">
- or DEFAULTVALUE = #{defaultvalue}
- </if>
- <if test="showno != null">
- or SHOWNO = #{showno}
- </if>
- <if test="isup != null and isup != ''">
- or ISUP = #{isup}
- </if>
- <if test="fid != null and fid != ''">
- or FID = #{fid}
- </if>
- <if test="associateid != null and associateid != ''">
- or ASSOCIATEID = #{associateid}
- </if>
- <if test="defaulman != null and defaulman != ''">
- or DEFAULMAN = #{defaulman}
- </if>
- <if test="mintimegranid != null and mintimegranid != ''">
- or MINTIMEGRANID = #{mintimegranid}
- </if>
- <if test="seqno != null">
- or SEQNO = #{seqno}
- </if>
- <if test="bz != null and bz != ''">
- or BZ = #{bz}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.ems.trmactitem.model.TRmActItem">
- insert into T_RM_ACT_ITEM (ITEMID, ITEMNAME, ITEMDESC,
- ITEMTYPE, PROPERTYID, WORKPROCID,
- ENERGYID, UNITID, USEFLAG,
- ISSETTLE, DIGITS, STATE,
- CLOCK, USERID, MODIFICATIONTIME,
- DEFAULTVALUE, SHOWNO, ISUP,
- FID, ASSOCIATEID, DEFAULMAN,
- MINTIMEGRANID, SEQNO, BZ
- )
- values (#{itemid,jdbcType=VARCHAR}, #{itemname,jdbcType=VARCHAR}, #{itemdesc,jdbcType=VARCHAR},
- #{itemtype,jdbcType=VARCHAR}, #{propertyid,jdbcType=VARCHAR}, #{workprocid,jdbcType=VARCHAR},
- #{energyid,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, #{useflag,jdbcType=VARCHAR},
- #{issettle,jdbcType=VARCHAR}, #{digits,jdbcType=DECIMAL}, #{state,jdbcType=VARCHAR},
- #{clock,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, #{modificationtime,jdbcType=VARCHAR},
- #{defaultvalue,jdbcType=DECIMAL}, #{showno,jdbcType=DECIMAL}, #{isup,jdbcType=VARCHAR},
- #{fid,jdbcType=VARCHAR}, #{associateid,jdbcType=VARCHAR}, #{defaulman,jdbcType=VARCHAR},
- #{mintimegranid,jdbcType=VARCHAR}, #{seqno,jdbcType=DECIMAL}, #{bz,jdbcType=VARCHAR}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.ems.trmactitem.model.TRmActItem">
- insert into T_RM_ACT_ITEM
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="itemid != null">
- ITEMID,
- </if>
- <if test="itemname != null">
- ITEMNAME,
- </if>
- <if test="itemdesc != null">
- ITEMDESC,
- </if>
- <if test="itemtype != null">
- ITEMTYPE,
- </if>
- <if test="propertyid != null">
- PROPERTYID,
- </if>
- <if test="workprocid != null">
- WORKPROCID,
- </if>
- <if test="energyid != null">
- ENERGYID,
- </if>
- <if test="unitid != null">
- UNITID,
- </if>
- <if test="useflag != null">
- USEFLAG,
- </if>
- <if test="issettle != null">
- ISSETTLE,
- </if>
- <if test="digits != null">
- DIGITS,
- </if>
- <if test="state != null">
- STATE,
- </if>
- <if test="clock != null">
- CLOCK,
- </if>
- <if test="userid != null">
- USERID,
- </if>
- <if test="modificationtime != null">
- MODIFICATIONTIME,
- </if>
- <if test="defaultvalue != null">
- DEFAULTVALUE,
- </if>
- <if test="showno != null">
- SHOWNO,
- </if>
- <if test="isup != null">
- ISUP,
- </if>
- <if test="fid != null">
- FID,
- </if>
- <if test="associateid != null">
- ASSOCIATEID,
- </if>
- <if test="defaulman != null">
- DEFAULMAN,
- </if>
- <if test="mintimegranid != null">
- MINTIMEGRANID,
- </if>
- <if test="seqno != null">
- SEQNO,
- </if>
- <if test="bz != null">
- BZ,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="itemid != null">
- #{itemid,jdbcType=VARCHAR},
- </if>
- <if test="itemname != null">
- #{itemname,jdbcType=VARCHAR},
- </if>
- <if test="itemdesc != null">
- #{itemdesc,jdbcType=VARCHAR},
- </if>
- <if test="itemtype != null">
- #{itemtype,jdbcType=VARCHAR},
- </if>
- <if test="propertyid != null">
- #{propertyid,jdbcType=VARCHAR},
- </if>
- <if test="workprocid != null">
- #{workprocid,jdbcType=VARCHAR},
- </if>
- <if test="energyid != null">
- #{energyid,jdbcType=VARCHAR},
- </if>
- <if test="unitid != null">
- #{unitid,jdbcType=VARCHAR},
- </if>
- <if test="useflag != null">
- #{useflag,jdbcType=VARCHAR},
- </if>
- <if test="issettle != null">
- #{issettle,jdbcType=VARCHAR},
- </if>
- <if test="digits != null">
- #{digits,jdbcType=DECIMAL},
- </if>
- <if test="state != null">
- #{state,jdbcType=VARCHAR},
- </if>
- <if test="clock != null">
- #{clock,jdbcType=VARCHAR},
- </if>
- <if test="userid != null">
- #{userid,jdbcType=VARCHAR},
- </if>
- <if test="modificationtime != null">
- #{modificationtime,jdbcType=VARCHAR},
- </if>
- <if test="defaultvalue != null">
- #{defaultvalue,jdbcType=DECIMAL},
- </if>
- <if test="showno != null">
- #{showno,jdbcType=DECIMAL},
- </if>
- <if test="isup != null">
- #{isup,jdbcType=VARCHAR},
- </if>
- <if test="fid != null">
- #{fid,jdbcType=VARCHAR},
- </if>
- <if test="associateid != null">
- #{associateid,jdbcType=VARCHAR},
- </if>
- <if test="defaulman != null">
- #{defaulman,jdbcType=VARCHAR},
- </if>
- <if test="mintimegranid != null">
- #{mintimegranid,jdbcType=VARCHAR},
- </if>
- <if test="seqno != null">
- #{seqno,jdbcType=DECIMAL},
- </if>
- <if test="bz != null">
- #{bz,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.trmactitem.model.TRmActItem">
- update T_RM_ACT_ITEM
- set ITEMNAME = #{itemname,jdbcType=VARCHAR},
- ITEMDESC = #{itemdesc,jdbcType=VARCHAR},
- ITEMTYPE = #{itemtype,jdbcType=VARCHAR},
- PROPERTYID = #{propertyid,jdbcType=VARCHAR},
- WORKPROCID = #{workprocid,jdbcType=VARCHAR},
- ENERGYID = #{energyid,jdbcType=VARCHAR},
- UNITID = #{unitid,jdbcType=VARCHAR},
- USEFLAG = #{useflag,jdbcType=VARCHAR},
- ISSETTLE = #{issettle,jdbcType=VARCHAR},
- DIGITS = #{digits,jdbcType=DECIMAL},
- STATE = #{state,jdbcType=VARCHAR},
- CLOCK = #{clock,jdbcType=VARCHAR},
- USERID = #{userid,jdbcType=VARCHAR},
- MODIFICATIONTIME = #{modificationtime,jdbcType=VARCHAR},
- DEFAULTVALUE = #{defaultvalue,jdbcType=DECIMAL},
- SHOWNO = #{showno,jdbcType=DECIMAL},
- ISUP = #{isup,jdbcType=VARCHAR},
- FID = #{fid,jdbcType=VARCHAR},
- ASSOCIATEID = #{associateid,jdbcType=VARCHAR},
- DEFAULMAN = #{defaulman,jdbcType=VARCHAR},
- MINTIMEGRANID = #{mintimegranid,jdbcType=VARCHAR},
- SEQNO = #{seqno,jdbcType=DECIMAL},
- BZ = #{bz,jdbcType=VARCHAR}
- where ITEMID = #{itemid,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.trmactitem.model.TRmActItem">
- update T_RM_ACT_ITEM
- <set>
- <if test="itemname != null">
- ITEMNAME = #{itemname,jdbcType=VARCHAR},
- </if>
- <if test="itemdesc != null">
- ITEMDESC = #{itemdesc,jdbcType=VARCHAR},
- </if>
- <if test="itemtype != null">
- ITEMTYPE = #{itemtype,jdbcType=VARCHAR},
- </if>
- <if test="propertyid != null">
- PROPERTYID = #{propertyid,jdbcType=VARCHAR},
- </if>
- <if test="workprocid != null">
- WORKPROCID = #{workprocid,jdbcType=VARCHAR},
- </if>
- <if test="energyid != null">
- ENERGYID = #{energyid,jdbcType=VARCHAR},
- </if>
- <if test="unitid != null">
- UNITID = #{unitid,jdbcType=VARCHAR},
- </if>
- <if test="useflag != null">
- USEFLAG = #{useflag,jdbcType=VARCHAR},
- </if>
- <if test="issettle != null">
- ISSETTLE = #{issettle,jdbcType=VARCHAR},
- </if>
- <if test="digits != null">
- DIGITS = #{digits,jdbcType=DECIMAL},
- </if>
- <if test="state != null">
- STATE = #{state,jdbcType=VARCHAR},
- </if>
- <if test="clock != null">
- CLOCK = #{clock,jdbcType=VARCHAR},
- </if>
- <if test="userid != null">
- USERID = #{userid,jdbcType=VARCHAR},
- </if>
- <if test="modificationtime != null">
- MODIFICATIONTIME = #{modificationtime,jdbcType=VARCHAR},
- </if>
- <if test="defaultvalue != null">
- DEFAULTVALUE = #{defaultvalue,jdbcType=DECIMAL},
- </if>
- <if test="showno != null">
- SHOWNO = #{showno,jdbcType=DECIMAL},
- </if>
- <if test="isup != null">
- ISUP = #{isup,jdbcType=VARCHAR},
- </if>
- <if test="fid != null">
- FID = #{fid,jdbcType=VARCHAR},
- </if>
- <if test="associateid != null">
- ASSOCIATEID = #{associateid,jdbcType=VARCHAR},
- </if>
- <if test="defaulman != null">
- DEFAULMAN = #{defaulman,jdbcType=VARCHAR},
- </if>
- <if test="mintimegranid != null">
- MINTIMEGRANID = #{mintimegranid,jdbcType=VARCHAR},
- </if>
- <if test="seqno != null">
- SEQNO = #{seqno,jdbcType=DECIMAL},
- </if>
- <if test="bz != null">
- BZ = #{bz,jdbcType=VARCHAR},
- </if>
- </set>
- where ITEMID = #{itemid,jdbcType=VARCHAR}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- <include refid="select"/>
- where ITEMID = #{itemid,jdbcType=VARCHAR}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="where"/>
- order by showno
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="whereLike"/>
- order by showno
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into T_RM_ACT_ITEM
- (ITEMID,
- ITEMNAME, ITEMDESC, ITEMTYPE,
- PROPERTYID, WORKPROCID, ENERGYID,
- UNITID, USEFLAG, ISSETTLE,
- DIGITS, STATE, CLOCK,
- USERID, MODIFICATIONTIME, DEFAULTVALUE,
- SHOWNO, ISUP, FID,
- ASSOCIATEID, DEFAULMAN, MINTIMEGRANID,
- SEQNO, BZ)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.itemid,jdbcType=VARCHAR},
- #{item.itemname,jdbcType=VARCHAR}, #{item.itemdesc,jdbcType=VARCHAR}, #{item.itemtype,jdbcType=VARCHAR},
- #{item.propertyid,jdbcType=VARCHAR}, #{item.workprocid,jdbcType=VARCHAR}, #{item.energyid,jdbcType=VARCHAR},
- #{item.unitid,jdbcType=VARCHAR}, #{item.useflag,jdbcType=VARCHAR}, #{item.issettle,jdbcType=VARCHAR},
- #{item.digits,jdbcType=DECIMAL}, #{item.state,jdbcType=VARCHAR}, #{item.clock,jdbcType=VARCHAR},
- #{item.userid,jdbcType=VARCHAR}, #{item.modificationtime,jdbcType=VARCHAR}, #{item.defaultvalue,jdbcType=DECIMAL},
- #{item.showno,jdbcType=DECIMAL}, #{item.isup,jdbcType=VARCHAR}, #{item.fid,jdbcType=VARCHAR},
- #{item.associateid,jdbcType=VARCHAR}, #{item.defaulman,jdbcType=VARCHAR}, #{item.mintimegranid,jdbcType=VARCHAR},
- #{item.seqno,jdbcType=DECIMAL}, #{item.bz,jdbcType=VARCHAR} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update T_RM_ACT_ITEM
- set
- ITEMID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.itemid,jdbcType=VARCHAR}
- </foreach>
- ,ITEMNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.itemname,jdbcType=VARCHAR}
- </foreach>
- ,ITEMDESC=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.itemdesc,jdbcType=VARCHAR}
- </foreach>
- ,ITEMTYPE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.itemtype,jdbcType=VARCHAR}
- </foreach>
- ,PROPERTYID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.propertyid,jdbcType=VARCHAR}
- </foreach>
- ,WORKPROCID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.workprocid,jdbcType=VARCHAR}
- </foreach>
- ,ENERGYID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.energyid,jdbcType=VARCHAR}
- </foreach>
- ,UNITID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.unitid,jdbcType=VARCHAR}
- </foreach>
- ,USEFLAG=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.useflag,jdbcType=VARCHAR}
- </foreach>
- ,ISSETTLE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.issettle,jdbcType=VARCHAR}
- </foreach>
- ,DIGITS=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.digits,jdbcType=DECIMAL}
- </foreach>
- ,STATE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.state,jdbcType=VARCHAR}
- </foreach>
- ,CLOCK=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.clock,jdbcType=VARCHAR}
- </foreach>
- ,USERID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.userid,jdbcType=VARCHAR}
- </foreach>
- ,MODIFICATIONTIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.modificationtime,jdbcType=VARCHAR}
- </foreach>
- ,DEFAULTVALUE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.defaultvalue,jdbcType=DECIMAL}
- </foreach>
- ,SHOWNO=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.showno,jdbcType=DECIMAL}
- </foreach>
- ,ISUP=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.isup,jdbcType=VARCHAR}
- </foreach>
- ,FID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.fid,jdbcType=VARCHAR}
- </foreach>
- ,ASSOCIATEID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.associateid,jdbcType=VARCHAR}
- </foreach>
- ,DEFAULMAN=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.defaulman,jdbcType=VARCHAR}
- </foreach>
- ,MINTIMEGRANID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.mintimegranid,jdbcType=VARCHAR}
- </foreach>
- ,SEQNO=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.seqno,jdbcType=DECIMAL}
- </foreach>
- ,BZ=
- <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
- when #{item.itemid,jdbcType=VARCHAR} then #{item.bz,jdbcType=VARCHAR}
- </foreach>
- where ITEMID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.itemid,jdbcType=VARCHAR}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from T_RM_ACT_ITEM
- where ITEMID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!--查询下拉框-->
- <select id="getIdAndName" parameterType="string" resultMap="BaseResultMap">
- SELECT ITEMNAME,ITEMID FROM T_RM_ACT_ITEM
- <where>
- <if test="itemtype != null and itemtype != ''">
- and ITEMTYPE = #{itemtype}
- </if>
- </where>
- ORDER BY ITEMNAME
- </select>
- <!--供需项目数据维护结果区-->
- <select id="getActitemDetalts" parameterType="java.util.HashMap" resultType = "Map">
- SELECT * FROM VM_ACTITEM_DETAILTS t
- <where>
- <if test="timegranid != null and timegranid !=''">
- AND t.timegranid=#{timegranid}
- </if>
- <if test="clock != null and clock != ''">
- and t.CLOCK >= #{clock}
- </if>
- <if test="clocke != null and clocke != ''">
- and t.CLOCK <= #{clocke}
- </if>
- <if test="workprocid != null and workprocid!='' ">
- AND workprocid in (${workprocid})
- </if>
- <if test="energyid!=null and energyid!='' ">
- AND energyid in (${energyid})
- </if>
- <if test="energytypeid!=null and energytypeid!='' ">
- AND energytypeid in (${energytypeid})
- </if>
- <if test="propertyid != null and propertyid !='' ">
- AND propertyid in (${propertyid})
- </if>
- <if test="itemid != null and itemid !='' ">
- AND t.itemid in (${itemid})
- </if>
- <if test="itemname !=null and itemname !='' ">
- AND t.itemname LIKE '%${itemname}%'
- </if>
- <if test="itemdesc != null and itemdesc != ''">
- and t.itemdesc like '%${itemdesc}%'
- </if>
- <if test="issettle != null and issettle != ''">
- and t.issettle = ${issettle}
- </if>
- <if test="measureid != null and measureid != ''">
- and exists
- (select id from FORMULA where sourcecode like '%[${measureid}]%' and code = t.itemid)
- </if>
- </where>
- order by t.clock desc,t.seqno
- </select>
- <!--查询计划项目维护结果区-->
- <select id="getPlanitemDetalts" parameterType="java.util.HashMap" resultType="Map">
- SELECT * from VM_PLANITEM_DETAIL
- <where>
- <if test="timegranid != null and timegranid !=''">
- AND timegranid=#{timegranid}
- </if>
- <if test="clock !=null and clock!='' ">
- AND clock =#{clock}
- </if>
- <if test="workprocid != null and workprocid!='' ">
- AND workprocid in (${workprocid})
- </if>
- <if test="energyid!=null and energyid!='' ">
- AND energyid in (${energyid})
- </if>
- <if test="propertyid != null and propertyid !='' ">
- AND propertyid in (${propertyid})
- </if>
- <if test="itemid != null and itemid !='' ">
- AND itemid LIKE #{itemid}
- </if>
- <if test="itemname !=null and itemname !='' ">
- AND itemname LIKE #{itemname}
- </if>
- <if test="state != null and state !=''">
- AND STATE =#{state,jdbcType=VARCHAR}
- </if>
- <if test="clock != null and clock !='' ">
- AND CLOCK=#{clock,jdbcType=VARCHAR}
- </if>
- <if test="userid != null and userid!='' ">
- AND USERID=#{userid,jdbcType=VARCHAR}
- </if>
- <if test="modificationtime != null and modificationtime != '' ">
- AND MODIFICATIONTIME=#{modificationtime,jdbcType=VARCHAR}
- </if>
- <if test="defaultvalue != null">
- and DEFAULTVALUE = #{defaultvalue}
- </if>
- </where>
- order by workprocid
- </select>
- <!--实绩项目维护定时任务查询-->
- <select id="getforsj" resultMap="BaseResultMap" parameterType="string">
- SELECT ITEMID,DIGITS, energyid,workprocid FROM T_RM_ACT_ITEM WHERE USEFLAG='1' and itemtype='R'
- <if test="mintimegranid != null and mintimegranid !=''">
- and MINTIMEGRANID=#{mintimegranid}
- </if>
- order by seqno
- </select>
- <!-- 项目定时任务查询 -->
- <select id="getitems" resultMap="BaseResultMap" parameterType="string">
- SELECT ITEMID,DIGITS, energyid,workprocid,MINTIMEGRANID FROM T_RM_ACT_ITEM
- <where>
- <if test="itemtype !=null and itemtype!=''">
- AND ITEMTYPE = #{itemtype}
- </if>
- AND USEFLAG='1'
- </where>
- order by seqno
- </select>
-
- <!-- 获取实绩项目信息,按seqno排序 -->
- <select id="selectActr" resultMap="BaseResultMap" parameterType="java.util.HashMap">
- select ITEMID, ITEMNAME, ITEMDESC, ITEMTYPE, PROPERTYID, WORKPROCID, ENERGYID, UNITID,
- USEFLAG, SEQNO, ISSETTLE, DIGITS,STATE,CLOCK,USERID,MODIFICATIONTIME,DEFAULTVALUE, FID,
- DEFAULMAN,MINTIMEGRANID, ISUP
- from T_RM_ACT_ITEM
- <where>
- <if test="itemid != null and itemid!= ''">
- and ITEMID in (${itemid})
- </if>
- <if test="itemname != null and itemname != ''">
- and ITEMNAME LIKE '%${itemname}%'
- </if>
- <if test="itemdesc != null and itemdesc != ''">
- and ITEMDESC = #{itemdesc}
- </if>
- <if test="propertyid != null and propertyid != ''">
- and PROPERTYID in (${propertyid})
- </if>
- <if test="workprocid != null and workprocid != ''">
- and WORKPROCID in (${workprocid})
- </if>
- <if test="energyid != null and energyid != ''">
- and ENERGYID in (${energyid})
- </if>
- <if test="unitid != null and unitid != ''">
- and UNITID = #{unitid}
- </if>
- <if test="fid != null and fid != ''">
- and FID = #{fid}
- </if>
- <if test="useflag != null and useflag != ''">
- and USEFLAG = #{useflag}
- </if>
- <if test="seqno != null">
- and SEQNO = #{seqno}
- </if>
- <if test="issettle != null and issettle != ''">
- and ISSETTLE = #{issettle}
- </if>
- <if test="digits != null">
- and DIGITS = #{digits}
- </if>
- <if test="defaultvalue != null">
- and DEFAULTVALUE = #{defaultvalue}
- </if>
- <if test="mintimegranid != null and mintimegranid != ''">
- and MINTIMEGRANID = #{mintimegranid}
- </if>
- <if test="itemtype != null and itemtype != ''">
- and ITEMTYPE = #{itemtype}
- </if>
- <if test="measureid != null and measureid != ''">
- and exists
- (select id from FORMULA where sourcecode like '%[${measureid}]%' and code = itemid)
- </if>
- AND USEFLAG='1'
- </where>
- order by seqno
- </select>
-
- <!--供需项目数据维护结果区-->
- <select id="getBalanceData" parameterType="java.util.HashMap" resultType = "Map">
- SELECT t.*, r.apportvalue rav FROM VM_BALANCEITEM_DETAIL t left join VM_ACTITEM_DETAILTS r
- on t.clock = r.clock and t.energyid = r.energyid and t.timegranid = r.timegranid
- and t.propertyid = r.propertyid and t.workprocid = r.workprocid
- <where>
- <if test="timegranid != null and timegranid !=''">
- AND t.timegranid=#{timegranid}
- </if>
- <if test="clock != null and clock != ''">
- and t.CLOCK >= #{clock}
- </if>
- <if test="clocke != null and clocke != ''">
- and t.CLOCK <= #{clocke}
- </if>
- <if test="propertyid != null and propertyid != ''">
- and t.PROPERTYID in (${propertyid})
- </if>
- <if test="workprocid != null and workprocid != ''">
- and t.WORKPROCID in (${workprocid})
- </if>
- <if test="energyid != null and energyid != ''">
- and t.ENERGYID in (${energyid})
- </if>
- <if test="itemid != null and itemid !='' ">
- and t.itemid in (${itemid})
- </if>
- <if test="itemname !=null and itemname !='' ">
- AND t.itemname LIKE '%${itemname}%'
- </if>
- <if test="itemdesc != null and itemdesc != ''">
- and t.itemdesc like '%${itemdesc}%'
- </if>
- <if test="measureid != null and measureid != ''">
- and exists
- (select id from FORMULA where sourcecode like '%[${measureid}]%' and code = t.itemid)
- </if>
- </where>
- order by t.clock desc,t.seqno
- </select>
-
- <select id="queryLikew" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select_alias"/>
- left join T_RM_WORKPROC w on t.workprocid = w.id
- <include refid="whereLike"/>
- order by w.seqno, t.showno
- </select>
-
- <select id="queryLikef" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select_alias"/>
- left join T_RM_WORKPROC w on t.workprocid = w.id
- <include refid="whereLike"/>
- order by w.seqno, t.showno
- </select>
-
- <!-- 上报关联产量查询 -->
- <select id="getProItems" resultType = "Map">
- select substr(it,0, instr(it||'/','/')-1) itemid,substr(it,instr(it||'/','/')) rate from
- (select distinct(fid) it from T_RM_ACT_ITEM where itemtype='W' and fid is not null and useflag='1' and state='1')
- </select>
-
- <!-- 上报关联能耗查询 -->
- <select id="getAssItems" resultType = "Map">
- select substr(it,0, instr(it||'/','/')-1) itemid,substr(it,instr(it||'/','/')) rate from
- (select distinct(associateid) it from T_RM_ACT_ITEM where itemtype='W' and associateid is not null and useflag='1')
- </select>
-
- <!-- 获取上报关联产量列表 -->
- <select id="listpv" parameterType="java.util.HashMap" resultType = "Map">
- select t.clock,t.timegranid,t.apportvalue, apportvalue,p.itemname,t.itemid,p.workprocid,
- pt.name pname,
- p.unitid,
- p.rtpitemid,
- t.bz2 as bz,
- t.qrtime as uptime,
- t.qrman as upuser,
- t.rtpvalue as productwvalue
- from T_RM_WORKPROC_PRODUCT_VALUE t inner join T_RM_WORKPROC_PRODUCT p on t.itemid = p.itemid
- inner join T_RM_PRODUCT pt on pt.id = p.productid
- where t.timegranid = 'MONTH' and t.itemid in (${cpid})
- <if test="clock != null and clock != ''">
- and t.CLOCK >= #{clock}
- </if>
- <if test="clocke != null and clocke != ''">
- and t.CLOCK <= #{clocke}
- </if>
- <if test="pname !=null and pname !='' ">
- and pt.name LIKE '%${pname}%'
- </if>
- <if test="itemname !=null and itemname !='' ">
- and p.itemname LIKE '%${itemname}%'
- </if>
- <if test="itemid != null and itemid !='' ">
- and t.itemid like '%${itemid}%'
- </if>
- <if test="workprocid != null and workprocid != ''">
- and p.WORKPROCID in (${workprocid})
- </if>
- <if test="rtpitemid != null and rtpitemid != ''">
- and p.RTPITEMID in (${rtpitemid})
- </if>
- <if test="state != null and state != ''">
- <if test="state == '0'.toString()">
- and t.rtpvalue is null
- </if>
- <if test="state == '1'.toString()">
- and t.rtpvalue is not null
- </if>
- </if>
- order by clock desc,p.workprocid
- </select>
- </mapper>
|