<?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.ActivePowerDataMapper">
  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.ActivePowerData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="windPowerStationId" jdbcType="VARCHAR" property="windpowerstationid" />
    <result column="windTurbineId" jdbcType="VARCHAR" property="windturbineid" />
    <result column="modelId" jdbcType="VARCHAR" property="modelid" />
    <result column="recordDate" jdbcType="TIMESTAMP" property="recorddate" />
    <result column="speed" jdbcType="DECIMAL" property="speed" />
    <result column="power" jdbcType="DECIMAL" property="power" />
    <result column="frequency" jdbcType="DECIMAL" property="frequency" />
    <result column="windTurbineCode" jdbcType="VARCHAR" property="windturbinecode" />
    <result column="modelName" jdbcType="VARCHAR" property="modelname" />
  </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, windPowerStationId, windTurbineId, modelId, recordDate, speed, power, frequency, 
    windTurbineCode, modelName
  </sql>
  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.ActivePowerDataExample" 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 activepowerdata
    <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.Integer" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from activepowerdata
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from activepowerdata
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.ActivePowerDataExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from activepowerdata
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.gyee.frame.model.auto.ActivePowerData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into activepowerdata (id, windPowerStationId, windTurbineId, 
      modelId, recordDate, speed, 
      power, frequency, windTurbineCode, 
      modelName)
    values (#{id,jdbcType=INTEGER}, #{windpowerstationid,jdbcType=VARCHAR}, #{windturbineid,jdbcType=VARCHAR}, 
      #{modelid,jdbcType=VARCHAR}, #{recorddate,jdbcType=TIMESTAMP}, #{speed,jdbcType=DECIMAL}, 
      #{power,jdbcType=DECIMAL}, #{frequency,jdbcType=DECIMAL}, #{windturbinecode,jdbcType=VARCHAR}, 
      #{modelname,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.ActivePowerData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into activepowerdata
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="windpowerstationid != null">
        windPowerStationId,
      </if>
      <if test="windturbineid != null">
        windTurbineId,
      </if>
      <if test="modelid != null">
        modelId,
      </if>
      <if test="recorddate != null">
        recordDate,
      </if>
      <if test="speed != null">
        speed,
      </if>
      <if test="power != null">
        power,
      </if>
      <if test="frequency != null">
        frequency,
      </if>
      <if test="windturbinecode != null">
        windTurbineCode,
      </if>
      <if test="modelname != null">
        modelName,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="windpowerstationid != null">
        #{windpowerstationid,jdbcType=VARCHAR},
      </if>
      <if test="windturbineid != null">
        #{windturbineid,jdbcType=VARCHAR},
      </if>
      <if test="modelid != null">
        #{modelid,jdbcType=VARCHAR},
      </if>
      <if test="recorddate != null">
        #{recorddate,jdbcType=TIMESTAMP},
      </if>
      <if test="speed != null">
        #{speed,jdbcType=DECIMAL},
      </if>
      <if test="power != null">
        #{power,jdbcType=DECIMAL},
      </if>
      <if test="frequency != null">
        #{frequency,jdbcType=DECIMAL},
      </if>
      <if test="windturbinecode != null">
        #{windturbinecode,jdbcType=VARCHAR},
      </if>
      <if test="modelname != null">
        #{modelname,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.gyee.frame.model.auto.ActivePowerDataExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from activepowerdata
    <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 activepowerdata
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.windpowerstationid != null">
        windPowerStationId = #{record.windpowerstationid,jdbcType=VARCHAR},
      </if>
      <if test="record.windturbineid != null">
        windTurbineId = #{record.windturbineid,jdbcType=VARCHAR},
      </if>
      <if test="record.modelid != null">
        modelId = #{record.modelid,jdbcType=VARCHAR},
      </if>
      <if test="record.recorddate != null">
        recordDate = #{record.recorddate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.speed != null">
        speed = #{record.speed,jdbcType=DECIMAL},
      </if>
      <if test="record.power != null">
        power = #{record.power,jdbcType=DECIMAL},
      </if>
      <if test="record.frequency != null">
        frequency = #{record.frequency,jdbcType=DECIMAL},
      </if>
      <if test="record.windturbinecode != null">
        windTurbineCode = #{record.windturbinecode,jdbcType=VARCHAR},
      </if>
      <if test="record.modelname != null">
        modelName = #{record.modelname,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 activepowerdata
    set id = #{record.id,jdbcType=INTEGER},
      windPowerStationId = #{record.windpowerstationid,jdbcType=VARCHAR},
      windTurbineId = #{record.windturbineid,jdbcType=VARCHAR},
      modelId = #{record.modelid,jdbcType=VARCHAR},
      recordDate = #{record.recorddate,jdbcType=TIMESTAMP},
      speed = #{record.speed,jdbcType=DECIMAL},
      power = #{record.power,jdbcType=DECIMAL},
      frequency = #{record.frequency,jdbcType=DECIMAL},
      windTurbineCode = #{record.windturbinecode,jdbcType=VARCHAR},
      modelName = #{record.modelname,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.ActivePowerData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update activepowerdata
    <set>
      <if test="windpowerstationid != null">
        windPowerStationId = #{windpowerstationid,jdbcType=VARCHAR},
      </if>
      <if test="windturbineid != null">
        windTurbineId = #{windturbineid,jdbcType=VARCHAR},
      </if>
      <if test="modelid != null">
        modelId = #{modelid,jdbcType=VARCHAR},
      </if>
      <if test="recorddate != null">
        recordDate = #{recorddate,jdbcType=TIMESTAMP},
      </if>
      <if test="speed != null">
        speed = #{speed,jdbcType=DECIMAL},
      </if>
      <if test="power != null">
        power = #{power,jdbcType=DECIMAL},
      </if>
      <if test="frequency != null">
        frequency = #{frequency,jdbcType=DECIMAL},
      </if>
      <if test="windturbinecode != null">
        windTurbineCode = #{windturbinecode,jdbcType=VARCHAR},
      </if>
      <if test="modelname != null">
        modelName = #{modelname,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.ActivePowerData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update activepowerdata
    set windPowerStationId = #{windpowerstationid,jdbcType=VARCHAR},
      windTurbineId = #{windturbineid,jdbcType=VARCHAR},
      modelId = #{modelid,jdbcType=VARCHAR},
      recordDate = #{recorddate,jdbcType=TIMESTAMP},
      speed = #{speed,jdbcType=DECIMAL},
      power = #{power,jdbcType=DECIMAL},
      frequency = #{frequency,jdbcType=DECIMAL},
      windTurbineCode = #{windturbinecode,jdbcType=VARCHAR},
      modelName = #{modelname,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>