<?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.trmdwvalue.mapper.TRmDwValueMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.ems.trmdwvalue.model.TRmDwValue">
    <id column="CLOCK" jdbcType="VARCHAR" property="clock" />
    <id column="ITEMID" jdbcType="VARCHAR" property="itemid" />
    <id column="TIMEGRANID" jdbcType="VARCHAR" property="timegranid" />
    <result column="PRODUCTVALUE" jdbcType="DECIMAL" property="productvalue" />
    <result column="APPORTVALUE" jdbcType="DECIMAL" property="apportvalue" />
    <result column="STDVALUE" jdbcType="DECIMAL" property="stdvalue" />
    <result column="UCVALUE" jdbcType="DECIMAL" property="ucvalue" />
    <result column="ISLOCK" jdbcType="VARCHAR" property="islock" />
    <result column="REC_TIME" jdbcType="VARCHAR" property="recTime" />
    <result column="UPTIME" jdbcType="VARCHAR" property="uptime" />
    <result column="UPUSER" jdbcType="VARCHAR" property="upuser" />
    <result column="PRODUCTWVALUE" jdbcType="DECIMAL" property="productwvalue" />
    <result column="CREATEMAN" jdbcType="VARCHAR" property="createman" />
    <result column="APPORTWVALUE" jdbcType="DECIMAL" property="apportwvalue" />
    <result column="UCWVALUE" jdbcType="DECIMAL" property="ucwvalue" />
    <result column="STDWVALUE" jdbcType="DECIMAL" property="stdwvalue" />
    <result column="BZ" jdbcType="VARCHAR" property="bz" />
    <result column="MFUSER" jdbcType="VARCHAR" property="mfuser" />
    <result column="MFTIME" jdbcType="VARCHAR" property="mftime" />
  </resultMap>
  <sql id="columns">
    CLOCK, ITEMID, TIMEGRANID, PRODUCTVALUE, APPORTVALUE, STDVALUE, UCVALUE, ISLOCK, 
    REC_TIME, UPTIME, UPUSER, PRODUCTWVALUE, CREATEMAN, APPORTWVALUE, UCWVALUE, STDWVALUE, 
    BZ, MFUSER, MFTIME
  </sql>
  <sql id="columns_alias">
    t.CLOCK, t.ITEMID, t.TIMEGRANID, t.PRODUCTVALUE, t.APPORTVALUE, t.STDVALUE, t.UCVALUE, 
    t.ISLOCK, t.REC_TIME, t.UPTIME, t.UPUSER, t.PRODUCTWVALUE, t.CREATEMAN, t.APPORTWVALUE, 
    t.UCWVALUE, t.STDWVALUE, t.BZ, t.MFUSER, t.MFTIME
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM T_RM_DW_VALUE
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM T_RM_DW_VALUE t
  </sql>
  <sql id="where">
    <where> 
      <if test="itemid != null and itemid != ''">
        and ITEMID = #{itemid}
      </if>
      <if test="timegranid != null and timegranid != ''">
        and TIMEGRANID = #{timegranid}
      </if>
      <if test="productvalue != null">
        and PRODUCTVALUE = #{productvalue}
      </if>
      <if test="apportvalue != null">
        and APPORTVALUE = #{apportvalue}
      </if>
      <if test="stdvalue != null">
        and STDVALUE = #{stdvalue}
      </if>
      <if test="ucvalue != null">
        and UCVALUE = #{ucvalue}
      </if>
      <if test="islock != null and islock != ''">
        and ISLOCK = #{islock}
      </if>
      <if test="recTime != null and recTime != ''">
        and REC_TIME = #{recTime}
      </if>
      <if test="uptime != null and uptime != ''">
        and UPTIME = #{uptime}
      </if>
      <if test="upuser != null and upuser != ''">
        and UPUSER = #{upuser}
      </if>
      <if test="productwvalue != null">
        and PRODUCTWVALUE = #{productwvalue}
      </if>
      <if test="createman != null and createman != ''">
        and CREATEMAN = #{createman}
      </if>
      <if test="apportwvalue != null">
        and APPORTWVALUE = #{apportwvalue}
      </if>
      <if test="ucwvalue != null">
        and UCWVALUE = #{ucwvalue}
      </if>
      <if test="stdwvalue != null">
        and STDWVALUE = #{stdwvalue}
      </if>
      <if test="bz != null and bz != ''">
        and BZ = #{bz}
      </if>
      <if test="mfuser != null and mfuser != ''">
        and MFUSER = #{mfuser}
      </if>
      <if test="mftime != null and mftime != ''">
        and MFTIME = #{mftime}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where> 
      <if test="itemid != null and itemid != ''">
        and ITEMID LIKE '%${itemid}%'
      </if>
      <if test="timegranid != null and timegranid != ''">
        and TIMEGRANID LIKE '%${timegranid}%'
      </if>
      <if test="productvalue != null">
        and PRODUCTVALUE = #{productvalue}
      </if>
      <if test="apportvalue != null">
        and APPORTVALUE = #{apportvalue}
      </if>
      <if test="stdvalue != null">
        and STDVALUE = #{stdvalue}
      </if>
      <if test="ucvalue != null">
        and UCVALUE = #{ucvalue}
      </if>
      <if test="islock != null and islock != ''">
        and ISLOCK LIKE '%${islock}%'
      </if>
      <if test="recTime != null and recTime != ''">
        and REC_TIME LIKE '%${recTime}%'
      </if>
      <if test="uptime != null and uptime != ''">
        and UPTIME LIKE '%${uptime}%'
      </if>
      <if test="upuser != null and upuser != ''">
        and UPUSER LIKE '%${upuser}%'
      </if>
      <if test="productwvalue != null">
        and PRODUCTWVALUE = #{productwvalue}
      </if>
      <if test="createman != null and createman != ''">
        and CREATEMAN LIKE '%${createman}%'
      </if>
      <if test="apportwvalue != null">
        and APPORTWVALUE = #{apportwvalue}
      </if>
      <if test="ucwvalue != null">
        and UCWVALUE = #{ucwvalue}
      </if>
      <if test="stdwvalue != null">
        and STDWVALUE = #{stdwvalue}
      </if>
      <if test="bz != null and bz != ''">
        and BZ LIKE '%${bz}%'
      </if>
      <if test="mfuser != null and mfuser != ''">
        and MFUSER LIKE '%${mfuser}%'
      </if>
      <if test="mftime != null and mftime != ''">
        and MFTIME LIKE '%${mftime}%'
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="map">
    delete from T_RM_DW_VALUE
    where CLOCK = #{clock,jdbcType=VARCHAR}
      and ITEMID = #{itemid,jdbcType=VARCHAR}
      and TIMEGRANID = #{timegranid,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from T_RM_DW_VALUE
    where 1!=1 
      <if test="itemid != null and itemid != ''">
        or ITEMID = #{itemid}
      </if>
      <if test="timegranid != null and timegranid != ''">
        or TIMEGRANID = #{timegranid}
      </if>
      <if test="productvalue != null">
        or PRODUCTVALUE = #{productvalue}
      </if>
      <if test="apportvalue != null">
        or APPORTVALUE = #{apportvalue}
      </if>
      <if test="stdvalue != null">
        or STDVALUE = #{stdvalue}
      </if>
      <if test="ucvalue != null">
        or UCVALUE = #{ucvalue}
      </if>
      <if test="islock != null and islock != ''">
        or ISLOCK = #{islock}
      </if>
      <if test="recTime != null and recTime != ''">
        or REC_TIME = #{recTime}
      </if>
      <if test="uptime != null and uptime != ''">
        or UPTIME = #{uptime}
      </if>
      <if test="upuser != null and upuser != ''">
        or UPUSER = #{upuser}
      </if>
      <if test="productwvalue != null">
        or PRODUCTWVALUE = #{productwvalue}
      </if>
      <if test="createman != null and createman != ''">
        or CREATEMAN = #{createman}
      </if>
      <if test="apportwvalue != null">
        or APPORTWVALUE = #{apportwvalue}
      </if>
      <if test="ucwvalue != null">
        or UCWVALUE = #{ucwvalue}
      </if>
      <if test="stdwvalue != null">
        or STDWVALUE = #{stdwvalue}
      </if>
      <if test="bz != null and bz != ''">
        or BZ = #{bz}
      </if>
      <if test="mfuser != null and mfuser != ''">
        or MFUSER = #{mfuser}
      </if>
      <if test="mftime != null and mftime != ''">
        or MFTIME = #{mftime}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.ems.trmdwvalue.model.TRmDwValue">
    insert into T_RM_DW_VALUE (CLOCK, ITEMID, TIMEGRANID, 
      PRODUCTVALUE, APPORTVALUE, STDVALUE, 
      UCVALUE, ISLOCK, REC_TIME, 
      UPTIME, UPUSER, PRODUCTWVALUE, 
      CREATEMAN, APPORTWVALUE, UCWVALUE, 
      STDWVALUE, BZ, MFUSER, 
      MFTIME)
    values (#{clock,jdbcType=VARCHAR}, #{itemid,jdbcType=VARCHAR}, #{timegranid,jdbcType=VARCHAR}, 
      #{productvalue,jdbcType=DECIMAL}, #{apportvalue,jdbcType=DECIMAL}, #{stdvalue,jdbcType=DECIMAL}, 
      #{ucvalue,jdbcType=DECIMAL}, #{islock,jdbcType=VARCHAR}, #{recTime,jdbcType=VARCHAR}, 
      #{uptime,jdbcType=VARCHAR}, #{upuser,jdbcType=VARCHAR}, #{productwvalue,jdbcType=DECIMAL}, 
      #{createman,jdbcType=VARCHAR}, #{apportwvalue,jdbcType=DECIMAL}, #{ucwvalue,jdbcType=DECIMAL}, 
      #{stdwvalue,jdbcType=DECIMAL}, #{bz,jdbcType=VARCHAR}, #{mfuser,jdbcType=VARCHAR}, 
      #{mftime,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.ems.trmdwvalue.model.TRmDwValue">
    insert into T_RM_DW_VALUE
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="clock != null">
        CLOCK,
      </if>
      <if test="itemid != null">
        ITEMID,
      </if>
      <if test="timegranid != null">
        TIMEGRANID,
      </if>
      <if test="productvalue != null">
        PRODUCTVALUE,
      </if>
      <if test="apportvalue != null">
        APPORTVALUE,
      </if>
      <if test="stdvalue != null">
        STDVALUE,
      </if>
      <if test="ucvalue != null">
        UCVALUE,
      </if>
      <if test="islock != null">
        ISLOCK,
      </if>
      <if test="recTime != null">
        REC_TIME,
      </if>
      <if test="uptime != null">
        UPTIME,
      </if>
      <if test="upuser != null">
        UPUSER,
      </if>
      <if test="productwvalue != null">
        PRODUCTWVALUE,
      </if>
      <if test="createman != null">
        CREATEMAN,
      </if>
      <if test="apportwvalue != null">
        APPORTWVALUE,
      </if>
      <if test="ucwvalue != null">
        UCWVALUE,
      </if>
      <if test="stdwvalue != null">
        STDWVALUE,
      </if>
      <if test="bz != null">
        BZ,
      </if>
      <if test="mfuser != null">
        MFUSER,
      </if>
      <if test="mftime != null">
        MFTIME,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="clock != null">
        #{clock,jdbcType=VARCHAR},
      </if>
      <if test="itemid != null">
        #{itemid,jdbcType=VARCHAR},
      </if>
      <if test="timegranid != null">
        #{timegranid,jdbcType=VARCHAR},
      </if>
      <if test="productvalue != null">
        #{productvalue,jdbcType=DECIMAL},
      </if>
      <if test="apportvalue != null">
        #{apportvalue,jdbcType=DECIMAL},
      </if>
      <if test="stdvalue != null">
        #{stdvalue,jdbcType=DECIMAL},
      </if>
      <if test="ucvalue != null">
        #{ucvalue,jdbcType=DECIMAL},
      </if>
      <if test="islock != null">
        #{islock,jdbcType=VARCHAR},
      </if>
      <if test="recTime != null">
        #{recTime,jdbcType=VARCHAR},
      </if>
      <if test="uptime != null">
        #{uptime,jdbcType=VARCHAR},
      </if>
      <if test="upuser != null">
        #{upuser,jdbcType=VARCHAR},
      </if>
      <if test="productwvalue != null">
        #{productwvalue,jdbcType=DECIMAL},
      </if>
      <if test="createman != null">
        #{createman,jdbcType=VARCHAR},
      </if>
      <if test="apportwvalue != null">
        #{apportwvalue,jdbcType=DECIMAL},
      </if>
      <if test="ucwvalue != null">
        #{ucwvalue,jdbcType=DECIMAL},
      </if>
      <if test="stdwvalue != null">
        #{stdwvalue,jdbcType=DECIMAL},
      </if>
      <if test="bz != null">
        #{bz,jdbcType=VARCHAR},
      </if>
      <if test="mfuser != null">
        #{mfuser,jdbcType=VARCHAR},
      </if>
      <if test="mftime != null">
        #{mftime,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.trmdwvalue.model.TRmDwValue">
    update T_RM_DW_VALUE
    set PRODUCTVALUE = #{productvalue,jdbcType=DECIMAL},
      APPORTVALUE = #{apportvalue,jdbcType=DECIMAL},
      STDVALUE = #{stdvalue,jdbcType=DECIMAL},
      UCVALUE = #{ucvalue,jdbcType=DECIMAL},
      ISLOCK = #{islock,jdbcType=VARCHAR},
      REC_TIME = #{recTime,jdbcType=VARCHAR},
      UPTIME = #{uptime,jdbcType=VARCHAR},
      UPUSER = #{upuser,jdbcType=VARCHAR},
      PRODUCTWVALUE = #{productwvalue,jdbcType=DECIMAL},
      CREATEMAN = #{createman,jdbcType=VARCHAR},
      APPORTWVALUE = #{apportwvalue,jdbcType=DECIMAL},
      UCWVALUE = #{ucwvalue,jdbcType=DECIMAL},
      STDWVALUE = #{stdwvalue,jdbcType=DECIMAL},
      BZ = #{bz,jdbcType=VARCHAR},
      MFUSER = #{mfuser,jdbcType=VARCHAR},
      MFTIME = #{mftime,jdbcType=VARCHAR}
    where CLOCK = #{clock,jdbcType=VARCHAR}
      and ITEMID = #{itemid,jdbcType=VARCHAR}
      and TIMEGRANID = #{timegranid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.trmdwvalue.model.TRmDwValue">
    update T_RM_DW_VALUE
    <set>
      <if test="productvalue != null">
        PRODUCTVALUE = #{productvalue,jdbcType=DECIMAL},
      </if>
      <if test="apportvalue != null">
        APPORTVALUE = #{apportvalue,jdbcType=DECIMAL},
      </if>
      <if test="stdvalue != null">
        STDVALUE = #{stdvalue,jdbcType=DECIMAL},
      </if>
      <if test="ucvalue != null">
        UCVALUE = #{ucvalue,jdbcType=DECIMAL},
      </if>
      <if test="islock != null">
        ISLOCK = #{islock,jdbcType=VARCHAR},
      </if>
      <if test="recTime != null">
        REC_TIME = #{recTime,jdbcType=VARCHAR},
      </if>
      <if test="uptime != null">
        UPTIME = #{uptime,jdbcType=VARCHAR},
      </if>
      <if test="upuser != null">
        UPUSER = #{upuser,jdbcType=VARCHAR},
      </if>
      <if test="productwvalue != null">
        PRODUCTWVALUE = #{productwvalue,jdbcType=DECIMAL},
      </if>
      <if test="createman != null">
        CREATEMAN = #{createman,jdbcType=VARCHAR},
      </if>
      <if test="apportwvalue != null">
        APPORTWVALUE = #{apportwvalue,jdbcType=DECIMAL},
      </if>
      <if test="ucwvalue != null">
        UCWVALUE = #{ucwvalue,jdbcType=DECIMAL},
      </if>
      <if test="stdwvalue != null">
        STDWVALUE = #{stdwvalue,jdbcType=DECIMAL},
      </if>
      <if test="bz != null">
        BZ = #{bz,jdbcType=VARCHAR},
      </if>
      <if test="mfuser != null">
        MFUSER = #{mfuser,jdbcType=VARCHAR},
      </if>
      <if test="mftime != null">
        MFTIME = #{mftime,jdbcType=VARCHAR},
      </if>
    </set>
    where CLOCK = #{clock,jdbcType=VARCHAR}
      and ITEMID = #{itemid,jdbcType=VARCHAR}
      and TIMEGRANID = #{timegranid,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="map" resultMap="BaseResultMap">
    <include refid="select"/>
    where CLOCK = #{clock,jdbcType=VARCHAR}
      and ITEMID = #{itemid,jdbcType=VARCHAR}
      and TIMEGRANID = #{timegranid,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="where"/>
  </select>
  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="whereLike"/>
  </select>
  <insert id="batchInsert" parameterType="java.util.List">
    insert into T_RM_DW_VALUE 
      (CLOCK, 
      ITEMID, TIMEGRANID, PRODUCTVALUE, 
      APPORTVALUE, STDVALUE, UCVALUE, 
      ISLOCK, REC_TIME, UPTIME, 
      UPUSER, PRODUCTWVALUE, CREATEMAN, 
      APPORTWVALUE, UCWVALUE, STDWVALUE, 
      BZ, MFUSER, MFTIME
      )
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.clock,jdbcType=VARCHAR}, 
      #{item.itemid,jdbcType=VARCHAR}, #{item.timegranid,jdbcType=VARCHAR}, #{item.productvalue,jdbcType=DECIMAL}, 
      #{item.apportvalue,jdbcType=DECIMAL}, #{item.stdvalue,jdbcType=DECIMAL}, #{item.ucvalue,jdbcType=DECIMAL}, 
      #{item.islock,jdbcType=VARCHAR}, #{item.recTime,jdbcType=VARCHAR}, #{item.uptime,jdbcType=VARCHAR}, 
      #{item.upuser,jdbcType=VARCHAR}, #{item.productwvalue,jdbcType=DECIMAL}, #{item.createman,jdbcType=VARCHAR}, 
      #{item.apportwvalue,jdbcType=DECIMAL}, #{item.ucwvalue,jdbcType=DECIMAL}, #{item.stdwvalue,jdbcType=DECIMAL}, 
      #{item.bz,jdbcType=VARCHAR}, #{item.mfuser,jdbcType=VARCHAR}, #{item.mftime,jdbcType=VARCHAR}
       from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update T_RM_DW_VALUE
     set
       CLOCK=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.clock,jdbcType=VARCHAR}
       </foreach>
       ,ITEMID=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.itemid,jdbcType=VARCHAR}
       </foreach>
       ,TIMEGRANID=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.timegranid,jdbcType=VARCHAR}
       </foreach>
       ,PRODUCTVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.productvalue,jdbcType=DECIMAL}
       </foreach>
       ,APPORTVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.apportvalue,jdbcType=DECIMAL}
       </foreach>
       ,STDVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.stdvalue,jdbcType=DECIMAL}
       </foreach>
       ,UCVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.ucvalue,jdbcType=DECIMAL}
       </foreach>
       ,ISLOCK=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.islock,jdbcType=VARCHAR}
       </foreach>
       ,REC_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.recTime,jdbcType=VARCHAR}
       </foreach>
       ,UPTIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.uptime,jdbcType=VARCHAR}
       </foreach>
       ,UPUSER=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.upuser,jdbcType=VARCHAR}
       </foreach>
       ,PRODUCTWVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.productwvalue,jdbcType=DECIMAL}
       </foreach>
       ,CREATEMAN=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.createman,jdbcType=VARCHAR}
       </foreach>
       ,APPORTWVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.apportwvalue,jdbcType=DECIMAL}
       </foreach>
       ,UCWVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.ucwvalue,jdbcType=DECIMAL}
       </foreach>
       ,STDWVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.stdwvalue,jdbcType=DECIMAL}
       </foreach>
       ,BZ=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.bz,jdbcType=VARCHAR}
       </foreach>
       ,MFUSER=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.mfuser,jdbcType=VARCHAR}
       </foreach>
       ,MFTIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.mftime,jdbcType=VARCHAR}
       </foreach>
     where CLOCK in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.clock,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from T_RM_DW_VALUE
    where CLOCK in 
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->
  <!--获取累计值-->
    <select id="getSumvalue" parameterType="java.util.HashMap" resultType="double">
        SELECT nvl(SUM(APPORTVALUE),0) FROM T_RM_DW_VALUE
        <where>
            <if test="itemid !=null and itemid != '' ">
                AND  ITEMID=#{itemid}
            </if>
            <if test="clock !=null and clock !='' ">
                AND   CLOCK LIKE '${clock}%'
            </if>
            <if test="timegranid !=null and timegranid !='' ">
                AND  TIMEGRANID=#{timegranid}
            </if>
        </where>
    </select>
    
    <!-- 上报项目数据维护 -->
    <select id="getProjectwData" parameterType="java.util.HashMap" resultType = "Map">
        select t.*,a.itemname,a.itemdesc,a.workprocid,a.unitid,a.energyid,a.propertyid,a.defaultvalue
        from T_RM_DW_VALUE t 
        inner join T_RM_ACT_ITEM a on t.itemid = a.itemid
        <where>
            <if test="timegranid != null and timegranid !=''">
                AND t.timegranid=#{timegranid}
            </if>
            <if test="clock != null and clock != ''">
                and t.CLOCK &gt;= #{clock}
            </if>
            <if test="clocke != null and clocke != ''">
                and t.CLOCK &lt;= #{clocke}
            </if>
            <if test="propertyid != null and propertyid != ''">
                and a.PROPERTYID in (${propertyid})
            </if>
            <if test="workprocid != null and workprocid != ''">
                and a.WORKPROCID in (${workprocid})
            </if>
            <if test="energyid != null and energyid != ''">
                and a.ENERGYID in (${energyid})
            </if>
            <if test="itemid != null and itemid !='' ">
                and t.itemid in (${itemid})
            </if>
            <if test="itemname !=null and itemname !='' ">
                AND a.itemname LIKE '%${itemname}%'
            </if>
            <if test="itemdesc != null and itemdesc != ''">
               and a.itemdesc like '%${itemdesc}%'
            </if>
            and a.useflag = '1'
        </where>
        order by t.clock desc,a.workprocid,a.showno
    </select>
    
    <!-- 获取数据条数 -->
    <select id="getCount" parameterType="java.util.HashMap" resultType="java.lang.Integer">
        select count(1) from T_RM_DW_VALUE
        <include refid="where"/>
    </select>
</mapper>