<?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.chinaitop.depot.intelligent.basicdata.mapper.TNNtinfoHistoryMapper" >
  <resultMap id="BaseResultMap" type="com.chinaitop.depot.intelligent.basicdata.model.TNNtinfoHistory" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="vcfcode" property="vcfcode" jdbcType="VARCHAR" />
    <result column="vdevcode" property="vdevcode" jdbcType="VARCHAR" />
    <result column="vdevname" property="vdevname" jdbcType="VARCHAR" />
    <result column="starttime" property="starttime" jdbcType="TIMESTAMP" />
    <result column="endtime" property="endtime" jdbcType="TIMESTAMP" />
    <result column="energy" property="energy" jdbcType="DECIMAL" />
    <result column="uperson" property="uperson" jdbcType="VARCHAR" />
    <result column="remark" property="remark" jdbcType="VARCHAR" />
    <result column="org_id" property="orgId" jdbcType="VARCHAR" />
    <result column="statue" property="statue" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause" >
    <where >
      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    id, vcfcode, vdevcode, vdevname, starttime, endtime, energy, uperson, remark, org_id, 
    statue
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TNNtinfoHistoryExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_n_ntinfo_history
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from t_n_ntinfo_history
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from t_n_ntinfo_history
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TNNtinfoHistoryExample" >
    delete from t_n_ntinfo_history
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TNNtinfoHistory" >
    insert into t_n_ntinfo_history (id, vcfcode, vdevcode, 
      vdevname, starttime, endtime, 
      energy, uperson, remark, 
      org_id, statue)
    values (#{id,jdbcType=VARCHAR}, #{vcfcode,jdbcType=VARCHAR}, #{vdevcode,jdbcType=VARCHAR}, 
      #{vdevname,jdbcType=VARCHAR}, #{starttime,jdbcType=TIMESTAMP}, #{endtime,jdbcType=TIMESTAMP}, 
      #{energy,jdbcType=DECIMAL}, #{uperson,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
      #{orgId,jdbcType=VARCHAR}, #{statue,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TNNtinfoHistory" >
    insert into t_n_ntinfo_history
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="vcfcode != null" >
        vcfcode,
      </if>
      <if test="vdevcode != null" >
        vdevcode,
      </if>
      <if test="vdevname != null" >
        vdevname,
      </if>
      <if test="starttime != null" >
        starttime,
      </if>
      <if test="endtime != null" >
        endtime,
      </if>
      <if test="energy != null" >
        energy,
      </if>
      <if test="uperson != null" >
        uperson,
      </if>
      <if test="remark != null" >
        remark,
      </if>
      <if test="orgId != null" >
        org_id,
      </if>
      <if test="statue != null" >
        statue,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="vcfcode != null" >
        #{vcfcode,jdbcType=VARCHAR},
      </if>
      <if test="vdevcode != null" >
        #{vdevcode,jdbcType=VARCHAR},
      </if>
      <if test="vdevname != null" >
        #{vdevname,jdbcType=VARCHAR},
      </if>
      <if test="starttime != null" >
        #{starttime,jdbcType=TIMESTAMP},
      </if>
      <if test="endtime != null" >
        #{endtime,jdbcType=TIMESTAMP},
      </if>
      <if test="energy != null" >
        #{energy,jdbcType=DECIMAL},
      </if>
      <if test="uperson != null" >
        #{uperson,jdbcType=VARCHAR},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null" >
        #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="statue != null" >
        #{statue,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TNNtinfoHistoryExample" resultType="java.lang.Integer" >
    select count(*) from t_n_ntinfo_history
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update t_n_ntinfo_history
    <set >
      <if test="record.id != null" >
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.vcfcode != null" >
        vcfcode = #{record.vcfcode,jdbcType=VARCHAR},
      </if>
      <if test="record.vdevcode != null" >
        vdevcode = #{record.vdevcode,jdbcType=VARCHAR},
      </if>
      <if test="record.vdevname != null" >
        vdevname = #{record.vdevname,jdbcType=VARCHAR},
      </if>
      <if test="record.starttime != null" >
        starttime = #{record.starttime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.endtime != null" >
        endtime = #{record.endtime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.energy != null" >
        energy = #{record.energy,jdbcType=DECIMAL},
      </if>
      <if test="record.uperson != null" >
        uperson = #{record.uperson,jdbcType=VARCHAR},
      </if>
      <if test="record.remark != null" >
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.orgId != null" >
        org_id = #{record.orgId,jdbcType=VARCHAR},
      </if>
      <if test="record.statue != null" >
        statue = #{record.statue,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update t_n_ntinfo_history
    set id = #{record.id,jdbcType=VARCHAR},
      vcfcode = #{record.vcfcode,jdbcType=VARCHAR},
      vdevcode = #{record.vdevcode,jdbcType=VARCHAR},
      vdevname = #{record.vdevname,jdbcType=VARCHAR},
      starttime = #{record.starttime,jdbcType=TIMESTAMP},
      endtime = #{record.endtime,jdbcType=TIMESTAMP},
      energy = #{record.energy,jdbcType=DECIMAL},
      uperson = #{record.uperson,jdbcType=VARCHAR},
      remark = #{record.remark,jdbcType=VARCHAR},
      org_id = #{record.orgId,jdbcType=VARCHAR},
      statue = #{record.statue,jdbcType=INTEGER}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TNNtinfoHistory" >
    update t_n_ntinfo_history
    <set >
      <if test="vcfcode != null" >
        vcfcode = #{vcfcode,jdbcType=VARCHAR},
      </if>
      <if test="vdevcode != null" >
        vdevcode = #{vdevcode,jdbcType=VARCHAR},
      </if>
      <if test="vdevname != null" >
        vdevname = #{vdevname,jdbcType=VARCHAR},
      </if>
      <if test="starttime != null" >
        starttime = #{starttime,jdbcType=TIMESTAMP},
      </if>
      <if test="endtime != null" >
        endtime = #{endtime,jdbcType=TIMESTAMP},
      </if>
      <if test="energy != null" >
        energy = #{energy,jdbcType=DECIMAL},
      </if>
      <if test="uperson != null" >
        uperson = #{uperson,jdbcType=VARCHAR},
      </if>
      <if test="remark != null" >
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null" >
        org_id = #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="statue != null" >
        statue = #{statue,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.intelligent.basicdata.model.TNNtinfoHistory" >
    update t_n_ntinfo_history
    set vcfcode = #{vcfcode,jdbcType=VARCHAR},
      vdevcode = #{vdevcode,jdbcType=VARCHAR},
      vdevname = #{vdevname,jdbcType=VARCHAR},
      starttime = #{starttime,jdbcType=TIMESTAMP},
      endtime = #{endtime,jdbcType=TIMESTAMP},
      energy = #{energy,jdbcType=DECIMAL},
      uperson = #{uperson,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      org_id = #{orgId,jdbcType=VARCHAR},
      statue = #{statue,jdbcType=INTEGER}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>