<?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.gyee.frame.mapper.auto.MetricsMapper">
  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.Metrics">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="DECIMAL" property="id" />
    <result column="THING" jdbcType="VARCHAR" property="thing" />
    <result column="METRICID" jdbcType="VARCHAR" property="metricid" />
    <result column="METRICNAME" jdbcType="VARCHAR" property="metricname" />
    <result column="UNITNAME" jdbcType="VARCHAR" property="unitname" />
    <result column="UNITNAMECN" jdbcType="VARCHAR" property="unitnamecn" />
    <result column="THINGSUB" jdbcType="VARCHAR" property="thingsub" />
    <result column="THINGSUBSUB" jdbcType="VARCHAR" property="thingsubsub" />
    <result column="CATEGORYDATA" jdbcType="VARCHAR" property="categorydata" />
    <result column="CATEGORYSCI" jdbcType="VARCHAR" property="categorysci" />
    <result column="CATEGORYSYS" jdbcType="VARCHAR" property="categorysys" />
    <result column="CATEGORYRES1" jdbcType="VARCHAR" property="categoryres1" />
    <result column="CATEGORYRES2" jdbcType="VARCHAR" property="categoryres2" />
    <result column="CATEGORYRES3" jdbcType="VARCHAR" property="categoryres3" />
    <result column="CATEGORYRES4" jdbcType="VARCHAR" property="categoryres4" />
    <result column="CATEGORYRES5" jdbcType="VARCHAR" property="categoryres5" />
    <result column="DESCRIPTION" jdbcType="VARCHAR" property="description" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    ID, THING, METRICID, METRICNAME, UNITNAME, UNITNAMECN, THINGSUB, THINGSUBSUB, CATEGORYDATA, 
    CATEGORYSCI, CATEGORYSYS, CATEGORYRES1, CATEGORYRES2, CATEGORYRES3, CATEGORYRES4, 
    CATEGORYRES5, DESCRIPTION
  </sql>
  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.MetricsExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from METRICS
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from METRICS
    where ID = #{id,jdbcType=DECIMAL}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from METRICS
    where ID = #{id,jdbcType=DECIMAL}
  </delete>
  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.MetricsExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from METRICS
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.gyee.frame.model.auto.Metrics">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into METRICS (ID, THING, METRICID, 
      METRICNAME, UNITNAME, UNITNAMECN, 
      THINGSUB, THINGSUBSUB, CATEGORYDATA, 
      CATEGORYSCI, CATEGORYSYS, CATEGORYRES1, 
      CATEGORYRES2, CATEGORYRES3, CATEGORYRES4, 
      CATEGORYRES5, DESCRIPTION)
    values (#{id,jdbcType=DECIMAL}, #{thing,jdbcType=VARCHAR}, #{metricid,jdbcType=VARCHAR}, 
      #{metricname,jdbcType=VARCHAR}, #{unitname,jdbcType=VARCHAR}, #{unitnamecn,jdbcType=VARCHAR}, 
      #{thingsub,jdbcType=VARCHAR}, #{thingsubsub,jdbcType=VARCHAR}, #{categorydata,jdbcType=VARCHAR}, 
      #{categorysci,jdbcType=VARCHAR}, #{categorysys,jdbcType=VARCHAR}, #{categoryres1,jdbcType=VARCHAR}, 
      #{categoryres2,jdbcType=VARCHAR}, #{categoryres3,jdbcType=VARCHAR}, #{categoryres4,jdbcType=VARCHAR}, 
      #{categoryres5,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.Metrics">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into METRICS
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="thing != null">
        THING,
      </if>
      <if test="metricid != null">
        METRICID,
      </if>
      <if test="metricname != null">
        METRICNAME,
      </if>
      <if test="unitname != null">
        UNITNAME,
      </if>
      <if test="unitnamecn != null">
        UNITNAMECN,
      </if>
      <if test="thingsub != null">
        THINGSUB,
      </if>
      <if test="thingsubsub != null">
        THINGSUBSUB,
      </if>
      <if test="categorydata != null">
        CATEGORYDATA,
      </if>
      <if test="categorysci != null">
        CATEGORYSCI,
      </if>
      <if test="categorysys != null">
        CATEGORYSYS,
      </if>
      <if test="categoryres1 != null">
        CATEGORYRES1,
      </if>
      <if test="categoryres2 != null">
        CATEGORYRES2,
      </if>
      <if test="categoryres3 != null">
        CATEGORYRES3,
      </if>
      <if test="categoryres4 != null">
        CATEGORYRES4,
      </if>
      <if test="categoryres5 != null">
        CATEGORYRES5,
      </if>
      <if test="description != null">
        DESCRIPTION,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=DECIMAL},
      </if>
      <if test="thing != null">
        #{thing,jdbcType=VARCHAR},
      </if>
      <if test="metricid != null">
        #{metricid,jdbcType=VARCHAR},
      </if>
      <if test="metricname != null">
        #{metricname,jdbcType=VARCHAR},
      </if>
      <if test="unitname != null">
        #{unitname,jdbcType=VARCHAR},
      </if>
      <if test="unitnamecn != null">
        #{unitnamecn,jdbcType=VARCHAR},
      </if>
      <if test="thingsub != null">
        #{thingsub,jdbcType=VARCHAR},
      </if>
      <if test="thingsubsub != null">
        #{thingsubsub,jdbcType=VARCHAR},
      </if>
      <if test="categorydata != null">
        #{categorydata,jdbcType=VARCHAR},
      </if>
      <if test="categorysci != null">
        #{categorysci,jdbcType=VARCHAR},
      </if>
      <if test="categorysys != null">
        #{categorysys,jdbcType=VARCHAR},
      </if>
      <if test="categoryres1 != null">
        #{categoryres1,jdbcType=VARCHAR},
      </if>
      <if test="categoryres2 != null">
        #{categoryres2,jdbcType=VARCHAR},
      </if>
      <if test="categoryres3 != null">
        #{categoryres3,jdbcType=VARCHAR},
      </if>
      <if test="categoryres4 != null">
        #{categoryres4,jdbcType=VARCHAR},
      </if>
      <if test="categoryres5 != null">
        #{categoryres5,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.gyee.frame.model.auto.MetricsExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from METRICS
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update METRICS
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=DECIMAL},
      </if>
      <if test="record.thing != null">
        THING = #{record.thing,jdbcType=VARCHAR},
      </if>
      <if test="record.metricid != null">
        METRICID = #{record.metricid,jdbcType=VARCHAR},
      </if>
      <if test="record.metricname != null">
        METRICNAME = #{record.metricname,jdbcType=VARCHAR},
      </if>
      <if test="record.unitname != null">
        UNITNAME = #{record.unitname,jdbcType=VARCHAR},
      </if>
      <if test="record.unitnamecn != null">
        UNITNAMECN = #{record.unitnamecn,jdbcType=VARCHAR},
      </if>
      <if test="record.thingsub != null">
        THINGSUB = #{record.thingsub,jdbcType=VARCHAR},
      </if>
      <if test="record.thingsubsub != null">
        THINGSUBSUB = #{record.thingsubsub,jdbcType=VARCHAR},
      </if>
      <if test="record.categorydata != null">
        CATEGORYDATA = #{record.categorydata,jdbcType=VARCHAR},
      </if>
      <if test="record.categorysci != null">
        CATEGORYSCI = #{record.categorysci,jdbcType=VARCHAR},
      </if>
      <if test="record.categorysys != null">
        CATEGORYSYS = #{record.categorysys,jdbcType=VARCHAR},
      </if>
      <if test="record.categoryres1 != null">
        CATEGORYRES1 = #{record.categoryres1,jdbcType=VARCHAR},
      </if>
      <if test="record.categoryres2 != null">
        CATEGORYRES2 = #{record.categoryres2,jdbcType=VARCHAR},
      </if>
      <if test="record.categoryres3 != null">
        CATEGORYRES3 = #{record.categoryres3,jdbcType=VARCHAR},
      </if>
      <if test="record.categoryres4 != null">
        CATEGORYRES4 = #{record.categoryres4,jdbcType=VARCHAR},
      </if>
      <if test="record.categoryres5 != null">
        CATEGORYRES5 = #{record.categoryres5,jdbcType=VARCHAR},
      </if>
      <if test="record.description != null">
        DESCRIPTION = #{record.description,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update METRICS
    set ID = #{record.id,jdbcType=DECIMAL},
      THING = #{record.thing,jdbcType=VARCHAR},
      METRICID = #{record.metricid,jdbcType=VARCHAR},
      METRICNAME = #{record.metricname,jdbcType=VARCHAR},
      UNITNAME = #{record.unitname,jdbcType=VARCHAR},
      UNITNAMECN = #{record.unitnamecn,jdbcType=VARCHAR},
      THINGSUB = #{record.thingsub,jdbcType=VARCHAR},
      THINGSUBSUB = #{record.thingsubsub,jdbcType=VARCHAR},
      CATEGORYDATA = #{record.categorydata,jdbcType=VARCHAR},
      CATEGORYSCI = #{record.categorysci,jdbcType=VARCHAR},
      CATEGORYSYS = #{record.categorysys,jdbcType=VARCHAR},
      CATEGORYRES1 = #{record.categoryres1,jdbcType=VARCHAR},
      CATEGORYRES2 = #{record.categoryres2,jdbcType=VARCHAR},
      CATEGORYRES3 = #{record.categoryres3,jdbcType=VARCHAR},
      CATEGORYRES4 = #{record.categoryres4,jdbcType=VARCHAR},
      CATEGORYRES5 = #{record.categoryres5,jdbcType=VARCHAR},
      DESCRIPTION = #{record.description,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.Metrics">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update METRICS
    <set>
      <if test="thing != null">
        THING = #{thing,jdbcType=VARCHAR},
      </if>
      <if test="metricid != null">
        METRICID = #{metricid,jdbcType=VARCHAR},
      </if>
      <if test="metricname != null">
        METRICNAME = #{metricname,jdbcType=VARCHAR},
      </if>
      <if test="unitname != null">
        UNITNAME = #{unitname,jdbcType=VARCHAR},
      </if>
      <if test="unitnamecn != null">
        UNITNAMECN = #{unitnamecn,jdbcType=VARCHAR},
      </if>
      <if test="thingsub != null">
        THINGSUB = #{thingsub,jdbcType=VARCHAR},
      </if>
      <if test="thingsubsub != null">
        THINGSUBSUB = #{thingsubsub,jdbcType=VARCHAR},
      </if>
      <if test="categorydata != null">
        CATEGORYDATA = #{categorydata,jdbcType=VARCHAR},
      </if>
      <if test="categorysci != null">
        CATEGORYSCI = #{categorysci,jdbcType=VARCHAR},
      </if>
      <if test="categorysys != null">
        CATEGORYSYS = #{categorysys,jdbcType=VARCHAR},
      </if>
      <if test="categoryres1 != null">
        CATEGORYRES1 = #{categoryres1,jdbcType=VARCHAR},
      </if>
      <if test="categoryres2 != null">
        CATEGORYRES2 = #{categoryres2,jdbcType=VARCHAR},
      </if>
      <if test="categoryres3 != null">
        CATEGORYRES3 = #{categoryres3,jdbcType=VARCHAR},
      </if>
      <if test="categoryres4 != null">
        CATEGORYRES4 = #{categoryres4,jdbcType=VARCHAR},
      </if>
      <if test="categoryres5 != null">
        CATEGORYRES5 = #{categoryres5,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        DESCRIPTION = #{description,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=DECIMAL}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.Metrics">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update METRICS
    set THING = #{thing,jdbcType=VARCHAR},
      METRICID = #{metricid,jdbcType=VARCHAR},
      METRICNAME = #{metricname,jdbcType=VARCHAR},
      UNITNAME = #{unitname,jdbcType=VARCHAR},
      UNITNAMECN = #{unitnamecn,jdbcType=VARCHAR},
      THINGSUB = #{thingsub,jdbcType=VARCHAR},
      THINGSUBSUB = #{thingsubsub,jdbcType=VARCHAR},
      CATEGORYDATA = #{categorydata,jdbcType=VARCHAR},
      CATEGORYSCI = #{categorysci,jdbcType=VARCHAR},
      CATEGORYSYS = #{categorysys,jdbcType=VARCHAR},
      CATEGORYRES1 = #{categoryres1,jdbcType=VARCHAR},
      CATEGORYRES2 = #{categoryres2,jdbcType=VARCHAR},
      CATEGORYRES3 = #{categoryres3,jdbcType=VARCHAR},
      CATEGORYRES4 = #{categoryres4,jdbcType=VARCHAR},
      CATEGORYRES5 = #{categoryres5,jdbcType=VARCHAR},
      DESCRIPTION = #{description,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=DECIMAL}
  </update>
</mapper>