<?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.trmplanvalue.mapper.TRmPlanValueMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.ems.trmplanvalue.model.TRmPlanValue">
    <id column="CLOCK" jdbcType="VARCHAR" property="clock" />
    <id column="ITEMID" jdbcType="VARCHAR" property="itemid" />
    <id column="TIMEGRANID" jdbcType="VARCHAR" property="timegranid" />
    <result column="ACTUALVALUE" jdbcType="DECIMAL" property="actualvalue" />
    <result column="CORRECTVALUE" jdbcType="DECIMAL" property="correctvalue" />
    <result column="APPORTVALUE" jdbcType="DECIMAL" property="apportvalue" />
    <result column="STDVALUE" jdbcType="DECIMAL" property="stdvalue" />
    <result column="SUMVALUE" jdbcType="DECIMAL" property="sumvalue" />
    <result column="SUMSTDVALUE" jdbcType="DECIMAL" property="sumstdvalue" />
    <result column="REC_TIME" jdbcType="VARCHAR" property="recTime" />
    <result column="TEAMSORT" jdbcType="VARCHAR" property="teamsort" />
    <result column="MODIFYFLAG" jdbcType="DECIMAL" property="modifyflag" />
    <result column="ISLOCK" jdbcType="VARCHAR" property="islock" />
    <result column="LOCKID" jdbcType="VARCHAR" property="lockid" />
    <result column="CONSUMEVALUE" jdbcType="DECIMAL" property="consumevalue" />
    <result column="UCVALUE" jdbcType="DECIMAL" property="ucvalue" />
    <result column="SUMUCVALUE" jdbcType="DECIMAL" property="sumucvalue" />
    <result column="HH01" jdbcType="DECIMAL" property="hh01" />
    <result column="HH02" jdbcType="DECIMAL" property="hh02" />
    <result column="HH03" jdbcType="DECIMAL" property="hh03" />
    <result column="HH04" jdbcType="DECIMAL" property="hh04" />
    <result column="HH05" jdbcType="DECIMAL" property="hh05" />
    <result column="HH06" jdbcType="DECIMAL" property="hh06" />
    <result column="HH07" jdbcType="DECIMAL" property="hh07" />
    <result column="HH08" jdbcType="DECIMAL" property="hh08" />
    <result column="HH09" jdbcType="DECIMAL" property="hh09" />
    <result column="HH10" jdbcType="DECIMAL" property="hh10" />
    <result column="HH11" jdbcType="DECIMAL" property="hh11" />
    <result column="HH12" jdbcType="DECIMAL" property="hh12" />
    <result column="HH13" jdbcType="DECIMAL" property="hh13" />
    <result column="HH14" jdbcType="DECIMAL" property="hh14" />
    <result column="HH15" jdbcType="DECIMAL" property="hh15" />
    <result column="HH16" jdbcType="DECIMAL" property="hh16" />
    <result column="HH17" jdbcType="DECIMAL" property="hh17" />
    <result column="HH18" jdbcType="DECIMAL" property="hh18" />
    <result column="HH19" jdbcType="DECIMAL" property="hh19" />
    <result column="HH20" jdbcType="DECIMAL" property="hh20" />
    <result column="HH21" jdbcType="DECIMAL" property="hh21" />
    <result column="HH22" jdbcType="DECIMAL" property="hh22" />
    <result column="HH23" jdbcType="DECIMAL" property="hh23" />
    <result column="HH00" jdbcType="DECIMAL" property="hh00" />
    <result column="UPDATE_REASON" jdbcType="VARCHAR" property="updateReason" />
    <result column="USERID" jdbcType="VARCHAR" property="userid" />
    <result column="UPTIME" jdbcType="VARCHAR" property="uptime" />
    <result column="CRMAN" jdbcType="VARCHAR" property="crman" />
  </resultMap>
  <sql id="columns">
    CLOCK, ITEMID, TIMEGRANID, ACTUALVALUE, CORRECTVALUE, APPORTVALUE, STDVALUE, SUMVALUE, 
    SUMSTDVALUE, REC_TIME, TEAMSORT, MODIFYFLAG, ISLOCK, LOCKID, CONSUMEVALUE, UCVALUE, 
    SUMUCVALUE, HH01, HH02, HH03, HH04, HH05, HH06, HH07, HH08, HH09, HH10, HH11, HH12, 
    HH13, HH14, HH15, HH16, HH17, HH18, HH19, HH20, HH21, HH22, HH23, HH00, UPDATE_REASON, 
    USERID, UPTIME, CRMAN
  </sql>
  <sql id="columns_alias">
    t.CLOCK, t.ITEMID, t.TIMEGRANID, t.ACTUALVALUE, t.CORRECTVALUE, t.APPORTVALUE, t.STDVALUE, 
    t.SUMVALUE, t.SUMSTDVALUE, t.REC_TIME, t.TEAMSORT, t.MODIFYFLAG, t.ISLOCK, t.LOCKID, 
    t.CONSUMEVALUE, t.UCVALUE, t.SUMUCVALUE, t.HH01, t.HH02, t.HH03, t.HH04, t.HH05, 
    t.HH06, t.HH07, t.HH08, t.HH09, t.HH10, t.HH11, t.HH12, t.HH13, t.HH14, t.HH15, t.HH16, 
    t.HH17, t.HH18, t.HH19, t.HH20, t.HH21, t.HH22, t.HH23, t.HH00, t.UPDATE_REASON, 
    t.USERID, t.UPTIME, t.CRMAN
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM T_RM_PLAN_VALUE
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM T_RM_PLAN_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="actualvalue != null">
        and ACTUALVALUE = #{actualvalue}
      </if>
      <if test="correctvalue != null">
        and CORRECTVALUE = #{correctvalue}
      </if>
      <if test="apportvalue != null">
        and APPORTVALUE = #{apportvalue}
      </if>
      <if test="stdvalue != null">
        and STDVALUE = #{stdvalue}
      </if>
      <if test="sumvalue != null">
        and SUMVALUE = #{sumvalue}
      </if>
      <if test="sumstdvalue != null">
        and SUMSTDVALUE = #{sumstdvalue}
      </if>
      <if test="recTime != null and recTime != ''">
        and REC_TIME = #{recTime}
      </if>
      <if test="teamsort != null and teamsort != ''">
        and TEAMSORT = #{teamsort}
      </if>
      <if test="modifyflag != null">
        and MODIFYFLAG = #{modifyflag}
      </if>
      <if test="islock != null and islock != ''">
        and ISLOCK = #{islock}
      </if>
      <if test="lockid != null and lockid != ''">
        and LOCKID = #{lockid}
      </if>
      <if test="consumevalue != null">
        and CONSUMEVALUE = #{consumevalue}
      </if>
      <if test="ucvalue != null">
        and UCVALUE = #{ucvalue}
      </if>
      <if test="sumucvalue != null">
        and SUMUCVALUE = #{sumucvalue}
      </if>
      <if test="hh01 != null">
        and HH01 = #{hh01}
      </if>
      <if test="hh02 != null">
        and HH02 = #{hh02}
      </if>
      <if test="hh03 != null">
        and HH03 = #{hh03}
      </if>
      <if test="hh04 != null">
        and HH04 = #{hh04}
      </if>
      <if test="hh05 != null">
        and HH05 = #{hh05}
      </if>
      <if test="hh06 != null">
        and HH06 = #{hh06}
      </if>
      <if test="hh07 != null">
        and HH07 = #{hh07}
      </if>
      <if test="hh08 != null">
        and HH08 = #{hh08}
      </if>
      <if test="hh09 != null">
        and HH09 = #{hh09}
      </if>
      <if test="hh10 != null">
        and HH10 = #{hh10}
      </if>
      <if test="hh11 != null">
        and HH11 = #{hh11}
      </if>
      <if test="hh12 != null">
        and HH12 = #{hh12}
      </if>
      <if test="hh13 != null">
        and HH13 = #{hh13}
      </if>
      <if test="hh14 != null">
        and HH14 = #{hh14}
      </if>
      <if test="hh15 != null">
        and HH15 = #{hh15}
      </if>
      <if test="hh16 != null">
        and HH16 = #{hh16}
      </if>
      <if test="hh17 != null">
        and HH17 = #{hh17}
      </if>
      <if test="hh18 != null">
        and HH18 = #{hh18}
      </if>
      <if test="hh19 != null">
        and HH19 = #{hh19}
      </if>
      <if test="hh20 != null">
        and HH20 = #{hh20}
      </if>
      <if test="hh21 != null">
        and HH21 = #{hh21}
      </if>
      <if test="hh22 != null">
        and HH22 = #{hh22}
      </if>
      <if test="hh23 != null">
        and HH23 = #{hh23}
      </if>
      <if test="hh00 != null">
        and HH00 = #{hh00}
      </if>
      <if test="updateReason != null and updateReason != ''">
        and UPDATE_REASON = #{updateReason}
      </if>
      <if test="userid != null and userid != ''">
        and USERID = #{userid}
      </if>
      <if test="uptime != null and uptime != ''">
        and UPTIME = #{uptime}
      </if>
      <if test="crman != null and crman != ''">
        and CRMAN = #{crman}
      </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="actualvalue != null">
        and ACTUALVALUE = #{actualvalue}
      </if>
      <if test="correctvalue != null">
        and CORRECTVALUE = #{correctvalue}
      </if>
      <if test="apportvalue != null">
        and APPORTVALUE = #{apportvalue}
      </if>
      <if test="stdvalue != null">
        and STDVALUE = #{stdvalue}
      </if>
      <if test="sumvalue != null">
        and SUMVALUE = #{sumvalue}
      </if>
      <if test="sumstdvalue != null">
        and SUMSTDVALUE = #{sumstdvalue}
      </if>
      <if test="recTime != null and recTime != ''">
        and REC_TIME LIKE '%${recTime}%'
      </if>
      <if test="teamsort != null and teamsort != ''">
        and TEAMSORT LIKE '%${teamsort}%'
      </if>
      <if test="modifyflag != null">
        and MODIFYFLAG = #{modifyflag}
      </if>
      <if test="islock != null and islock != ''">
        and ISLOCK LIKE '%${islock}%'
      </if>
      <if test="lockid != null and lockid != ''">
        and LOCKID LIKE '%${lockid}%'
      </if>
      <if test="consumevalue != null">
        and CONSUMEVALUE = #{consumevalue}
      </if>
      <if test="ucvalue != null">
        and UCVALUE = #{ucvalue}
      </if>
      <if test="sumucvalue != null">
        and SUMUCVALUE = #{sumucvalue}
      </if>
      <if test="hh01 != null">
        and HH01 = #{hh01}
      </if>
      <if test="hh02 != null">
        and HH02 = #{hh02}
      </if>
      <if test="hh03 != null">
        and HH03 = #{hh03}
      </if>
      <if test="hh04 != null">
        and HH04 = #{hh04}
      </if>
      <if test="hh05 != null">
        and HH05 = #{hh05}
      </if>
      <if test="hh06 != null">
        and HH06 = #{hh06}
      </if>
      <if test="hh07 != null">
        and HH07 = #{hh07}
      </if>
      <if test="hh08 != null">
        and HH08 = #{hh08}
      </if>
      <if test="hh09 != null">
        and HH09 = #{hh09}
      </if>
      <if test="hh10 != null">
        and HH10 = #{hh10}
      </if>
      <if test="hh11 != null">
        and HH11 = #{hh11}
      </if>
      <if test="hh12 != null">
        and HH12 = #{hh12}
      </if>
      <if test="hh13 != null">
        and HH13 = #{hh13}
      </if>
      <if test="hh14 != null">
        and HH14 = #{hh14}
      </if>
      <if test="hh15 != null">
        and HH15 = #{hh15}
      </if>
      <if test="hh16 != null">
        and HH16 = #{hh16}
      </if>
      <if test="hh17 != null">
        and HH17 = #{hh17}
      </if>
      <if test="hh18 != null">
        and HH18 = #{hh18}
      </if>
      <if test="hh19 != null">
        and HH19 = #{hh19}
      </if>
      <if test="hh20 != null">
        and HH20 = #{hh20}
      </if>
      <if test="hh21 != null">
        and HH21 = #{hh21}
      </if>
      <if test="hh22 != null">
        and HH22 = #{hh22}
      </if>
      <if test="hh23 != null">
        and HH23 = #{hh23}
      </if>
      <if test="hh00 != null">
        and HH00 = #{hh00}
      </if>
      <if test="updateReason != null and updateReason != ''">
        and UPDATE_REASON LIKE '%${updateReason}%'
      </if>
      <if test="userid != null and userid != ''">
        and USERID LIKE '%${userid}%'
      </if>
      <if test="uptime != null and uptime != ''">
        and UPTIME LIKE '%${uptime}%'
      </if>
      <if test="crman != null and crman != ''">
        and CRMAN LIKE '%${crman}%'
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="map">
    delete from T_RM_PLAN_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_PLAN_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="actualvalue != null">
        or ACTUALVALUE = #{actualvalue}
      </if>
      <if test="correctvalue != null">
        or CORRECTVALUE = #{correctvalue}
      </if>
      <if test="apportvalue != null">
        or APPORTVALUE = #{apportvalue}
      </if>
      <if test="stdvalue != null">
        or STDVALUE = #{stdvalue}
      </if>
      <if test="sumvalue != null">
        or SUMVALUE = #{sumvalue}
      </if>
      <if test="sumstdvalue != null">
        or SUMSTDVALUE = #{sumstdvalue}
      </if>
      <if test="recTime != null and recTime != ''">
        or REC_TIME = #{recTime}
      </if>
      <if test="teamsort != null and teamsort != ''">
        or TEAMSORT = #{teamsort}
      </if>
      <if test="modifyflag != null">
        or MODIFYFLAG = #{modifyflag}
      </if>
      <if test="islock != null and islock != ''">
        or ISLOCK = #{islock}
      </if>
      <if test="lockid != null and lockid != ''">
        or LOCKID = #{lockid}
      </if>
      <if test="consumevalue != null">
        or CONSUMEVALUE = #{consumevalue}
      </if>
      <if test="ucvalue != null">
        or UCVALUE = #{ucvalue}
      </if>
      <if test="sumucvalue != null">
        or SUMUCVALUE = #{sumucvalue}
      </if>
      <if test="hh01 != null">
        or HH01 = #{hh01}
      </if>
      <if test="hh02 != null">
        or HH02 = #{hh02}
      </if>
      <if test="hh03 != null">
        or HH03 = #{hh03}
      </if>
      <if test="hh04 != null">
        or HH04 = #{hh04}
      </if>
      <if test="hh05 != null">
        or HH05 = #{hh05}
      </if>
      <if test="hh06 != null">
        or HH06 = #{hh06}
      </if>
      <if test="hh07 != null">
        or HH07 = #{hh07}
      </if>
      <if test="hh08 != null">
        or HH08 = #{hh08}
      </if>
      <if test="hh09 != null">
        or HH09 = #{hh09}
      </if>
      <if test="hh10 != null">
        or HH10 = #{hh10}
      </if>
      <if test="hh11 != null">
        or HH11 = #{hh11}
      </if>
      <if test="hh12 != null">
        or HH12 = #{hh12}
      </if>
      <if test="hh13 != null">
        or HH13 = #{hh13}
      </if>
      <if test="hh14 != null">
        or HH14 = #{hh14}
      </if>
      <if test="hh15 != null">
        or HH15 = #{hh15}
      </if>
      <if test="hh16 != null">
        or HH16 = #{hh16}
      </if>
      <if test="hh17 != null">
        or HH17 = #{hh17}
      </if>
      <if test="hh18 != null">
        or HH18 = #{hh18}
      </if>
      <if test="hh19 != null">
        or HH19 = #{hh19}
      </if>
      <if test="hh20 != null">
        or HH20 = #{hh20}
      </if>
      <if test="hh21 != null">
        or HH21 = #{hh21}
      </if>
      <if test="hh22 != null">
        or HH22 = #{hh22}
      </if>
      <if test="hh23 != null">
        or HH23 = #{hh23}
      </if>
      <if test="hh00 != null">
        or HH00 = #{hh00}
      </if>
      <if test="updateReason != null and updateReason != ''">
        or UPDATE_REASON = #{updateReason}
      </if>
      <if test="userid != null and userid != ''">
        or USERID = #{userid}
      </if>
      <if test="uptime != null and uptime != ''">
        or UPTIME = #{uptime}
      </if>
      <if test="crman != null and crman != ''">
        or CRMAN = #{crman}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.ems.trmplanvalue.model.TRmPlanValue">
    insert into T_RM_PLAN_VALUE (CLOCK, ITEMID, TIMEGRANID, 
      ACTUALVALUE, CORRECTVALUE, APPORTVALUE, 
      STDVALUE, SUMVALUE, SUMSTDVALUE, 
      REC_TIME, TEAMSORT, MODIFYFLAG, 
      ISLOCK, LOCKID, CONSUMEVALUE, 
      UCVALUE, SUMUCVALUE, HH01, 
      HH02, HH03, HH04, HH05, 
      HH06, HH07, HH08, HH09, 
      HH10, HH11, HH12, HH13, 
      HH14, HH15, HH16, HH17, 
      HH18, HH19, HH20, HH21, 
      HH22, HH23, HH00, UPDATE_REASON, 
      USERID, UPTIME, CRMAN
      )
    values (#{clock,jdbcType=VARCHAR}, #{itemid,jdbcType=VARCHAR}, #{timegranid,jdbcType=VARCHAR}, 
      #{actualvalue,jdbcType=DECIMAL}, #{correctvalue,jdbcType=DECIMAL}, #{apportvalue,jdbcType=DECIMAL}, 
      #{stdvalue,jdbcType=DECIMAL}, #{sumvalue,jdbcType=DECIMAL}, #{sumstdvalue,jdbcType=DECIMAL}, 
      #{recTime,jdbcType=VARCHAR}, #{teamsort,jdbcType=VARCHAR}, #{modifyflag,jdbcType=DECIMAL}, 
      #{islock,jdbcType=VARCHAR}, #{lockid,jdbcType=VARCHAR}, #{consumevalue,jdbcType=DECIMAL}, 
      #{ucvalue,jdbcType=DECIMAL}, #{sumucvalue,jdbcType=DECIMAL}, #{hh01,jdbcType=DECIMAL}, 
      #{hh02,jdbcType=DECIMAL}, #{hh03,jdbcType=DECIMAL}, #{hh04,jdbcType=DECIMAL}, #{hh05,jdbcType=DECIMAL}, 
      #{hh06,jdbcType=DECIMAL}, #{hh07,jdbcType=DECIMAL}, #{hh08,jdbcType=DECIMAL}, #{hh09,jdbcType=DECIMAL}, 
      #{hh10,jdbcType=DECIMAL}, #{hh11,jdbcType=DECIMAL}, #{hh12,jdbcType=DECIMAL}, #{hh13,jdbcType=DECIMAL}, 
      #{hh14,jdbcType=DECIMAL}, #{hh15,jdbcType=DECIMAL}, #{hh16,jdbcType=DECIMAL}, #{hh17,jdbcType=DECIMAL}, 
      #{hh18,jdbcType=DECIMAL}, #{hh19,jdbcType=DECIMAL}, #{hh20,jdbcType=DECIMAL}, #{hh21,jdbcType=DECIMAL}, 
      #{hh22,jdbcType=DECIMAL}, #{hh23,jdbcType=DECIMAL}, #{hh00,jdbcType=DECIMAL}, #{updateReason,jdbcType=VARCHAR}, 
      #{userid,jdbcType=VARCHAR}, #{uptime,jdbcType=VARCHAR}, #{crman,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.ems.trmplanvalue.model.TRmPlanValue">
    insert into T_RM_PLAN_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="actualvalue != null">
        ACTUALVALUE,
      </if>
      <if test="correctvalue != null">
        CORRECTVALUE,
      </if>
      <if test="apportvalue != null">
        APPORTVALUE,
      </if>
      <if test="stdvalue != null">
        STDVALUE,
      </if>
      <if test="sumvalue != null">
        SUMVALUE,
      </if>
      <if test="sumstdvalue != null">
        SUMSTDVALUE,
      </if>
      <if test="recTime != null">
        REC_TIME,
      </if>
      <if test="teamsort != null">
        TEAMSORT,
      </if>
      <if test="modifyflag != null">
        MODIFYFLAG,
      </if>
      <if test="islock != null">
        ISLOCK,
      </if>
      <if test="lockid != null">
        LOCKID,
      </if>
      <if test="consumevalue != null">
        CONSUMEVALUE,
      </if>
      <if test="ucvalue != null">
        UCVALUE,
      </if>
      <if test="sumucvalue != null">
        SUMUCVALUE,
      </if>
      <if test="hh01 != null">
        HH01,
      </if>
      <if test="hh02 != null">
        HH02,
      </if>
      <if test="hh03 != null">
        HH03,
      </if>
      <if test="hh04 != null">
        HH04,
      </if>
      <if test="hh05 != null">
        HH05,
      </if>
      <if test="hh06 != null">
        HH06,
      </if>
      <if test="hh07 != null">
        HH07,
      </if>
      <if test="hh08 != null">
        HH08,
      </if>
      <if test="hh09 != null">
        HH09,
      </if>
      <if test="hh10 != null">
        HH10,
      </if>
      <if test="hh11 != null">
        HH11,
      </if>
      <if test="hh12 != null">
        HH12,
      </if>
      <if test="hh13 != null">
        HH13,
      </if>
      <if test="hh14 != null">
        HH14,
      </if>
      <if test="hh15 != null">
        HH15,
      </if>
      <if test="hh16 != null">
        HH16,
      </if>
      <if test="hh17 != null">
        HH17,
      </if>
      <if test="hh18 != null">
        HH18,
      </if>
      <if test="hh19 != null">
        HH19,
      </if>
      <if test="hh20 != null">
        HH20,
      </if>
      <if test="hh21 != null">
        HH21,
      </if>
      <if test="hh22 != null">
        HH22,
      </if>
      <if test="hh23 != null">
        HH23,
      </if>
      <if test="hh00 != null">
        HH00,
      </if>
      <if test="updateReason != null">
        UPDATE_REASON,
      </if>
      <if test="userid != null">
        USERID,
      </if>
      <if test="uptime != null">
        UPTIME,
      </if>
      <if test="crman != null">
        CRMAN,
      </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="actualvalue != null">
        #{actualvalue,jdbcType=DECIMAL},
      </if>
      <if test="correctvalue != null">
        #{correctvalue,jdbcType=DECIMAL},
      </if>
      <if test="apportvalue != null">
        #{apportvalue,jdbcType=DECIMAL},
      </if>
      <if test="stdvalue != null">
        #{stdvalue,jdbcType=DECIMAL},
      </if>
      <if test="sumvalue != null">
        #{sumvalue,jdbcType=DECIMAL},
      </if>
      <if test="sumstdvalue != null">
        #{sumstdvalue,jdbcType=DECIMAL},
      </if>
      <if test="recTime != null">
        #{recTime,jdbcType=VARCHAR},
      </if>
      <if test="teamsort != null">
        #{teamsort,jdbcType=VARCHAR},
      </if>
      <if test="modifyflag != null">
        #{modifyflag,jdbcType=DECIMAL},
      </if>
      <if test="islock != null">
        #{islock,jdbcType=VARCHAR},
      </if>
      <if test="lockid != null">
        #{lockid,jdbcType=VARCHAR},
      </if>
      <if test="consumevalue != null">
        #{consumevalue,jdbcType=DECIMAL},
      </if>
      <if test="ucvalue != null">
        #{ucvalue,jdbcType=DECIMAL},
      </if>
      <if test="sumucvalue != null">
        #{sumucvalue,jdbcType=DECIMAL},
      </if>
      <if test="hh01 != null">
        #{hh01,jdbcType=DECIMAL},
      </if>
      <if test="hh02 != null">
        #{hh02,jdbcType=DECIMAL},
      </if>
      <if test="hh03 != null">
        #{hh03,jdbcType=DECIMAL},
      </if>
      <if test="hh04 != null">
        #{hh04,jdbcType=DECIMAL},
      </if>
      <if test="hh05 != null">
        #{hh05,jdbcType=DECIMAL},
      </if>
      <if test="hh06 != null">
        #{hh06,jdbcType=DECIMAL},
      </if>
      <if test="hh07 != null">
        #{hh07,jdbcType=DECIMAL},
      </if>
      <if test="hh08 != null">
        #{hh08,jdbcType=DECIMAL},
      </if>
      <if test="hh09 != null">
        #{hh09,jdbcType=DECIMAL},
      </if>
      <if test="hh10 != null">
        #{hh10,jdbcType=DECIMAL},
      </if>
      <if test="hh11 != null">
        #{hh11,jdbcType=DECIMAL},
      </if>
      <if test="hh12 != null">
        #{hh12,jdbcType=DECIMAL},
      </if>
      <if test="hh13 != null">
        #{hh13,jdbcType=DECIMAL},
      </if>
      <if test="hh14 != null">
        #{hh14,jdbcType=DECIMAL},
      </if>
      <if test="hh15 != null">
        #{hh15,jdbcType=DECIMAL},
      </if>
      <if test="hh16 != null">
        #{hh16,jdbcType=DECIMAL},
      </if>
      <if test="hh17 != null">
        #{hh17,jdbcType=DECIMAL},
      </if>
      <if test="hh18 != null">
        #{hh18,jdbcType=DECIMAL},
      </if>
      <if test="hh19 != null">
        #{hh19,jdbcType=DECIMAL},
      </if>
      <if test="hh20 != null">
        #{hh20,jdbcType=DECIMAL},
      </if>
      <if test="hh21 != null">
        #{hh21,jdbcType=DECIMAL},
      </if>
      <if test="hh22 != null">
        #{hh22,jdbcType=DECIMAL},
      </if>
      <if test="hh23 != null">
        #{hh23,jdbcType=DECIMAL},
      </if>
      <if test="hh00 != null">
        #{hh00,jdbcType=DECIMAL},
      </if>
      <if test="updateReason != null">
        #{updateReason,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=VARCHAR},
      </if>
      <if test="uptime != null">
        #{uptime,jdbcType=VARCHAR},
      </if>
      <if test="crman != null">
        #{crman,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.trmplanvalue.model.TRmPlanValue">
    update T_RM_PLAN_VALUE
    set ACTUALVALUE = #{actualvalue,jdbcType=DECIMAL},
      CORRECTVALUE = #{correctvalue,jdbcType=DECIMAL},
      APPORTVALUE = #{apportvalue,jdbcType=DECIMAL},
      STDVALUE = #{stdvalue,jdbcType=DECIMAL},
      SUMVALUE = #{sumvalue,jdbcType=DECIMAL},
      SUMSTDVALUE = #{sumstdvalue,jdbcType=DECIMAL},
      REC_TIME = #{recTime,jdbcType=VARCHAR},
      TEAMSORT = #{teamsort,jdbcType=VARCHAR},
      MODIFYFLAG = #{modifyflag,jdbcType=DECIMAL},
      ISLOCK = #{islock,jdbcType=VARCHAR},
      LOCKID = #{lockid,jdbcType=VARCHAR},
      CONSUMEVALUE = #{consumevalue,jdbcType=DECIMAL},
      UCVALUE = #{ucvalue,jdbcType=DECIMAL},
      SUMUCVALUE = #{sumucvalue,jdbcType=DECIMAL},
      HH01 = #{hh01,jdbcType=DECIMAL},
      HH02 = #{hh02,jdbcType=DECIMAL},
      HH03 = #{hh03,jdbcType=DECIMAL},
      HH04 = #{hh04,jdbcType=DECIMAL},
      HH05 = #{hh05,jdbcType=DECIMAL},
      HH06 = #{hh06,jdbcType=DECIMAL},
      HH07 = #{hh07,jdbcType=DECIMAL},
      HH08 = #{hh08,jdbcType=DECIMAL},
      HH09 = #{hh09,jdbcType=DECIMAL},
      HH10 = #{hh10,jdbcType=DECIMAL},
      HH11 = #{hh11,jdbcType=DECIMAL},
      HH12 = #{hh12,jdbcType=DECIMAL},
      HH13 = #{hh13,jdbcType=DECIMAL},
      HH14 = #{hh14,jdbcType=DECIMAL},
      HH15 = #{hh15,jdbcType=DECIMAL},
      HH16 = #{hh16,jdbcType=DECIMAL},
      HH17 = #{hh17,jdbcType=DECIMAL},
      HH18 = #{hh18,jdbcType=DECIMAL},
      HH19 = #{hh19,jdbcType=DECIMAL},
      HH20 = #{hh20,jdbcType=DECIMAL},
      HH21 = #{hh21,jdbcType=DECIMAL},
      HH22 = #{hh22,jdbcType=DECIMAL},
      HH23 = #{hh23,jdbcType=DECIMAL},
      HH00 = #{hh00,jdbcType=DECIMAL},
      UPDATE_REASON = #{updateReason,jdbcType=VARCHAR},
      USERID = #{userid,jdbcType=VARCHAR},
      UPTIME = #{uptime,jdbcType=VARCHAR},
      CRMAN = #{crman,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.trmplanvalue.model.TRmPlanValue">
    update T_RM_PLAN_VALUE
    <set>
      <if test="actualvalue != null">
        ACTUALVALUE = #{actualvalue,jdbcType=DECIMAL},
      </if>
      <if test="correctvalue != null">
        CORRECTVALUE = #{correctvalue,jdbcType=DECIMAL},
      </if>
      <if test="apportvalue != null">
        APPORTVALUE = #{apportvalue,jdbcType=DECIMAL},
      </if>
      <if test="stdvalue != null">
        STDVALUE = #{stdvalue,jdbcType=DECIMAL},
      </if>
      <if test="sumvalue != null">
        SUMVALUE = #{sumvalue,jdbcType=DECIMAL},
      </if>
      <if test="sumstdvalue != null">
        SUMSTDVALUE = #{sumstdvalue,jdbcType=DECIMAL},
      </if>
      <if test="recTime != null">
        REC_TIME = #{recTime,jdbcType=VARCHAR},
      </if>
      <if test="teamsort != null">
        TEAMSORT = #{teamsort,jdbcType=VARCHAR},
      </if>
      <if test="modifyflag != null">
        MODIFYFLAG = #{modifyflag,jdbcType=DECIMAL},
      </if>
      <if test="islock != null">
        ISLOCK = #{islock,jdbcType=VARCHAR},
      </if>
      <if test="lockid != null">
        LOCKID = #{lockid,jdbcType=VARCHAR},
      </if>
      <if test="consumevalue != null">
        CONSUMEVALUE = #{consumevalue,jdbcType=DECIMAL},
      </if>
      <if test="ucvalue != null">
        UCVALUE = #{ucvalue,jdbcType=DECIMAL},
      </if>
      <if test="sumucvalue != null">
        SUMUCVALUE = #{sumucvalue,jdbcType=DECIMAL},
      </if>
      <if test="hh01 != null">
        HH01 = #{hh01,jdbcType=DECIMAL},
      </if>
      <if test="hh02 != null">
        HH02 = #{hh02,jdbcType=DECIMAL},
      </if>
      <if test="hh03 != null">
        HH03 = #{hh03,jdbcType=DECIMAL},
      </if>
      <if test="hh04 != null">
        HH04 = #{hh04,jdbcType=DECIMAL},
      </if>
      <if test="hh05 != null">
        HH05 = #{hh05,jdbcType=DECIMAL},
      </if>
      <if test="hh06 != null">
        HH06 = #{hh06,jdbcType=DECIMAL},
      </if>
      <if test="hh07 != null">
        HH07 = #{hh07,jdbcType=DECIMAL},
      </if>
      <if test="hh08 != null">
        HH08 = #{hh08,jdbcType=DECIMAL},
      </if>
      <if test="hh09 != null">
        HH09 = #{hh09,jdbcType=DECIMAL},
      </if>
      <if test="hh10 != null">
        HH10 = #{hh10,jdbcType=DECIMAL},
      </if>
      <if test="hh11 != null">
        HH11 = #{hh11,jdbcType=DECIMAL},
      </if>
      <if test="hh12 != null">
        HH12 = #{hh12,jdbcType=DECIMAL},
      </if>
      <if test="hh13 != null">
        HH13 = #{hh13,jdbcType=DECIMAL},
      </if>
      <if test="hh14 != null">
        HH14 = #{hh14,jdbcType=DECIMAL},
      </if>
      <if test="hh15 != null">
        HH15 = #{hh15,jdbcType=DECIMAL},
      </if>
      <if test="hh16 != null">
        HH16 = #{hh16,jdbcType=DECIMAL},
      </if>
      <if test="hh17 != null">
        HH17 = #{hh17,jdbcType=DECIMAL},
      </if>
      <if test="hh18 != null">
        HH18 = #{hh18,jdbcType=DECIMAL},
      </if>
      <if test="hh19 != null">
        HH19 = #{hh19,jdbcType=DECIMAL},
      </if>
      <if test="hh20 != null">
        HH20 = #{hh20,jdbcType=DECIMAL},
      </if>
      <if test="hh21 != null">
        HH21 = #{hh21,jdbcType=DECIMAL},
      </if>
      <if test="hh22 != null">
        HH22 = #{hh22,jdbcType=DECIMAL},
      </if>
      <if test="hh23 != null">
        HH23 = #{hh23,jdbcType=DECIMAL},
      </if>
      <if test="hh00 != null">
        HH00 = #{hh00,jdbcType=DECIMAL},
      </if>
      <if test="updateReason != null">
        UPDATE_REASON = #{updateReason,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        USERID = #{userid,jdbcType=VARCHAR},
      </if>
      <if test="uptime != null">
        UPTIME = #{uptime,jdbcType=VARCHAR},
      </if>
      <if test="crman != null">
        CRMAN = #{crman,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_PLAN_VALUE 
      (CLOCK, 
      ITEMID, TIMEGRANID, ACTUALVALUE, 
      CORRECTVALUE, APPORTVALUE, STDVALUE, 
      SUMVALUE, SUMSTDVALUE, REC_TIME, 
      TEAMSORT, MODIFYFLAG, ISLOCK, 
      LOCKID, CONSUMEVALUE, UCVALUE, 
      SUMUCVALUE, HH01, HH02, 
      HH03, HH04, HH05, 
      HH06, HH07, HH08, 
      HH09, HH10, HH11, 
      HH12, HH13, HH14, 
      HH15, HH16, HH17, 
      HH18, HH19, HH20, 
      HH21, HH22, HH23, 
      HH00, UPDATE_REASON, USERID, 
      UPTIME, CRMAN)
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.clock,jdbcType=VARCHAR}, 
      #{item.itemid,jdbcType=VARCHAR}, #{item.timegranid,jdbcType=VARCHAR}, #{item.actualvalue,jdbcType=DECIMAL}, 
      #{item.correctvalue,jdbcType=DECIMAL}, #{item.apportvalue,jdbcType=DECIMAL}, #{item.stdvalue,jdbcType=DECIMAL}, 
      #{item.sumvalue,jdbcType=DECIMAL}, #{item.sumstdvalue,jdbcType=DECIMAL}, #{item.recTime,jdbcType=VARCHAR}, 
      #{item.teamsort,jdbcType=VARCHAR}, #{item.modifyflag,jdbcType=DECIMAL}, #{item.islock,jdbcType=VARCHAR}, 
      #{item.lockid,jdbcType=VARCHAR}, #{item.consumevalue,jdbcType=DECIMAL}, #{item.ucvalue,jdbcType=DECIMAL}, 
      #{item.sumucvalue,jdbcType=DECIMAL}, #{item.hh01,jdbcType=DECIMAL}, #{item.hh02,jdbcType=DECIMAL}, 
      #{item.hh03,jdbcType=DECIMAL}, #{item.hh04,jdbcType=DECIMAL}, #{item.hh05,jdbcType=DECIMAL}, 
      #{item.hh06,jdbcType=DECIMAL}, #{item.hh07,jdbcType=DECIMAL}, #{item.hh08,jdbcType=DECIMAL}, 
      #{item.hh09,jdbcType=DECIMAL}, #{item.hh10,jdbcType=DECIMAL}, #{item.hh11,jdbcType=DECIMAL}, 
      #{item.hh12,jdbcType=DECIMAL}, #{item.hh13,jdbcType=DECIMAL}, #{item.hh14,jdbcType=DECIMAL}, 
      #{item.hh15,jdbcType=DECIMAL}, #{item.hh16,jdbcType=DECIMAL}, #{item.hh17,jdbcType=DECIMAL}, 
      #{item.hh18,jdbcType=DECIMAL}, #{item.hh19,jdbcType=DECIMAL}, #{item.hh20,jdbcType=DECIMAL}, 
      #{item.hh21,jdbcType=DECIMAL}, #{item.hh22,jdbcType=DECIMAL}, #{item.hh23,jdbcType=DECIMAL}, 
      #{item.hh00,jdbcType=DECIMAL}, #{item.updateReason,jdbcType=VARCHAR}, #{item.userid,jdbcType=VARCHAR}, 
      #{item.uptime,jdbcType=VARCHAR}, #{item.crman,jdbcType=VARCHAR} from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update T_RM_PLAN_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>
       ,ACTUALVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.actualvalue,jdbcType=DECIMAL}
       </foreach>
       ,CORRECTVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.correctvalue,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>
       ,SUMVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.sumvalue,jdbcType=DECIMAL}
       </foreach>
       ,SUMSTDVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.sumstdvalue,jdbcType=DECIMAL}
       </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>
       ,TEAMSORT=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.teamsort,jdbcType=VARCHAR}
       </foreach>
       ,MODIFYFLAG=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.modifyflag,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>
       ,LOCKID=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.lockid,jdbcType=VARCHAR}
       </foreach>
       ,CONSUMEVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.consumevalue,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>
       ,SUMUCVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.sumucvalue,jdbcType=DECIMAL}
       </foreach>
       ,HH01=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh01,jdbcType=DECIMAL}
       </foreach>
       ,HH02=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh02,jdbcType=DECIMAL}
       </foreach>
       ,HH03=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh03,jdbcType=DECIMAL}
       </foreach>
       ,HH04=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh04,jdbcType=DECIMAL}
       </foreach>
       ,HH05=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh05,jdbcType=DECIMAL}
       </foreach>
       ,HH06=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh06,jdbcType=DECIMAL}
       </foreach>
       ,HH07=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh07,jdbcType=DECIMAL}
       </foreach>
       ,HH08=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh08,jdbcType=DECIMAL}
       </foreach>
       ,HH09=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh09,jdbcType=DECIMAL}
       </foreach>
       ,HH10=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh10,jdbcType=DECIMAL}
       </foreach>
       ,HH11=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh11,jdbcType=DECIMAL}
       </foreach>
       ,HH12=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh12,jdbcType=DECIMAL}
       </foreach>
       ,HH13=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh13,jdbcType=DECIMAL}
       </foreach>
       ,HH14=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh14,jdbcType=DECIMAL}
       </foreach>
       ,HH15=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh15,jdbcType=DECIMAL}
       </foreach>
       ,HH16=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh16,jdbcType=DECIMAL}
       </foreach>
       ,HH17=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh17,jdbcType=DECIMAL}
       </foreach>
       ,HH18=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh18,jdbcType=DECIMAL}
       </foreach>
       ,HH19=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh19,jdbcType=DECIMAL}
       </foreach>
       ,HH20=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh20,jdbcType=DECIMAL}
       </foreach>
       ,HH21=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh21,jdbcType=DECIMAL}
       </foreach>
       ,HH22=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh22,jdbcType=DECIMAL}
       </foreach>
       ,HH23=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh23,jdbcType=DECIMAL}
       </foreach>
       ,HH00=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.hh00,jdbcType=DECIMAL}
       </foreach>
       ,UPDATE_REASON=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.updateReason,jdbcType=VARCHAR}
       </foreach>
       ,USERID=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.userid,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>
       ,CRMAN=
       <foreach collection="list" item="item" index="index" separator=" " open="case CLOCK" close="end">
          when #{item.clock,jdbcType=VARCHAR} then #{item.crman,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_PLAN_VALUE
    where CLOCK in 
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->
    <!-- 能源综合分析-供需计划分析-供需计划对比分析页面-查询 -->
    <select id="getDate621" parameterType="java.util.HashMap" resultType = "Map">
       select a.CLOCK, a.APPORTVALUE,
       CASE WHEN a.ITEMNAME IS NULL THEN b.ITEMNAME else a.ITEMNAME end as ITEMNAME,
       CASE WHEN a.UNITNAME IS NULL THEN b.UNITNAME else a.UNITNAME end as UNITNAME,
       b.clock as COMPARECLOCK, b.apportvalue as COMPAREAPPORTVALUE,
       decode(b.apportvalue,0,0,round((a.apportvalue-b.apportvalue) / b.apportvalue, 5)) as DIFFERENTVALUE
       from (select CLOCK, APPORTVALUE, ITEMNAME, UNITNAME, itemid from v_ca_01_chart
       <where>
          <if test="clock != null and clock != ''">
            and CLOCK = #{clock}
          </if>
          <if test="timegranid != null and timegranid != ''">
            and TIMEGRANID = #{timegranid}
          </if>
          <if test="workprocid != null and workprocid != ''">
            and WORKPROCID in (${workprocid})
          </if>
          <if test="energyid != null and energyid != ''">
            and ENERGYID = #{energyid}
          </if>
          <if test="propertyid != null and propertyid != ''">
            and PROPERTYID = #{propertyid}
          </if>
       </where>) a
       full join (select CLOCK, APPORTVALUE, ITEMNAME, UNITNAME, itemid from v_ca_01_chart
       <where>
          <if test="compareclock != null and compareclock != ''">
            and CLOCK = #{compareclock}
          </if>
          <if test="timegranid != null and timegranid != ''">
            and TIMEGRANID = #{timegranid}
          </if>
          <if test="workprocid != null and workprocid != ''">
            and WORKPROCID in (${workprocid})
          </if>
          <if test="energyid != null and energyid != ''">
            and ENERGYID = #{energyid}
          </if>
          <if test="propertyid != null and propertyid != ''">
            and PROPERTYID = #{propertyid}
          </if>
       </where>) b
       on a.itemid = b.itemid
    </select>
    
    <!-- 能源综合分析-供需计划分析-供需计划实绩对比分析页面-查询 -->
    <select id="getDate622" parameterType="java.util.HashMap" resultType = "Map">
      select CLOCK, ITEMNAME, UNITNAME, PLANVALUE, APPORTVALUE, DIFFERENTVALUE from V_CA_02
       <where>
          <if test="clock != null and clock != ''">
            and CLOCK = #{clock}
          </if>
          <if test="timegranid != null and timegranid != ''">
            and TIMEGRANID = #{timegranid}
          </if>
          <if test="workprocid != null and workprocid != ''">
	        and WORKPROCID in (${workprocid})
	      </if>
          <if test="energyid != null and energyid != ''">
            and ENERGYID = #{energyid}
          </if>
          <if test="propertyid != null and propertyid != ''">
            and PROPERTYID = #{propertyid}
          </if>
       </where>
       order by ITEMNAME
    </select>
    
    <!-- 能源综合分析-供需计划分析-供需计划跟踪及趋势分析页面-表1 -->
    <select id="getDate6231" parameterType="java.util.HashMap" resultType = "Map">
      select a.clock, a.WORKPROCNAME,a.itemdesc,a.UNITNAME,b.PRODUCTNAME,a.ENERGYID,a.workprocid,
       round(a.apportvalue, 5) as apportvalue,
       round(b.apportvalue, 5) as productvalue,
       case when b.apportvalue = 0 then 0 else round(a.apportvalue / b.apportvalue, 5) end as singlevalue 
       from v_plan_item_info a left join vm_workproc_product_info b
       on a.workprocid = b.WORKPROCID and a.clock = b.CLOCK and a.timegranid = b.TIMEGRANID
       where b.ITEMTYPE = 'P'
       <if test="clock != null and clock != ''">
         and a.CLOCK &gt;= #{clock}
       </if>
       <if test="clocke != null and clocke != ''">
         and a.CLOCK &lt;= #{clocke}
       </if>
       <if test="timegranid != null and timegranid != ''">
         and a.TIMEGRANID = #{timegranid}
       </if>
       <if test="workprocid != null and workprocid != ''">
         and a.WORKPROCID in (${workprocid})
       </if>
       <if test="energyid != null and energyid != ''">
         and a.ENERGYID = #{energyid}
       </if>
       <if test="propertyid != null and propertyid != ''">
         and a.PROPERTYID = #{propertyid}
       </if>
       order by a.clock, a.workprocid
    </select>
    
    <!-- 能源综合分析-供需计划分析-供需计划跟踪及趋势分析页面-表2 -->
    <select id="getDate6232" parameterType="java.util.HashMap" resultType = "Map">
      select a.WORKPROCNAME, a.workprocid, a.itemdesc, a.UNITNAME,
       round(min(a.apportvalue), 5) as minapportvalue,
       round(max(a.apportvalue), 5) as maxapportvalue,
       round(avg(a.apportvalue), 5) as avgapportvalue,
       round(min(b.apportvalue), 5) as minproductvalue,
       round(max(b.apportvalue), 5) as maxproductvalue,
       round(avg(b.apportvalue), 5) as avgproductvalue,
       round(min(case b.apportvalue when 0 then 0 else a.apportvalue / b.apportvalue end), 5) as minsinglevalue,
       round(max(case b.apportvalue when 0 then 0 else a.apportvalue / b.apportvalue end), 5) as maxsinglevalue,
       round(avg(case b.apportvalue when 0 then 0 else a.apportvalue / b.apportvalue end), 5) as avgsinglevalue
       from v_plan_item_info a left join vm_workproc_product_info b
       on a.workprocid = b.WORKPROCID and a.clock = b.CLOCK and a.timegranid = b.TIMEGRANID
       where b.ITEMTYPE = 'P'
       <if test="clock != null and clock != ''">
         and a.CLOCK &gt;= #{clock}
       </if>
       <if test="clocke != null and clocke != ''">
         and a.CLOCK &lt;= #{clocke}
       </if>
       <if test="timegranid != null and timegranid != ''">
         and a.TIMEGRANID = #{timegranid}
       </if>
       <if test="workprocid != null and workprocid != ''">
         and a.WORKPROCID in (${workprocid})
       </if>
       <if test="energyid != null and energyid != ''">
         and a.ENERGYID = #{energyid}
       </if>
       <if test="propertyid != null and propertyid != ''">
         and a.PROPERTYID = #{propertyid}
       </if>
       group by a.WORKPROCNAME, a.workprocid, a.itemdesc, a.UNITNAME
       order by a.workprocid
    </select>
    
    <!--获取累计值-->
    <select id="getSumvalue" parameterType="java.util.HashMap" resultType="double">
        SELECT SUM(APPORTVALUE) FROM T_RM_PLAN_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>
    
    <!--计算累计值2（计算日期小于参数值的累计值）-->
    <select id="getSumvalue2" parameterType="java.util.HashMap" resultType="double">
        SELECT nvl(SUM(APPORTVALUE),0) FROM T_RM_PLAN_VALUE
        <where>
            <if test="itemid !=null and itemid != '' ">
                AND  ITEMID=#{itemid}
            </if>
            <if test="clock !=null and clock !='' ">
                AND CLOCK &lt; #{clock}
            </if>
            <if test="ckhead !=null and ckhead !='' ">
                AND CLOCK LIKE '${ckhead}%'
            </if>
            <if test="timegranid !=null and timegranid !='' ">
                AND TIMEGRANID=#{timegranid}
            </if>
        </where>
    </select>
    
    <!-- 获取数据条数 -->
    <select id="getCount" parameterType="java.util.HashMap" resultType="java.lang.Integer">
        select count(1) from T_RM_PLAN_VALUE
        <include refid="where"/>
    </select>
</mapper>