<?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.trmcalpoint.mapper.TRmCalpointMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.ems.trmcalpoint.model.TRmCalpoint">
    <id column="ITEMID" jdbcType="VARCHAR" property="itemid" />
    <result column="ITEMNAME" jdbcType="VARCHAR" property="itemname" />
    <result column="ITEMDESC" jdbcType="VARCHAR" property="itemdesc" />
    <result column="LOCATEID" jdbcType="VARCHAR" property="locateid" />
    <result column="NETWORKID" jdbcType="VARCHAR" property="networkid" />
    <result column="ENERGYID" jdbcType="VARCHAR" property="energyid" />
    <result column="ENERGYTYPEID" jdbcType="VARCHAR" property="energytypeid" />
    <result column="UNITID" jdbcType="VARCHAR" property="unitid" />
    <result column="COSTID" jdbcType="VARCHAR" property="costid" />
    <result column="ITEMTYPE" jdbcType="VARCHAR" property="itemtype" />
    <result column="PROPERTYID" jdbcType="VARCHAR" property="propertyid" />
    <result column="TAGID" jdbcType="VARCHAR" property="tagid" />
    <result column="TAGNAME" jdbcType="VARCHAR" property="tagname" />
    <result column="TAG_ALIAS" jdbcType="VARCHAR" property="tagAlias" />
    <result column="USEFLAG" jdbcType="VARCHAR" property="useflag" />
    <result column="DEFAULTVALUE" jdbcType="VARCHAR" property="defaultvalue" />
    <result column="DIGITS" jdbcType="DECIMAL" property="digits" />
    <result column="SEQNO" jdbcType="DECIMAL" property="seqno" />
    <result column="SHOWNO" jdbcType="DECIMAL" property="showno" />
    <result column="STATUS" jdbcType="VARCHAR" property="status" />
    <result column="NODE" jdbcType="VARCHAR" property="node" />
    <result column="PARENTID" jdbcType="VARCHAR" property="parentid" />
    <result column="BCODE" jdbcType="VARCHAR" property="bcode" />
    <result column="BDESC1" jdbcType="VARCHAR" property="bdesc1" />
    <result column="BDESC2" jdbcType="VARCHAR" property="bdesc2" />
    <result column="BTYPE1" jdbcType="VARCHAR" property="btype1" />
    <result column="BTYPE2" jdbcType="VARCHAR" property="btype2" />
    <result column="RANGE_VAL" jdbcType="DECIMAL" property="rangeVal" />
    <result column="TAG_ID_MAP" jdbcType="VARCHAR" property="tagIdMap" />
    <result column="CALC_MOD" jdbcType="VARCHAR" property="calcMod" />
    <result column="DATA_TYPE" jdbcType="VARCHAR" property="dataType" />
    <result column="TAG_TABLE" jdbcType="VARCHAR" property="tagTable" />
    <result column="MAX_VAL" jdbcType="VARCHAR" property="maxVal" />
    <result column="MIN_VAL" jdbcType="VARCHAR" property="minVal" />
    <result column="AVG_VAL" jdbcType="VARCHAR" property="avgVal" />
    <result column="SUM_VAL" jdbcType="VARCHAR" property="sumVal" />
    <result column="TAG_MODULUS" jdbcType="DECIMAL" property="tagModulus" />
    <result column="METER_TYPE" jdbcType="VARCHAR" property="meterType" />
    <result column="METER_SCALE" jdbcType="DECIMAL" property="meterScale" />
    <result column="METER_LOC" jdbcType="VARCHAR" property="meterLoc" />
    <result column="TAG_BAD_SYMBOL" jdbcType="VARCHAR" property="tagBadSymbol" />
    <result column="SOURCE_TYPE" jdbcType="VARCHAR" property="sourceType" />
    <result column="REC_TIME" jdbcType="VARCHAR" property="recTime" />
    <result column="ISSETTLE" jdbcType="VARCHAR" property="issettle" />
    <result column="ISSCHEDULE" jdbcType="VARCHAR" property="isschedule" />
    <result column="TAG_COL" jdbcType="VARCHAR" property="tagCol" />
    <result column="REC_MAN" jdbcType="VARCHAR" property="recMan" />
    <result column="UPDATEMAN" jdbcType="VARCHAR" property="updateman" />
    <result column="UPDATETIME" jdbcType="TIMESTAMP" property="updatetime" />
    <result column="MINTIMEGRANID" jdbcType="VARCHAR" property="mintimegranid" />
  </resultMap>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from T_RM_CALPOINT
    where ITEMID = #{itemid,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from T_RM_CALPOINT
    where 1=1
      <if test="itemname != null and itemname != ''">
        and ITEMNAME = #{itemname}
      </if>
      <if test="itemdesc != null and itemdesc != ''">
        and ITEMDESC = #{itemdesc}
      </if>
      <if test="locateid != null and locateid != ''">
        and LOCATEID = #{locateid}
      </if>
      <if test="networkid != null and networkid != ''">
        and NETWORKID = #{networkid}
      </if>
      <if test="energyid != null and energyid != ''">
        and ENERGYID = #{energyid}
      </if>
      <if test="energytypeid != null and energytypeid != ''">
        and ENERGYTYPEID = #{energytypeid}
      </if>
      <if test="unitid != null and unitid != ''">
        and UNITID = #{unitid}
      </if>
      <if test="costid != null and costid != ''">
        and COSTID = #{costid}
      </if>
      <if test="itemtype != null and itemtype != ''">
        and ITEMTYPE = #{itemtype}
      </if>
      <if test="propertyid != null and propertyid != ''">
        and PROPERTYID = #{propertyid}
      </if>
      <if test="tagid != null and tagid != ''">
        and TAGID = #{tagid}
      </if>
      <if test="tagname != null and tagname != ''">
        and TAGNAME = #{tagname}
      </if>
      <if test="tagAlias != null and tagAlias != ''">
        and TAG_ALIAS = #{tagAlias}
      </if>
      <if test="useflag != null and useflag != ''">
        and USEFLAG = #{useflag}
      </if>
      <if test="defaultvalue != null and defaultvalue != ''">
        and DEFAULTVALUE = #{defaultvalue}
      </if>
      <if test="digits != null">
        and DIGITS = #{digits}
      </if>
      <if test="seqno != null">
        and SEQNO = #{seqno}
      </if>
      <if test="showno != null">
        and SHOWNO = #{showno}
      </if>
      <if test="status != null and status != ''">
        and STATUS = #{status}
      </if>
      <if test="node != null and node != ''">
        and NODE = #{node}
      </if>
      <if test="parentid != null and parentid != ''">
        and PARENTID = #{parentid}
      </if>
      <if test="bcode != null and bcode != ''">
        and BCODE = #{bcode}
      </if>
      <if test="bdesc1 != null and bdesc1 != ''">
        and BDESC1 = #{bdesc1}
      </if>
      <if test="bdesc2 != null and bdesc2 != ''">
        and BDESC2 = #{bdesc2}
      </if>
      <if test="btype1 != null and btype1 != ''">
        and BTYPE1 = #{btype1}
      </if>
      <if test="btype2 != null and btype2 != ''">
        and BTYPE2 = #{btype2}
      </if>
      <if test="rangeVal != null">
        and RANGE_VAL = #{rangeVal}
      </if>
      <if test="tagIdMap != null and tagIdMap != ''">
        and TAG_ID_MAP = #{tagIdMap}
      </if>
      <if test="calcMod != null and calcMod != ''">
        and CALC_MOD = #{calcMod}
      </if>
      <if test="dataType != null and dataType != ''">
        and DATA_TYPE = #{dataType}
      </if>
      <if test="tagTable != null and tagTable != ''">
        and TAG_TABLE = #{tagTable}
      </if>
      <if test="maxVal != null and maxVal != ''">
        and MAX_VAL = #{maxVal}
      </if>
      <if test="minVal != null and minVal != ''">
        and MIN_VAL = #{minVal}
      </if>
      <if test="avgVal != null and avgVal != ''">
        and AVG_VAL = #{avgVal}
      </if>
      <if test="sumVal != null and sumVal != ''">
        and SUM_VAL = #{sumVal}
      </if>
      <if test="tagModulus != null">
        and TAG_MODULUS = #{tagModulus}
      </if>
      <if test="meterType != null and meterType != ''">
        and METER_TYPE = #{meterType}
      </if>
      <if test="meterScale != null">
        and METER_SCALE = #{meterScale}
      </if>
      <if test="meterLoc != null and meterLoc != ''">
        and METER_LOC = #{meterLoc}
      </if>
      <if test="tagBadSymbol != null and tagBadSymbol != ''">
        and TAG_BAD_SYMBOL = #{tagBadSymbol}
      </if>
      <if test="sourceType != null and sourceType != ''">
        and SOURCE_TYPE = #{sourceType}
      </if>
      <if test="recTime != null and recTime != ''">
        and REC_TIME = #{recTime}
      </if>
      <if test="issettle != null and issettle != ''">
        and ISSETTLE = #{issettle}
      </if>
      <if test="isschedule != null and isschedule != ''">
        and ISSCHEDULE = #{isschedule}
      </if>
      <if test="tagCol != null and tagCol != ''">
        and TAG_COL = #{tagCol}
      </if>
      <if test="mintimegranid != null and mintimegranid != ''">
        and MINTIMEGRANID = #{mintimegranid}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.ems.trmcalpoint.model.TRmCalpoint">
    insert into T_RM_CALPOINT (ITEMID, ITEMNAME, ITEMDESC,
      LOCATEID, NETWORKID, ENERGYID, ENERGYTYPEID, UNITID, COSTID,
      ITEMTYPE, PROPERTYID, TAGID, TAGNAME, TAG_ALIAS,
      USEFLAG, DEFAULTVALUE, DIGITS, SEQNO, SHOWNO, STATUS, NODE,
      PARENTID, BCODE, BDESC1, BDESC2, BTYPE1, BTYPE2,
      RANGE_VAL, TAG_ID_MAP, CALC_MOD, DATA_TYPE, TAG_TABLE, MAX_VAL,
      MIN_VAL, AVG_VAL, SUM_VAL,
      TAG_MODULUS, METER_TYPE, METER_SCALE,
      METER_LOC, TAG_BAD_SYMBOL, SOURCE_TYPE,
      REC_TIME, ISSETTLE, ISSCHEDULE,
      TAG_COL,MINTIMEGRANID)
    values (#{itemid,jdbcType=VARCHAR}, #{itemname,jdbcType=VARCHAR}, #{itemdesc,jdbcType=VARCHAR},
      #{locateid,jdbcType=VARCHAR}, #{networkid,jdbcType=VARCHAR}, #{energyid,jdbcType=VARCHAR},
      #{energytypeid,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, #{costid,jdbcType=VARCHAR},
      #{itemtype,jdbcType=VARCHAR}, #{propertyid,jdbcType=VARCHAR},
      #{tagid,jdbcType=VARCHAR}, #{tagname,jdbcType=VARCHAR}, #{tagAlias,jdbcType=VARCHAR},
      #{useflag,jdbcType=VARCHAR}, #{defaultvalue,jdbcType=VARCHAR}, #{digits,jdbcType=DECIMAL},
      #{seqno,jdbcType=DECIMAL}, #{showno,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, #{node,jdbcType=VARCHAR},
      #{parentid,jdbcType=VARCHAR}, #{bcode,jdbcType=VARCHAR}, #{bdesc1,jdbcType=VARCHAR},
      #{bdesc2,jdbcType=VARCHAR}, #{btype1,jdbcType=VARCHAR}, #{btype2,jdbcType=VARCHAR},
      #{rangeVal,jdbcType=DECIMAL}, #{tagIdMap,jdbcType=VARCHAR}, #{calcMod,jdbcType=VARCHAR},
      #{dataType,jdbcType=VARCHAR}, #{tagTable,jdbcType=VARCHAR}, #{maxVal,jdbcType=VARCHAR},
      #{minVal,jdbcType=VARCHAR}, #{avgVal,jdbcType=VARCHAR}, #{sumVal,jdbcType=VARCHAR},
      #{tagModulus,jdbcType=DECIMAL}, #{meterType,jdbcType=VARCHAR}, #{meterScale,jdbcType=DECIMAL},
      #{meterLoc,jdbcType=VARCHAR}, #{tagBadSymbol,jdbcType=VARCHAR}, #{sourceType,jdbcType=VARCHAR},
      #{recTime,jdbcType=VARCHAR}, #{issettle,jdbcType=VARCHAR}, #{isschedule,jdbcType=VARCHAR},
      #{tagCol,jdbcType=VARCHAR},#{mintimegranid,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.ems.trmcalpoint.model.TRmCalpoint">
    insert into T_RM_CALPOINT
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="itemid != null">
        ITEMID,
      </if>
      <if test="itemname != null">
        ITEMNAME,
      </if>
      <if test="itemdesc != null">
        ITEMDESC,
      </if>
      <if test="locateid != null">
        LOCATEID,
      </if>
      <if test="networkid != null">
        NETWORKID,
      </if>
      <if test="energyid != null">
        ENERGYID,
      </if>
      <if test="energytypeid != null">
        ENERGYTYPEID,
      </if>
      <if test="unitid != null">
        UNITID,
      </if>
      <if test="costid != null">
        COSTID,
      </if>
      <if test="itemtype != null">
        ITEMTYPE,
      </if>
      <if test="propertyid != null">
        PROPERTYID,
      </if>
      <if test="tagid != null">
        TAGID,
      </if>
      <if test="tagname != null">
        TAGNAME,
      </if>
      <if test="tagAlias != null">
        TAG_ALIAS,
      </if>
      <if test="useflag != null">
        USEFLAG,
      </if>
      <if test="defaultvalue != null">
        DEFAULTVALUE,
      </if>
      <if test="digits != null">
        DIGITS,
      </if>
      <if test="seqno != null">
        SEQNO,
      </if>
      <if test="showno != null">
        SHOWNO,
      </if>
      <if test="status != null">
        STATUS,
      </if>
      <if test="node != null">
        NODE,
      </if>
      <if test="parentid != null">
        PARENTID,
      </if>
      <if test="bcode != null">
        BCODE,
      </if>
      <if test="bdesc1 != null">
        BDESC1,
      </if>
      <if test="bdesc2 != null">
        BDESC2,
      </if>
      <if test="btype1 != null">
        BTYPE1,
      </if>
      <if test="btype2 != null">
        BTYPE2,
      </if>
      <if test="rangeVal != null">
        RANGE_VAL,
      </if>
      <if test="tagIdMap != null">
        TAG_ID_MAP,
      </if>
      <if test="calcMod != null">
        CALC_MOD,
      </if>
      <if test="dataType != null">
        DATA_TYPE,
      </if>
      <if test="tagTable != null">
        TAG_TABLE,
      </if>
      <if test="maxVal != null">
        MAX_VAL,
      </if>
      <if test="minVal != null">
        MIN_VAL,
      </if>
      <if test="avgVal != null">
        AVG_VAL,
      </if>
      <if test="sumVal != null">
        SUM_VAL,
      </if>
      <if test="tagModulus != null">
        TAG_MODULUS,
      </if>
      <if test="meterType != null">
        METER_TYPE,
      </if>
      <if test="meterScale != null">
        METER_SCALE,
      </if>
      <if test="meterLoc != null">
        METER_LOC,
      </if>
      <if test="tagBadSymbol != null">
        TAG_BAD_SYMBOL,
      </if>
      <if test="sourceType != null">
        SOURCE_TYPE,
      </if>
      <if test="recTime != null">
        REC_TIME,
      </if>
      <if test="issettle != null">
        ISSETTLE,
      </if>
      <if test="isschedule != null">
        ISSCHEDULE,
      </if>
      <if test="tagCol != null">
        TAG_COL,
      </if>
      <if test="mintimegranid != null">
        MINTIMEGRANID,
      </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="locateid != null">
        #{locateid,jdbcType=VARCHAR},
      </if>
      <if test="networkid != null">
        #{networkid,jdbcType=VARCHAR},
      </if>
      <if test="energyid != null">
        #{energyid,jdbcType=VARCHAR},
      </if>
      <if test="energytypeid != null">
        #{energytypeid,jdbcType=VARCHAR},
      </if>
      <if test="unitid != null">
        #{unitid,jdbcType=VARCHAR},
      </if>
      <if test="costid != null">
        #{costid,jdbcType=VARCHAR},
      </if>
      <if test="itemtype != null">
        #{itemtype,jdbcType=VARCHAR},
      </if>
      <if test="propertyid != null">
        #{propertyid,jdbcType=VARCHAR},
      </if>
      <if test="tagid != null">
        #{tagid,jdbcType=VARCHAR},
      </if>
      <if test="tagname != null">
        #{tagname,jdbcType=VARCHAR},
      </if>
      <if test="tagAlias != null">
        #{tagAlias,jdbcType=VARCHAR},
      </if>
      <if test="useflag != null">
        #{useflag,jdbcType=VARCHAR},
      </if>
      <if test="defaultvalue != null">
        #{defaultvalue,jdbcType=VARCHAR},
      </if>
      <if test="digits != null">
        #{digits,jdbcType=DECIMAL},
      </if>
      <if test="seqno != null">
        #{seqno,jdbcType=DECIMAL},
      </if>
      <if test="showno != null">
        #{showno,jdbcType=DECIMAL},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="node != null">
        #{node,jdbcType=VARCHAR},
      </if>
      <if test="parentid != null">
        #{parentid,jdbcType=VARCHAR},
      </if>
      <if test="bcode != null">
        #{bcode,jdbcType=VARCHAR},
      </if>
      <if test="bdesc1 != null">
        #{bdesc1,jdbcType=VARCHAR},
      </if>
      <if test="bdesc2 != null">
        #{bdesc2,jdbcType=VARCHAR},
      </if>
      <if test="btype1 != null">
        #{btype1,jdbcType=VARCHAR},
      </if>
      <if test="btype2 != null">
        #{btype2,jdbcType=VARCHAR},
      </if>
      <if test="rangeVal != null">
        #{rangeVal,jdbcType=DECIMAL},
      </if>
      <if test="tagIdMap != null">
        #{tagIdMap,jdbcType=VARCHAR},
      </if>
      <if test="calcMod != null">
        #{calcMod,jdbcType=VARCHAR},
      </if>
      <if test="dataType != null">
        #{dataType,jdbcType=VARCHAR},
      </if>
      <if test="tagTable != null">
        #{tagTable,jdbcType=VARCHAR},
      </if>
      <if test="maxVal != null">
        #{maxVal,jdbcType=VARCHAR},
      </if>
      <if test="minVal != null">
        #{minVal,jdbcType=VARCHAR},
      </if>
      <if test="avgVal != null">
        #{avgVal,jdbcType=VARCHAR},
      </if>
      <if test="sumVal != null">
        #{sumVal,jdbcType=VARCHAR},
      </if>
      <if test="tagModulus != null">
        #{tagModulus,jdbcType=DECIMAL},
      </if>
      <if test="meterType != null">
        #{meterType,jdbcType=VARCHAR},
      </if>
      <if test="meterScale != null">
        #{meterScale,jdbcType=DECIMAL},
      </if>
      <if test="meterLoc != null">
        #{meterLoc,jdbcType=VARCHAR},
      </if>
      <if test="tagBadSymbol != null">
        #{tagBadSymbol,jdbcType=VARCHAR},
      </if>
      <if test="sourceType != null">
        #{sourceType,jdbcType=VARCHAR},
      </if>
      <if test="recTime != null">
        #{recTime,jdbcType=VARCHAR},
      </if>
      <if test="issettle != null">
        #{issettle,jdbcType=VARCHAR},
      </if>
      <if test="isschedule != null">
        #{isschedule,jdbcType=VARCHAR},
      </if>
      <if test="tagCol != null">
        #{tagCol,jdbcType=VARCHAR},
      </if>
      <if test="mintimegranid != null">
        #{mintimegranid,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.trmcalpoint.model.TRmCalpoint">
    update T_RM_CALPOINT
    set ITEMNAME = #{itemname,jdbcType=VARCHAR},
      ITEMDESC = #{itemdesc,jdbcType=VARCHAR},
      LOCATEID = #{locateid,jdbcType=VARCHAR},
      NETWORKID = #{networkid,jdbcType=VARCHAR},
      ENERGYID = #{energyid,jdbcType=VARCHAR},
      ENERGYTYPEID = #{energytypeid,jdbcType=VARCHAR},
      UNITID = #{unitid,jdbcType=VARCHAR},
      COSTID = #{costid,jdbcType=VARCHAR},
      ITEMTYPE = #{itemtype,jdbcType=VARCHAR},
      PROPERTYID = #{propertyid,jdbcType=VARCHAR},
      TAGID = #{tagid,jdbcType=VARCHAR},
      TAGNAME = #{tagname,jdbcType=VARCHAR},
      TAG_ALIAS = #{tagAlias,jdbcType=VARCHAR},
      USEFLAG = #{useflag,jdbcType=VARCHAR},
      DEFAULTVALUE = #{defaultvalue,jdbcType=VARCHAR},
      DIGITS = #{digits,jdbcType=DECIMAL},
      SEQNO = #{seqno,jdbcType=DECIMAL},
      SHOWNO = #{showno,jdbcType=DECIMAL},
      STATUS = #{status,jdbcType=VARCHAR},
      NODE = #{node,jdbcType=VARCHAR},
      PARENTID = #{parentid,jdbcType=VARCHAR},
      BCODE = #{bcode,jdbcType=VARCHAR},
      BDESC1 = #{bdesc1,jdbcType=VARCHAR},
      BDESC2 = #{bdesc2,jdbcType=VARCHAR},
      BTYPE1 = #{btype1,jdbcType=VARCHAR},
      BTYPE2 = #{btype2,jdbcType=VARCHAR},
      RANGE_VAL = #{rangeVal,jdbcType=DECIMAL},
      TAG_ID_MAP = #{tagIdMap,jdbcType=VARCHAR},
      CALC_MOD = #{calcMod,jdbcType=VARCHAR},
      DATA_TYPE = #{dataType,jdbcType=VARCHAR},
      TAG_TABLE = #{tagTable,jdbcType=VARCHAR},
      MAX_VAL = #{maxVal,jdbcType=VARCHAR},
      MIN_VAL = #{minVal,jdbcType=VARCHAR},
      AVG_VAL = #{avgVal,jdbcType=VARCHAR},
      SUM_VAL = #{sumVal,jdbcType=VARCHAR},
      TAG_MODULUS = #{tagModulus,jdbcType=DECIMAL},
      METER_TYPE = #{meterType,jdbcType=VARCHAR},
      METER_SCALE = #{meterScale,jdbcType=DECIMAL},
      METER_LOC = #{meterLoc,jdbcType=VARCHAR},
      TAG_BAD_SYMBOL = #{tagBadSymbol,jdbcType=VARCHAR},
      SOURCE_TYPE = #{sourceType,jdbcType=VARCHAR},
      REC_TIME = #{recTime,jdbcType=VARCHAR},
      ISSETTLE = #{issettle,jdbcType=VARCHAR},
      ISSCHEDULE = #{isschedule,jdbcType=VARCHAR},
      TAG_COL = #{tagCol,jdbcType=VARCHAR},
      UPDATEMAN = #{updateman, jdbcType=VARCHAR},
      UPDATETIME = SYSDATE,
      MINTIMEGRANID = #{mintimegranid, jdbcType=VARCHAR}
    where ITEMID = #{itemid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.trmcalpoint.model.TRmCalpoint">
    update T_RM_CALPOINT
    <set>
      <if test="itemname != null">
        ITEMNAME = #{itemname,jdbcType=VARCHAR},
      </if>
      <if test="itemdesc != null">
        ITEMDESC = #{itemdesc,jdbcType=VARCHAR},
      </if>
      <if test="locateid != null">
        LOCATEID = #{locateid,jdbcType=VARCHAR},
      </if>
      <if test="networkid != null">
        NETWORKID = #{networkid,jdbcType=VARCHAR},
      </if>
      <if test="energyid != null">
        ENERGYID = #{energyid,jdbcType=VARCHAR},
      </if>
      <if test="energytypeid != null">
        ENERGYTYPEID = #{energytypeid,jdbcType=VARCHAR},
      </if>
      <if test="unitid != null">
        UNITID = #{unitid,jdbcType=VARCHAR},
      </if>
      <if test="costid != null">
        COSTID = #{costid,jdbcType=VARCHAR},
      </if>
      <if test="itemtype != null">
        ITEMTYPE = #{itemtype,jdbcType=VARCHAR},
      </if>
      <if test="propertyid != null">
        PROPERTYID = #{propertyid,jdbcType=VARCHAR},
      </if>
      <if test="tagid != null">
        TAGID = #{tagid,jdbcType=VARCHAR},
      </if>
      <if test="tagname != null">
        TAGNAME = #{tagname,jdbcType=VARCHAR},
      </if>
      <if test="tagAlias != null">
        TAG_ALIAS = #{tagAlias,jdbcType=VARCHAR},
      </if>
      <if test="useflag != null">
        USEFLAG = #{useflag,jdbcType=VARCHAR},
      </if>
      <if test="defaultvalue != null">
        DEFAULTVALUE = #{defaultvalue,jdbcType=VARCHAR},
      </if>
      <if test="digits != null">
        DIGITS = #{digits,jdbcType=DECIMAL},
      </if>
      <if test="seqno != null">
        SEQNO = #{seqno,jdbcType=DECIMAL},
      </if>
      <if test="showno != null">
        SHOWNO = #{showno,jdbcType=DECIMAL},
      </if>
      <if test="status != null">
        STATUS = #{status,jdbcType=VARCHAR},
      </if>
      <if test="node != null">
        NODE = #{node,jdbcType=VARCHAR},
      </if>
      <if test="parentid != null">
        PARENTID = #{parentid,jdbcType=VARCHAR},
      </if>
      <if test="bcode != null">
        BCODE = #{bcode,jdbcType=VARCHAR},
      </if>
      <if test="bdesc1 != null">
        BDESC1 = #{bdesc1,jdbcType=VARCHAR},
      </if>
      <if test="bdesc2 != null">
        BDESC2 = #{bdesc2,jdbcType=VARCHAR},
      </if>
      <if test="btype1 != null">
        BTYPE1 = #{btype1,jdbcType=VARCHAR},
      </if>
      <if test="btype2 != null">
        BTYPE2 = #{btype2,jdbcType=VARCHAR},
      </if>
      <if test="rangeVal != null">
        RANGE_VAL = #{rangeVal,jdbcType=DECIMAL},
      </if>
      <if test="tagIdMap != null">
        TAG_ID_MAP = #{tagIdMap,jdbcType=VARCHAR},
      </if>
      <if test="calcMod != null">
        CALC_MOD = #{calcMod,jdbcType=VARCHAR},
      </if>
      <if test="dataType != null">
        DATA_TYPE = #{dataType,jdbcType=VARCHAR},
      </if>
      <if test="tagTable != null">
        TAG_TABLE = #{tagTable,jdbcType=VARCHAR},
      </if>
      <if test="maxVal != null">
        MAX_VAL = #{maxVal,jdbcType=VARCHAR},
      </if>
      <if test="minVal != null">
        MIN_VAL = #{minVal,jdbcType=VARCHAR},
      </if>
      <if test="avgVal != null">
        AVG_VAL = #{avgVal,jdbcType=VARCHAR},
      </if>
      <if test="sumVal != null">
        SUM_VAL = #{sumVal,jdbcType=VARCHAR},
      </if>
      <if test="tagModulus != null">
        TAG_MODULUS = #{tagModulus,jdbcType=DECIMAL},
      </if>
      <if test="meterType != null">
        METER_TYPE = #{meterType,jdbcType=VARCHAR},
      </if>
      <if test="meterScale != null">
        METER_SCALE = #{meterScale,jdbcType=DECIMAL},
      </if>
      <if test="meterLoc != null">
        METER_LOC = #{meterLoc,jdbcType=VARCHAR},
      </if>
      <if test="tagBadSymbol != null">
        TAG_BAD_SYMBOL = #{tagBadSymbol,jdbcType=VARCHAR},
      </if>
      <if test="sourceType != null">
        SOURCE_TYPE = #{sourceType,jdbcType=VARCHAR},
      </if>
      <if test="recTime != null">
        REC_TIME = #{recTime,jdbcType=VARCHAR},
      </if>
      <if test="issettle != null">
        ISSETTLE = #{issettle,jdbcType=VARCHAR},
      </if>
      <if test="isschedule != null">
        ISSCHEDULE = #{isschedule,jdbcType=VARCHAR},
      </if>
      <if test="tagCol != null">
        TAG_COL = #{tagCol,jdbcType=VARCHAR},
      </if>
      <if test="updateman != null">
        UPDATEMAN = #{updateman, jdbcType=VARCHAR},
      </if>
      <if test="mintimegranid != null">
        MINTIMEGRANID = #{mintimegranid, jdbcType=VARCHAR},
      </if>
      <if test="updatetime != null">
        UPDATETIME = SYSDATE,
      </if>
    </set>
    where ITEMID = #{itemid,jdbcType=VARCHAR}
  </update>

  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select ITEMID, ITEMNAME, ITEMDESC, LOCATEID, NETWORKID, ENERGYID, ENERGYTYPEID, UNITID,
    COSTID, ITEMTYPE, PROPERTYID, TAGID, TAGNAME, TAG_ALIAS, USEFLAG, DEFAULTVALUE,
    DIGITS, SEQNO, SHOWNO, STATUS, NODE, PARENTID, BCODE, BDESC1, BDESC2, BTYPE1, BTYPE2, RANGE_VAL,
    TAG_ID_MAP, CALC_MOD, DATA_TYPE, TAG_TABLE, MAX_VAL, MIN_VAL, AVG_VAL, SUM_VAL, TAG_MODULUS,
    METER_TYPE, METER_SCALE, METER_LOC, TAG_BAD_SYMBOL, SOURCE_TYPE, REC_TIME, ISSETTLE,
    ISSCHEDULE, TAG_COL, UPDATEMAN, UPDATETIME, MINTIMEGRANID
    from T_RM_CALPOINT
    where ITEMID = #{itemid,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    select ITEMID, ITEMNAME, ITEMDESC, LOCATEID, NETWORKID, ENERGYID, ENERGYTYPEID, UNITID,
    COSTID, ITEMTYPE, PROPERTYID, TAGID, TAGNAME, TAG_ALIAS, USEFLAG, DEFAULTVALUE,
    DIGITS, SEQNO, SHOWNO, STATUS, NODE, PARENTID, BCODE, BDESC1, BDESC2, BTYPE1, BTYPE2, RANGE_VAL,
    TAG_ID_MAP, CALC_MOD, DATA_TYPE, TAG_TABLE, MAX_VAL, MIN_VAL, AVG_VAL, SUM_VAL, TAG_MODULUS,
    METER_TYPE, METER_SCALE, METER_LOC, TAG_BAD_SYMBOL, SOURCE_TYPE, REC_TIME, ISSETTLE,
    ISSCHEDULE, TAG_COL, UPDATEMAN, UPDATETIME, MINTIMEGRANID
    from T_RM_CALPOINT
    <where>
      <if test="itemid != null and itemid != ''">
        and ITEMID in (${itemid})
      </if>
      <if test="itemname != null and itemname != ''">
        and ITEMNAME = #{itemname}
      </if>
      <if test="itemdesc != null and itemdesc != ''">
        and ITEMDESC = #{itemdesc}
      </if>
      <if test="locateid != null and locateid != ''">
        and LOCATEID = #{locateid}
      </if>
      <if test="networkid != null and networkid != ''">
        and NETWORKID = #{networkid}
      </if>
      <if test="energyid != null and energyid != ''">
        and ENERGYID = #{energyid}
      </if>
      <if test="energytypeid != null and energytypeid != ''">
        and ENERGYTYPEID = #{energytypeid}
      </if>
      <if test="itemtype != null and itemtype != ''">
        and ITEMTYPE = #{itemtype}
      </if>
      <if test="propertyid != null and propertyid != ''">
        and PROPERTYID = #{propertyid}
      </if>
      <if test="unitid != null and unitid != ''">
        and UNITID = #{unitid}
      </if>
      <if test="costid != null and costid != ''">
        and COSTID = #{costid}
      </if>
      <if test="tagid != null and tagid != ''">
        and TAGID = #{tagid}
      </if>
      <if test="tagname != null and tagname != ''">
        and TAGNAME = #{tagname}
      </if>
      <if test="tagAlias != null and tagAlias != ''">
        and TAG_ALIAS = #{tagAlias}
      </if>
      <if test="useflag != null and useflag != ''">
        and USEFLAG = #{useflag}
      </if>
      <if test="defaultvalue != null and defaultvalue != ''">
        and DEFAULTVALUE = #{defaultvalue}
      </if>
      <if test="digits != null">
        and DIGITS = #{digits}
      </if>
      <if test="seqno != null">
        and SEQNO = #{seqno}
      </if>
      <if test="showno != null">
        and SHOWNO = #{showno}
      </if>
      <if test="status != null and status != ''">
        and STATUS = #{status}
      </if>
      <if test="node != null and node != ''">
        and NODE = #{node}
      </if>
      <if test="parentid != null and parentid != ''">
        and PARENTID = #{parentid}
      </if>
      <if test="bcode != null and bcode != ''">
        and BCODE = #{bcode}
      </if>
      <if test="bdesc1 != null and bdesc1 != ''">
        and BDESC1 = #{bdesc1}
      </if>
      <if test="bdesc2 != null and bdesc2 != ''">
        and BDESC2 = #{bdesc2}
      </if>
      <if test="btype1 != null and btype1 != ''">
        and BTYPE1 = #{btype1}
      </if>
      <if test="btype2 != null and btype2 != ''">
        and BTYPE2 = #{btype2}
      </if>
      <if test="rangeVal != null">
        and RANGE_VAL = #{rangeVal}
      </if>
      <if test="tagIdMap != null and tagIdMap != ''">
        and TAG_ID_MAP = #{tagIdMap}
      </if>
      <if test="calcMod != null and calcMod != ''">
        and CALC_MOD = #{calcMod}
      </if>
      <if test="dataType != null and dataType != ''">
        and DATA_TYPE = #{dataType}
      </if>
      <if test="tagTable != null and tagTable != ''">
        and TAG_TABLE = #{tagTable}
      </if>
      <if test="maxVal != null and maxVal != ''">
        and MAX_VAL = #{maxVal}
      </if>
      <if test="minVal != null and minVal != ''">
        and MIN_VAL = #{minVal}
      </if>
      <if test="avgVal != null and avgVal != ''">
        and AVG_VAL = #{avgVal}
      </if>
      <if test="sumVal != null and sumVal != ''">
        and SUM_VAL = #{sumVal}
      </if>
      <if test="tagModulus != null">
        and TAG_MODULUS = #{tagModulus}
      </if>
      <if test="meterType != null and meterType != ''">
        and METER_TYPE = #{meterType}
      </if>
      <if test="meterScale != null">
        and METER_SCALE = #{meterScale}
      </if>
      <if test="meterLoc != null and meterLoc != ''">
        and METER_LOC = #{meterLoc}
      </if>
      <if test="tagBadSymbol != null and tagBadSymbol != ''">
        and TAG_BAD_SYMBOL = #{tagBadSymbol}
      </if>
      <if test="sourceType != null and sourceType != ''">
        and SOURCE_TYPE = #{sourceType}
      </if>
      <if test="recTime != null and recTime != ''">
        and REC_TIME = #{recTime}
      </if>
      <if test="issettle != null and issettle != ''">
        and ISSETTLE = #{issettle}
      </if>
      <if test="isschedule != null and isschedule != ''">
        and ISSCHEDULE = #{isschedule}
      </if>
      <if test="tagCol != null and tagCol != ''">
        and TAG_COL = #{tagCol}
      </if>
      <if test="mintimegranid != null and mintimegranid != ''">
        and MINTIMEGRANID = #{mintimegranid}
      </if>
    </where>
    order by SHOWNO
  </select>
  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    select ITEMID, ITEMNAME, ITEMDESC, LOCATEID, NETWORKID, ENERGYID, ENERGYTYPEID, UNITID,
    COSTID, ITEMTYPE, PROPERTYID, TAGID, TAGNAME, TAG_ALIAS, USEFLAG, DEFAULTVALUE,
    DIGITS, SEQNO, SHOWNO, STATUS, NODE, PARENTID, BCODE, BDESC1, BDESC2, BTYPE1, BTYPE2, RANGE_VAL,
    TAG_ID_MAP, CALC_MOD, DATA_TYPE, TAG_TABLE, MAX_VAL, MIN_VAL, AVG_VAL, SUM_VAL, TAG_MODULUS,
    METER_TYPE, METER_SCALE, METER_LOC, TAG_BAD_SYMBOL, SOURCE_TYPE, REC_TIME, ISSETTLE,
    ISSCHEDULE, TAG_COL, UPDATEMAN, UPDATETIME, MINTIMEGRANID
    from T_RM_CALPOINT
    <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 LIKE '%${itemdesc}%'
      </if>
      <if test="locateid != null and locateid != ''">
        and locateid in (${locateid})
      </if>
      <if test="networkid != null and networkid != ''">
        and networkid in (${networkid})
      </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="itemtype != null and itemtype != ''">
        and ITEMTYPE = #{itemtype}
      </if>
      <if test="propertyid != null and propertyid != ''">
        and propertyid in (${propertyid})
      </if>
      <if test="unitid != null and unitid != ''">
        and UNITID LIKE '%${unitid}%'
      </if>
      <if test="costid != null and costid != ''">
        and COSTID LIKE '%${costid}%'
      </if>
      <if test="tagid != null and tagid != ''">
        and TAGID LIKE '%${tagid}%'
      </if>
      <if test="tagname != null and tagname != ''">
        and TAGNAME LIKE '%${tagname}%'
      </if>
      <if test="tagAlias != null and tagAlias != ''">
        and TAG_ALIAS LIKE '%${tagAlias}%'
      </if>
      <if test="useflag != null and useflag != ''">
        and USEFLAG = #{useflag}
      </if>
      <if test="defaultvalue != null and defaultvalue != ''">
        and DEFAULTVALUE = #{defaultvalue}
      </if>
      <if test="digits != null">
        and DIGITS = #{digits}
      </if>
      <if test="seqno != null">
        and SEQNO = #{seqno}
      </if>
      <if test="showno != null">
        and SHOWNO = #{showno}
      </if>
      <if test="status != null and status != ''">
        and STATUS LIKE '%${status}%'
      </if>
      <if test="node != null and node != ''">
        and NODE LIKE '%${node}%'
      </if>
      <if test="parentid != null and parentid != ''">
        and PARENTID LIKE '%${parentid}%'
      </if>
      <if test="bcode != null and bcode != ''">
        and BCODE LIKE '%${bcode}%'
      </if>
      <if test="bdesc1 != null and bdesc1 != ''">
        and BDESC1 LIKE '%${bdesc1}%'
      </if>
      <if test="bdesc2 != null and bdesc2 != ''">
        and BDESC2 LIKE '%${bdesc2}%'
      </if>
      <if test="btype1 != null and btype1 != ''">
        and BTYPE1 LIKE '%${btype1}%'
      </if>
      <if test="btype2 != null and btype2 != ''">
        and BTYPE2 LIKE '%${btype2}%'
      </if>
      <if test="rangeVal != null">
        and RANGE_VAL = #{rangeVal}
      </if>
      <if test="tagIdMap != null and tagIdMap != ''">
        and TAG_ID_MAP LIKE '%${tagIdMap}%'
      </if>
      <if test="calcMod != null and calcMod != ''">
        and CALC_MOD LIKE '%${calcMod}%'
      </if>
      <if test="dataType != null and dataType != ''">
        and DATA_TYPE LIKE '%${dataType}%'
      </if>
      <if test="tagTable != null and tagTable != ''">
        and TAG_TABLE LIKE '%${tagTable}%'
      </if>
      <if test="maxVal != null and maxVal != ''">
        and MAX_VAL LIKE '%${maxVal}%'
      </if>
      <if test="minVal != null and minVal != ''">
        and MIN_VAL LIKE '%${minVal}%'
      </if>
      <if test="avgVal != null and avgVal != ''">
        and AVG_VAL LIKE '%${avgVal}%'
      </if>
      <if test="sumVal != null and sumVal != ''">
        and SUM_VAL LIKE '%${sumVal}%'
      </if>
      <if test="tagModulus != null">
        and TAG_MODULUS = #{tagModulus}
      </if>
      <if test="meterType != null and meterType != ''">
        and METER_TYPE LIKE '%${meterType}%'
      </if>
      <if test="meterScale != null">
        and METER_SCALE = #{meterScale}
      </if>
      <if test="meterLoc != null and meterLoc != ''">
        and METER_LOC LIKE '%${meterLoc}%'
      </if>
      <if test="tagBadSymbol != null and tagBadSymbol != ''">
        and TAG_BAD_SYMBOL LIKE '%${tagBadSymbol}%'
      </if>
      <if test="sourceType != null and sourceType != ''">
        and SOURCE_TYPE LIKE '%${sourceType}%'
      </if>
      <if test="recTime != null and recTime != ''">
        and REC_TIME LIKE '%${recTime}%'
      </if>
      <if test="issettle != null and issettle != ''">
        and ISSETTLE LIKE '%${issettle}%'
      </if>
      <if test="isschedule != null and isschedule != ''">
        and ISSCHEDULE LIKE '%${isschedule}%'
      </if>
      <if test="tagCol != null and tagCol != ''">
        and TAG_COL LIKE '%${tagCol}%'
      </if>
      <if test="mintimegranid != null and mintimegranid != ''">
        and MINTIMEGRANID = #{mintimegranid}
      </if>
    </where>
  </select>
  <insert id="batchInsert" parameterType="java.util.List">
    insert into T_RM_CALPOINT
      (ITEMID,
      ITEMNAME, ITEMDESC, LOCATEID,
      NETWORKID, ENERGYID, ENERGYTYPEID,
      UNITID, COSTID, ITEMTYPE,
      PROPERTYID,TAGID,
      TAGNAME, TAG_ALIAS, USEFLAG,
      DEFAULTVALUE, DIGITS, SEQNO, SHOWNO,
      STATUS, NODE, PARENTID,
      BCODE, BDESC1, BDESC2,
      BTYPE1, BTYPE2, RANGE_VAL,
      TAG_ID_MAP, CALC_MOD, DATA_TYPE,
      TAG_TABLE, MAX_VAL, MIN_VAL,
      AVG_VAL, SUM_VAL, TAG_MODULUS,
      METER_TYPE, METER_SCALE, METER_LOC,
      TAG_BAD_SYMBOL, SOURCE_TYPE, REC_TIME,
      ISSETTLE, ISSCHEDULE, TAG_COL, MINTIMEGRANID
      )
    ( <foreach collection="list" item="item" separator="union all">
   select
      #{item.itemid,jdbcType=VARCHAR},
      #{item.itemname,jdbcType=VARCHAR}, #{item.itemdesc,jdbcType=VARCHAR}, #{item.locateid,jdbcType=VARCHAR},
      #{item.networkid,jdbcType=VARCHAR}, #{item.energyid,jdbcType=VARCHAR}, #{item.energytypeid,jdbcType=VARCHAR},
      #{item.unitid,jdbcType=VARCHAR}, #{item.costid,jdbcType=VARCHAR}, #{item.itemtype,jdbcType=VARCHAR},
      #{item.propertyid,jdbcType=VARCHAR}, #{item.tagid,jdbcType=VARCHAR},
      #{item.tagname,jdbcType=VARCHAR}, #{item.tagAlias,jdbcType=VARCHAR}, #{item.useflag,jdbcType=VARCHAR},
      #{item.defaultvalue,jdbcType=VARCHAR}, #{item.digits,jdbcType=DECIMAL}, #{item.seqno,jdbcType=DECIMAL},#{item.showno,jdbcType=DECIMAL},
      #{item.status,jdbcType=VARCHAR}, #{item.node,jdbcType=VARCHAR}, #{item.parentid,jdbcType=VARCHAR},
      #{item.bcode,jdbcType=VARCHAR}, #{item.bdesc1,jdbcType=VARCHAR}, #{item.bdesc2,jdbcType=VARCHAR},
      #{item.btype1,jdbcType=VARCHAR}, #{item.btype2,jdbcType=VARCHAR}, #{item.rangeVal,jdbcType=DECIMAL},
      #{item.tagIdMap,jdbcType=VARCHAR}, #{item.calcMod,jdbcType=VARCHAR}, #{item.dataType,jdbcType=VARCHAR},
      #{item.tagTable,jdbcType=VARCHAR}, #{item.maxVal,jdbcType=VARCHAR}, #{item.minVal,jdbcType=VARCHAR},
      #{item.avgVal,jdbcType=VARCHAR}, #{item.sumVal,jdbcType=VARCHAR}, #{item.tagModulus,jdbcType=DECIMAL},
      #{item.meterType,jdbcType=VARCHAR}, #{item.meterScale,jdbcType=DECIMAL}, #{item.meterLoc,jdbcType=VARCHAR},
      #{item.tagBadSymbol,jdbcType=VARCHAR}, #{item.sourceType,jdbcType=VARCHAR}, #{item.recTime,jdbcType=VARCHAR},
      #{item.issettle,jdbcType=VARCHAR}, #{item.isschedule,jdbcType=VARCHAR}, #{item.tagCol,jdbcType=VARCHAR}, #{item.mintimegranid,jdbcType=VARCHAR}
       from dual
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update T_RM_CALPOINT
     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>
       ,LOCATEID=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.locateid,jdbcType=VARCHAR}
       </foreach>
       ,NETWORKID=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.networkid,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>
       ,ENERGYTYPEID=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.energytypeid,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>
       ,COSTID=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.costid,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>
       ,TAGID=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.tagid,jdbcType=VARCHAR}
       </foreach>
       ,TAGNAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.tagname,jdbcType=VARCHAR}
       </foreach>
       ,TAG_ALIAS=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.tagAlias,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>
       ,DEFAULTVALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.defaultvalue,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>
       ,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>
       ,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>
       ,STATUS=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.status,jdbcType=VARCHAR}
       </foreach>
       ,NODE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.node,jdbcType=VARCHAR}
       </foreach>
       ,PARENTID=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.parentid,jdbcType=VARCHAR}
       </foreach>
       ,BCODE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.bcode,jdbcType=VARCHAR}
       </foreach>
       ,BDESC1=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.bdesc1,jdbcType=VARCHAR}
       </foreach>
       ,BDESC2=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.bdesc2,jdbcType=VARCHAR}
       </foreach>
       ,BTYPE1=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.btype1,jdbcType=VARCHAR}
       </foreach>
       ,BTYPE2=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.btype2,jdbcType=VARCHAR}
       </foreach>
       ,RANGE_VAL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.rangeVal,jdbcType=DECIMAL}
       </foreach>
       ,TAG_ID_MAP=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.tagIdMap,jdbcType=VARCHAR}
       </foreach>
       ,CALC_MOD=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.calcMod,jdbcType=VARCHAR}
       </foreach>
       ,DATA_TYPE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.dataType,jdbcType=VARCHAR}
       </foreach>
       ,TAG_TABLE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.tagTable,jdbcType=VARCHAR}
       </foreach>
       ,MAX_VAL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.maxVal,jdbcType=VARCHAR}
       </foreach>
       ,MIN_VAL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.minVal,jdbcType=VARCHAR}
       </foreach>
       ,AVG_VAL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.avgVal,jdbcType=VARCHAR}
       </foreach>
       ,SUM_VAL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.sumVal,jdbcType=VARCHAR}
       </foreach>
       ,TAG_MODULUS=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.tagModulus,jdbcType=DECIMAL}
       </foreach>
       ,METER_TYPE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.meterType,jdbcType=VARCHAR}
       </foreach>
       ,METER_SCALE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.meterScale,jdbcType=DECIMAL}
       </foreach>
       ,METER_LOC=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.meterLoc,jdbcType=VARCHAR}
       </foreach>
       ,TAG_BAD_SYMBOL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.tagBadSymbol,jdbcType=VARCHAR}
       </foreach>
       ,SOURCE_TYPE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.sourceType,jdbcType=VARCHAR}
       </foreach>
       ,REC_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.recTime,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>
       ,ISSCHEDULE=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.isschedule,jdbcType=VARCHAR}
       </foreach>
       ,TAG_COL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
          when #{item.itemid,jdbcType=VARCHAR} then #{item.tagCol,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>
        ,UPDATEMAN=
        <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
            when #{item.itemid,jdbcType=VARCHAR} then #{item.updateman,jdbcType=VARCHAR}
        </foreach>
        ,UPDATETIME=
        <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
            when #{item.itemid,jdbcType=VARCHAR} then SYSDATE
        </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_CALPOINT
    where ITEMID in
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>

    <!-- 获得计量层级列表（计量点数据录入） -->
    <select id="getRmCalpoint" resultType = "Map">
      SELECT ITEMID AS ID,ITEMNAME AS NAME FROM 
      (SELECT DISTINCT PARENTID FROM T_RM_CALPOINT WHERE PARENTID IS NOT NULL AND PARENTID  != ' ') B 
      LEFT JOIN T_RM_CALPOINT T ON B.PARENTID = T.ITEMID
      ORDER BY ITEMID
    </select>

  <select id="getMaxId" parameterType="com.steerinfo.ems.trmcalpoint.model.TRmCalpoint" resultType="string">
    SELECT MAX(SUBSTR(ITEMID, 10)) FROM T_RM_CALPOINT
    where ITEMID like '${head}%'
  </select>
  
  <!-- 能源调度管理-计量点数据管理-计量点数据录入列表 -->
  <select id="getDate312" parameterType="java.util.HashMap" resultType = "Map">
    select timegranid,itemtype,clock,t.itemid,t.itemname,t.tag_alias,t.tag_modulus,t.unitid,t.propertyid,v.mintvalue,v.mendvalue,
    v.actualvalue,v.correctvalue,v.apportvalue,v.sumvalue,v.bz,v.crman,v.rec_time,v.upman,v.uptime,
    v.update_reason,e.name ename,nvl(l.name, '') lname
    from T_RM_CALPOINT t 
    left join T_RM_CALPOINT_VALUE v on t.itemid = v.itemid
    inner join T_RM_ENERGY e on t.ENERGYID = e.ID
    left join T_RM_LOCATION l on t.LOCATEID = l.ID
    where t.useflag = 1
    <if test="itemid != null and itemid != ''">
      and t.ITEMID in (${itemid})
    </if>
    <if test="timegranid != null and timegranid != ''">
       and TIMEGRANID = #{timegranid}
    </if>
    <if test="clock != null and clock != ''">
      and CLOCK &gt;= #{clock}
    </if>
    <if test="clocke != null and clocke != ''">
      and CLOCK &lt;= #{clocke}
    </if>
    <if test="itemname != null and itemname != ''">
      and t.ITEMNAME LIKE '%${itemname}%'
    </if>
    <if test="tagAlias != null and tagAlias != ''">
      and t.TAG_ALIAS LIKE '%${tagAlias}%'
    </if>
    <if test="locateid != null and locateid != ''">
      ${locateid}
    </if>
    <if test="energyid != null and energyid != ''">
      ${energyid}
    </if>
    <if test="propertyid != null and propertyid != ''">
      ${propertyid}
    </if>
    <if test="energytypeid != null and energytypeid != ''">
      ${energytypeid}
    </if>
    <if test="networkid != null and networkid != ''">
      and NETWORKID = #{networkid}
    </if>
    <if test="itemtype != null and itemtype != ''">
      and ITEMTYPE = #{itemtype}
    </if>
    order by clock,t.itemid
  </select>
  
  <!-- 系统接口管理-能耗数据管理 -->
  <select id="getInIdDate312" parameterType="java.util.HashMap" resultType = "Map">
    select timegranid,itemtype,clock,t.itemid,t.itemname,t.tag_alias,t.tag_modulus,t.unitid,v.mintvalue,v.mendvalue,
    v.actualvalue,v.correctvalue,v.apportvalue,v.sumvalue,v.bz,v.rec_time,v.upman,v.update_reason
    from T_RM_CALPOINT t 
    left join T_RM_CALPOINT_VALUE v on t.itemid = v.itemid
    where t.useflag = 1
    <if test="itemid != null and itemid != ''">
      and t.ITEMID in ('${itemid}')
    </if>
    <if test="timegranid != null and timegranid != ''">
       and TIMEGRANID = #{timegranid}
    </if>
    <if test="clock != null and clock != ''">
      and CLOCK = #{clock}
    </if>
    <if test="itemname != null and itemname != ''">
      and t.ITEMNAME LIKE '%${itemname}%'
    </if>
    <if test="tagAlias != null and tagAlias != ''">
      and t.TAG_ALIAS LIKE '%${tagAlias}%'
    </if>
    <if test="locateid != null and locateid != ''">
      and LOCATEID = #{locateid}
    </if>
    <if test="energyid != null and energyid != ''">
      and ENERGYID = #{energyid}
    </if>
    <if test="energytypeid != null and energytypeid != ''">
      and ENERGYTYPEID = #{energytypeid}
    </if>
    <if test="networkid != null and networkid != ''">
      and NETWORKID = #{networkid}
    </if>
    <if test="itemtype != null and itemtype != ''">
      and ITEMTYPE = #{itemtype}
    </if>
    order by clock,t.itemid
  </select>

  <!-- 能源调度管理-计量点数据管理-计量点数据趋势图 -->
  <select id="getDate312ForChart" parameterType="java.util.HashMap" resultType = "Map">
    select clock,apportvalue from
    (select clock,apportvalue,rownum r from T_RM_CALPOINT_VALUE
    where itemid = #{itemid} and timegranid = #{timegranid}
    and clock &lt;= #{clock} order by clock desc)
    where r &lt;= #{size}
    order by clock
  </select>

  <update id="updateNewItem" parameterType="java.util.HashMap">
    update T_RM_CALPOINT
    <set>
      LOCATEID = #{locateid,jdbcType=VARCHAR},
      ENERGYID = #{energyid,jdbcType=VARCHAR},
      ENERGYTYPEID = #{energytypeid,jdbcType=VARCHAR},
      PROPERTYID = #{propertyid,jdbcType=VARCHAR},
      ITEMNAME = #{itemname,jdbcType=VARCHAR},
      <if test="itemdesc != null">
        ITEMDESC = #{itemdesc,jdbcType=VARCHAR},
      </if>
      <if test="networkid != null">
        NETWORKID = #{networkid,jdbcType=VARCHAR},
      </if>
      <if test="unitid != null">
        UNITID = #{unitid,jdbcType=VARCHAR},
      </if>
      <if test="itemtype != null">
        ITEMTYPE = #{itemtype,jdbcType=VARCHAR},
      </if>
      <if test="tagid != null">
        TAGID = #{tagid,jdbcType=VARCHAR},
      </if>
      <if test="tagname != null">
        TAGNAME = #{tagname,jdbcType=VARCHAR},
      </if>
      <if test="tagAlias != null">
        TAG_ALIAS = #{tagAlias,jdbcType=VARCHAR},
      </if>
      <if test="useflag != null">
        USEFLAG = #{useflag,jdbcType=VARCHAR},
      </if>
      <if test="defaultvalue != null">
        DEFAULTVALUE = #{defaultvalue,jdbcType=VARCHAR},
      </if>
      <if test="digits != null">
        DIGITS = #{digits,jdbcType=DECIMAL},
      </if>
      <if test="seqno != null">
        SEQNO = #{seqno,jdbcType=DECIMAL},
      </if>
      <if test="showno != null">
        SHOWNO = #{showno,jdbcType=DECIMAL},
      </if>
      <if test="status != null">
        STATUS = #{status,jdbcType=VARCHAR},
      </if>
      <if test="node != null">
        NODE = #{node,jdbcType=VARCHAR},
      </if>
      <if test="parentid != null">
        PARENTID = #{parentid,jdbcType=VARCHAR},
      </if>
      <if test="bcode != null">
        BCODE = #{bcode,jdbcType=VARCHAR},
      </if>
      <if test="bdesc1 != null">
        BDESC1 = #{bdesc1,jdbcType=VARCHAR},
      </if>
      <if test="bdesc2 != null">
        BDESC2 = #{bdesc2,jdbcType=VARCHAR},
      </if>
      <if test="btype1 != null">
        BTYPE1 = #{btype1,jdbcType=VARCHAR},
      </if>
      <if test="btype2 != null">
        BTYPE2 = #{btype2,jdbcType=VARCHAR},
      </if>
      <if test="rangeVal != null">
        RANGE_VAL = #{rangeVal,jdbcType=DECIMAL},
      </if>
      <if test="tagIdMap != null">
        TAG_ID_MAP = #{tagIdMap,jdbcType=VARCHAR},
      </if>
      <if test="calcMod != null">
        CALC_MOD = #{calcMod,jdbcType=VARCHAR},
      </if>
      <if test="dataType != null">
        DATA_TYPE = #{dataType,jdbcType=VARCHAR},
      </if>
      <if test="tagTable != null">
        TAG_TABLE = #{tagTable,jdbcType=VARCHAR},
      </if>
      <if test="maxVal != null">
        MAX_VAL = #{maxVal,jdbcType=VARCHAR},
      </if>
      <if test="minVal != null">
        MIN_VAL = #{minVal,jdbcType=VARCHAR},
      </if>
      <if test="avgVal != null">
        AVG_VAL = #{avgVal,jdbcType=VARCHAR},
      </if>
      <if test="sumVal != null">
        SUM_VAL = #{sumVal,jdbcType=VARCHAR},
      </if>
      <if test="tagModulus != null">
        TAG_MODULUS = #{tagModulus,jdbcType=DECIMAL},
      </if>
      <if test="meterType != null">
        METER_TYPE = #{meterType,jdbcType=VARCHAR},
      </if>
      <if test="meterScale != null">
        METER_SCALE = #{meterScale,jdbcType=DECIMAL},
      </if>
      <if test="meterLoc != null">
        METER_LOC = #{meterLoc,jdbcType=VARCHAR},
      </if>
      <if test="tagBadSymbol != null">
        TAG_BAD_SYMBOL = #{tagBadSymbol,jdbcType=VARCHAR},
      </if>
      <if test="sourceType != null">
        SOURCE_TYPE = #{sourceType,jdbcType=VARCHAR},
      </if>
      <if test="recTime != null">
        REC_TIME = #{recTime,jdbcType=VARCHAR},
      </if>
      <if test="issettle != null">
        ISSETTLE = #{issettle,jdbcType=VARCHAR},
      </if>
      <if test="isschedule != null">
        ISSCHEDULE = #{isschedule,jdbcType=VARCHAR},
      </if>
      <if test="tagCol != null">
        TAG_COL = #{tagCol,jdbcType=VARCHAR},
      </if>
      <if test="mintimegranid != null">
        MINTIMEGRANID = #{mintimegranid,jdbcType=VARCHAR},
      </if>
    </set>
    where ITEMID = #{itemid,jdbcType=VARCHAR}
  </update>
  
  <select id="selectCalpoints" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    select ITEMID, ITEMNAME, ITEMDESC, LOCATEID, NETWORKID, ENERGYID, ENERGYTYPEID, UNITID,
    COSTID, ITEMTYPE, PROPERTYID, TAGID, TAGNAME, TAG_ALIAS, USEFLAG, DEFAULTVALUE,
    DIGITS, SEQNO, SHOWNO, STATUS, NODE, PARENTID, BCODE, BDESC1, BDESC2, BTYPE1, BTYPE2, RANGE_VAL,
    TAG_ID_MAP, CALC_MOD, DATA_TYPE, TAG_TABLE, MAX_VAL, MIN_VAL, AVG_VAL, SUM_VAL, TAG_MODULUS,
    METER_TYPE, METER_SCALE, METER_LOC, TAG_BAD_SYMBOL, SOURCE_TYPE, REC_TIME, ISSETTLE,
    ISSCHEDULE, TAG_COL, MINTIMEGRANID
    from T_RM_CALPOINT
    <where>
      <if test="itemid != null and itemid != ''">
        and ITEMID in (${itemid})
      </if>
      <if test="itemname != null and itemname != ''">
        and ITEMNAME = #{itemname}
      </if>
      <if test="itemdesc != null and itemdesc != ''">
        and ITEMDESC = #{itemdesc}
      </if>
      <if test="locateid != null and locateid != ''">
        and LOCATEID = #{locateid}
      </if>
      <if test="networkid != null and networkid != ''">
        and NETWORKID = #{networkid}
      </if>
      <if test="energyid != null and energyid != ''">
        and ENERGYID = #{energyid}
      </if>
      <if test="energytypeid != null and energytypeid != ''">
        and ENERGYTYPEID = #{energytypeid}
      </if>
      <if test="itemtype != null and itemtype != ''">
        and ITEMTYPE = #{itemtype}
      </if>
      <if test="propertyid != null and propertyid != ''">
        and PROPERTYID = #{propertyid}
      </if>
      <if test="unitid != null and unitid != ''">
        and UNITID = #{unitid}
      </if>
      <if test="costid != null and costid != ''">
        and COSTID = #{costid}
      </if>
      <if test="tagid != null and tagid != ''">
        and TAGID = #{tagid}
      </if>
      <if test="tagname != null and tagname != ''">
        and TAGNAME = #{tagname}
      </if>
      <if test="tagAlias != null and tagAlias != ''">
        and TAG_ALIAS = #{tagAlias}
      </if>
      <if test="useflag != null and useflag != ''">
        and USEFLAG = #{useflag}
      </if>
      <if test="defaultvalue != null and defaultvalue != ''">
        and DEFAULTVALUE = #{defaultvalue}
      </if>
      <if test="digits != null">
        and DIGITS = #{digits}
      </if>
      <if test="status != null and status != ''">
        and STATUS = #{status}
      </if>
      <if test="rangeVal != null">
        and RANGE_VAL = #{rangeVal}
      </if>
      <if test="tagIdMap != null and tagIdMap != ''">
        and TAG_ID_MAP = #{tagIdMap}
      </if>
      <if test="calcMod != null and calcMod != ''">
        and CALC_MOD = #{calcMod}
      </if>
      <if test="dataType != null and dataType != ''">
        and DATA_TYPE = #{dataType}
      </if>
      <if test="tagTable != null and tagTable != ''">
        and TAG_TABLE = #{tagTable}
      </if>
      <if test="maxVal != null and maxVal != ''">
        and MAX_VAL = #{maxVal}
      </if>
      <if test="minVal != null and minVal != ''">
        and MIN_VAL = #{minVal}
      </if>
      <if test="avgVal != null and avgVal != ''">
        and AVG_VAL = #{avgVal}
      </if>
      <if test="sumVal != null and sumVal != ''">
        and SUM_VAL = #{sumVal}
      </if>
      <if test="tagModulus != null">
        and TAG_MODULUS = #{tagModulus}
      </if>
      <if test="sourceType != null and sourceType != ''">
        and SOURCE_TYPE = #{sourceType}
      </if>
      <if test="tagCol != null and tagCol != ''">
        and TAG_COL = #{tagCol}
      </if>
      <if test="mintimegranid != null and mintimegranid != ''">
        and MINTIMEGRANID = #{mintimegranid}
      </if>
    </where>
    order by itemtype, seqno
  </select>
</mapper>