<?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.WeatherfhMapper">
  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.Weatherfh">
    <result column="id" jdbcType="INTEGER" property="id" />
    <result column="date" jdbcType="TIMESTAMP" property="date" />
    <result column="region" jdbcType="VARCHAR" property="region" />
    <result column="windpowerstationid" jdbcType="VARCHAR" property="windpowerstationid" />
    <result column="weather" jdbcType="VARCHAR" property="weather" />
    <result column="temperature" jdbcType="VARCHAR" property="temperature" />
    <result column="winddirection" jdbcType="VARCHAR" property="winddirection" />
    <result column="realfeel" jdbcType="DOUBLE" property="realfeel" />
    <result column="speed" jdbcType="DOUBLE" property="speed" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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">
    <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">
	  	  	      	id,
       	  	      	date,
       	  	      	region,
       	  	      	windpowerstationid,
       	  	      	weather,
       	  	      	temperature,
       	  	      	winddirection,
       	  	      	realfeel,
       	  	    	  	speed
       	</sql>
  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.WeatherfhExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from weatherfh
    <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">
    select 
    <include refid="Base_Column_List" />
    from weatherfh
    where id = #{id,jdbcType=INTEGER}
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from weatherfh
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.WeatherfhExample">
    delete from weatherfh
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  
  <insert id="insert" parameterType="com.gyee.frame.model.auto.Weatherfh">
    insert into weatherfh (
      	  	       id,
       	  	       date,
       	  	       region,
       	  	       windpowerstationid,
       	  	       weather,
       	  	       temperature,
       	  	       winddirection,
       	  	       realfeel,
       	  	    	  speed
       	    )
    values (
	  	  	      	#{id,jdbcType=INTEGER},
       	  	      	#{date,jdbcType=TIMESTAMP},
       	  	      	#{region,jdbcType=VARCHAR},
       	  	      	#{windpowerstationid,jdbcType=VARCHAR},
       	  	      	#{weather,jdbcType=VARCHAR},
       	  	      	#{temperature,jdbcType=VARCHAR},
       	  	      	#{winddirection,jdbcType=VARCHAR},
       	  	      	#{realfeel,jdbcType=DOUBLE},
       	  	    	  #{speed,jdbcType=DOUBLE}
       	    )
  </insert>
  
  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.Weatherfh">
    insert into weatherfh
    <trim prefix="(" suffix=")" suffixOverrides=",">
          
      <if test="id != null">
        id,
      </if>
      
         
      <if test="date != null">
        date,
      </if>
      
         
      <if test="region != null">
        region,
      </if>
      
         
      <if test="windpowerstationid != null">
        windpowerstationid,
      </if>
      
         
      <if test="weather != null">
        weather,
      </if>
      
         
      <if test="temperature != null">
        temperature,
      </if>
      
         
      <if test="winddirection != null">
        winddirection,
      </if>
      
         
      <if test="realfeel != null">
        realfeel,
      </if>
      
         
      <if test="speed != null">
        speed,
      </if>
      
         </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
          <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
          <if test="date != null">
        #{date,jdbcType=TIMESTAMP},
      </if>
          <if test="region != null">
        #{region,jdbcType=VARCHAR},
      </if>
          <if test="windpowerstationid != null">
        #{windpowerstationid,jdbcType=VARCHAR},
      </if>
          <if test="weather != null">
        #{weather,jdbcType=VARCHAR},
      </if>
          <if test="temperature != null">
        #{temperature,jdbcType=VARCHAR},
      </if>
          <if test="winddirection != null">
        #{winddirection,jdbcType=VARCHAR},
      </if>
          <if test="realfeel != null">
        #{realfeel,jdbcType=DOUBLE},
      </if>
          <if test="speed != null">
        #{speed,jdbcType=DOUBLE},
      </if>
        </trim>
  </insert>
  
  <select id="countByExample" parameterType="com.gyee.frame.model.auto.WeatherfhExample" resultType="java.lang.Long">
    select count(*) from weatherfh
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  
  <update id="updateByExampleSelective" parameterType="map">
    update weatherfh
    <set>
          <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
          <if test="record.date != null">
        date = #{record.date,jdbcType=TIMESTAMP},
      </if>
          <if test="record.region != null">
        region = #{record.region,jdbcType=VARCHAR},
      </if>
          <if test="record.windpowerstationid != null">
        windpowerstationid = #{record.windpowerstationid,jdbcType=VARCHAR},
      </if>
          <if test="record.weather != null">
        weather = #{record.weather,jdbcType=VARCHAR},
      </if>
          <if test="record.temperature != null">
        temperature = #{record.temperature,jdbcType=VARCHAR},
      </if>
          <if test="record.winddirection != null">
        winddirection = #{record.winddirection,jdbcType=VARCHAR},
      </if>
          <if test="record.realfeel != null">
        realfeel = #{record.realfeel,jdbcType=DOUBLE},
      </if>
          <if test="record.speed != null">
        speed = #{record.speed,jdbcType=DOUBLE},
      </if>
         
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  
  
  <update id="updateByExample" parameterType="map">
    update weatherfh
    set
            	     	 id = #{record.id,jdbcType=INTEGER},
    	         	     	 date = #{record.date,jdbcType=TIMESTAMP},
    	         	     	 region = #{record.region,jdbcType=VARCHAR},
    	         	     	 windpowerstationid = #{record.windpowerstationid,jdbcType=VARCHAR},
    	         	     	 weather = #{record.weather,jdbcType=VARCHAR},
    	         	     	 temperature = #{record.temperature,jdbcType=VARCHAR},
    	         	     	 winddirection = #{record.winddirection,jdbcType=VARCHAR},
    	         	     	 realfeel = #{record.realfeel,jdbcType=DOUBLE},
    	         	     	 speed = #{record.speed,jdbcType=DOUBLE}
    	         <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  
  
      <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.Weatherfh">
    update weatherfh
    <set>
                          <if test="date != null">
        date = #{date,jdbcType=TIMESTAMP},
      </if>
                      <if test="region != null">
        region = #{region,jdbcType=VARCHAR},
      </if>
                      <if test="windpowerstationid != null">
        windpowerstationid = #{windpowerstationid,jdbcType=VARCHAR},
      </if>
                      <if test="weather != null">
        weather = #{weather,jdbcType=VARCHAR},
      </if>
                      <if test="temperature != null">
        temperature = #{temperature,jdbcType=VARCHAR},
      </if>
                      <if test="winddirection != null">
        winddirection = #{winddirection,jdbcType=VARCHAR},
      </if>
                      <if test="realfeel != null">
        realfeel = #{realfeel,jdbcType=DOUBLE},
      </if>
                      <if test="speed != null">
        speed = #{speed,jdbcType=DOUBLE},
      </if>
              </set>
    where 
            id = #{id,jdbcType=INTEGER}
                                                                          
  </update>

      	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	

  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.Weatherfh">
    update weatherfh
    set 
             	        	    	 			date = #{date,jdbcType=TIMESTAMP},
		     	        	    	 			region = #{region,jdbcType=VARCHAR},
		     	        	    	 			windpowerstationid = #{windpowerstationid,jdbcType=VARCHAR},
		     	        	    	 			weather = #{weather,jdbcType=VARCHAR},
		     	        	    	 			temperature = #{temperature,jdbcType=VARCHAR},
		     	        	    	 			winddirection = #{winddirection,jdbcType=VARCHAR},
		     	        	    	 			realfeel = #{realfeel,jdbcType=DOUBLE},
		     	        	    	 			speed = #{speed,jdbcType=DOUBLE}
		     	        where 
            id = #{id,jdbcType=INTEGER}
                                                                            
  </update>
  
                                                 
</mapper>