<?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.WindturbineMapper">
  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.Windturbine">
    <result column="id" jdbcType="VARCHAR" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="windpowerstationid" jdbcType="VARCHAR" property="windpowerstationid" />
    <result column="longitude" jdbcType="DECIMAL" property="longitude" />
    <result column="latitude" jdbcType="DECIMAL" property="latitude" />
    <result column="modelid" jdbcType="VARCHAR" property="modelid" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="projectid" jdbcType="VARCHAR" property="projectid" />
    <result column="lineid" jdbcType="VARCHAR" property="lineid" />
    <result column="firstintegratedtime" jdbcType="TIMESTAMP" property="firstintegratedtime" />
    <result column="photo" jdbcType="VARCHAR" property="photo" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="standardid" jdbcType="VARCHAR" property="standardid" />
  </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,
       	  	      	code,
       	  	      	windpowerstationid,
       	  	      	longitude,
       	  	      	latitude,
       	  	      	modelid,
       	  	      	status,
       	  	      	projectid,
       	  	      	lineid,
       	  	      	firstintegratedtime,
       	  	      	photo,
       	  	      	name,
       	  	    	  	standardid
       	</sql>
  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.WindturbineExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from windturbine
    <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.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from windturbine
    where id = #{id,jdbcType=VARCHAR}
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from windturbine
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.WindturbineExample">
    delete from windturbine
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  
  <insert id="insert" parameterType="com.gyee.frame.model.auto.Windturbine">
    insert into windturbine (
      	  	       id,
       	  	       code,
       	  	       windpowerstationid,
       	  	       longitude,
       	  	       latitude,
       	  	       modelid,
       	  	       status,
       	  	       projectid,
       	  	       lineid,
       	  	       firstintegratedtime,
       	  	       photo,
       	  	       name,
       	  	    	  standardid
       	    )
    values (
	  	  	      	#{id,jdbcType=VARCHAR},
       	  	      	#{code,jdbcType=VARCHAR},
       	  	      	#{windpowerstationid,jdbcType=VARCHAR},
       	  	      	#{longitude,jdbcType=DECIMAL},
       	  	      	#{latitude,jdbcType=DECIMAL},
       	  	      	#{modelid,jdbcType=VARCHAR},
       	  	      	#{status,jdbcType=VARCHAR},
       	  	      	#{projectid,jdbcType=VARCHAR},
       	  	      	#{lineid,jdbcType=VARCHAR},
       	  	      	#{firstintegratedtime,jdbcType=TIMESTAMP},
       	  	      	#{photo,jdbcType=VARCHAR},
       	  	      	#{name,jdbcType=VARCHAR},
       	  	    	  #{standardid,jdbcType=VARCHAR}
       	    )
  </insert>
  
  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.Windturbine">
    insert into windturbine
    <trim prefix="(" suffix=")" suffixOverrides=",">
          
      <if test="id != null">
        id,
      </if>
      
         
      <if test="code != null">
        code,
      </if>
      
         
      <if test="windpowerstationid != null">
        windpowerstationid,
      </if>
      
         
      <if test="longitude != null">
        longitude,
      </if>
      
         
      <if test="latitude != null">
        latitude,
      </if>
      
         
      <if test="modelid != null">
        modelid,
      </if>
      
         
      <if test="status != null">
        status,
      </if>
      
         
      <if test="projectid != null">
        projectid,
      </if>
      
         
      <if test="lineid != null">
        lineid,
      </if>
      
         
      <if test="firstintegratedtime != null">
        firstintegratedtime,
      </if>
      
         
      <if test="photo != null">
        photo,
      </if>
      
         
      <if test="name != null">
        name,
      </if>
      
         
      <if test="standardid != null">
        standardid,
      </if>
      
         </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
          <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
          <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
          <if test="windpowerstationid != null">
        #{windpowerstationid,jdbcType=VARCHAR},
      </if>
          <if test="longitude != null">
        #{longitude,jdbcType=DECIMAL},
      </if>
          <if test="latitude != null">
        #{latitude,jdbcType=DECIMAL},
      </if>
          <if test="modelid != null">
        #{modelid,jdbcType=VARCHAR},
      </if>
          <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
          <if test="projectid != null">
        #{projectid,jdbcType=VARCHAR},
      </if>
          <if test="lineid != null">
        #{lineid,jdbcType=VARCHAR},
      </if>
          <if test="firstintegratedtime != null">
        #{firstintegratedtime,jdbcType=TIMESTAMP},
      </if>
          <if test="photo != null">
        #{photo,jdbcType=VARCHAR},
      </if>
          <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
          <if test="standardid != null">
        #{standardid,jdbcType=VARCHAR},
      </if>
        </trim>
  </insert>
  
  <select id="countByExample" parameterType="com.gyee.frame.model.auto.WindturbineExample" resultType="java.lang.Long">
    select count(*) from windturbine
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  
  <update id="updateByExampleSelective" parameterType="map">
    update windturbine
    <set>
          <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
          <if test="record.code != null">
        code = #{record.code,jdbcType=VARCHAR},
      </if>
          <if test="record.windpowerstationid != null">
        windpowerstationid = #{record.windpowerstationid,jdbcType=VARCHAR},
      </if>
          <if test="record.longitude != null">
        longitude = #{record.longitude,jdbcType=DECIMAL},
      </if>
          <if test="record.latitude != null">
        latitude = #{record.latitude,jdbcType=DECIMAL},
      </if>
          <if test="record.modelid != null">
        modelid = #{record.modelid,jdbcType=VARCHAR},
      </if>
          <if test="record.status != null">
        status = #{record.status,jdbcType=VARCHAR},
      </if>
          <if test="record.projectid != null">
        projectid = #{record.projectid,jdbcType=VARCHAR},
      </if>
          <if test="record.lineid != null">
        lineid = #{record.lineid,jdbcType=VARCHAR},
      </if>
          <if test="record.firstintegratedtime != null">
        firstintegratedtime = #{record.firstintegratedtime,jdbcType=TIMESTAMP},
      </if>
          <if test="record.photo != null">
        photo = #{record.photo,jdbcType=VARCHAR},
      </if>
          <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
          <if test="record.standardid != null">
        standardid = #{record.standardid,jdbcType=VARCHAR},
      </if>
         
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  
  
  <update id="updateByExample" parameterType="map">
    update windturbine
    set
            	     	 id = #{record.id,jdbcType=VARCHAR},
    	         	     	 code = #{record.code,jdbcType=VARCHAR},
    	         	     	 windpowerstationid = #{record.windpowerstationid,jdbcType=VARCHAR},
    	         	     	 longitude = #{record.longitude,jdbcType=DECIMAL},
    	         	     	 latitude = #{record.latitude,jdbcType=DECIMAL},
    	         	     	 modelid = #{record.modelid,jdbcType=VARCHAR},
    	         	     	 status = #{record.status,jdbcType=VARCHAR},
    	         	     	 projectid = #{record.projectid,jdbcType=VARCHAR},
    	         	     	 lineid = #{record.lineid,jdbcType=VARCHAR},
    	         	     	 firstintegratedtime = #{record.firstintegratedtime,jdbcType=TIMESTAMP},
    	         	     	 photo = #{record.photo,jdbcType=VARCHAR},
    	         	     	 name = #{record.name,jdbcType=VARCHAR},
    	         	     	 standardid = #{record.standardid,jdbcType=VARCHAR}
    	         <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  
  
      <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.Windturbine">
    update windturbine
    <set>
                          <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
                      <if test="windpowerstationid != null">
        windpowerstationid = #{windpowerstationid,jdbcType=VARCHAR},
      </if>
                      <if test="longitude != null">
        longitude = #{longitude,jdbcType=DECIMAL},
      </if>
                      <if test="latitude != null">
        latitude = #{latitude,jdbcType=DECIMAL},
      </if>
                      <if test="modelid != null">
        modelid = #{modelid,jdbcType=VARCHAR},
      </if>
                      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
                      <if test="projectid != null">
        projectid = #{projectid,jdbcType=VARCHAR},
      </if>
                      <if test="lineid != null">
        lineid = #{lineid,jdbcType=VARCHAR},
      </if>
                      <if test="firstintegratedtime != null">
        firstintegratedtime = #{firstintegratedtime,jdbcType=TIMESTAMP},
      </if>
                      <if test="photo != null">
        photo = #{photo,jdbcType=VARCHAR},
      </if>
                      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
                      <if test="standardid != null">
        standardid = #{standardid,jdbcType=VARCHAR},
      </if>
              </set>
    where 
            id = #{id,jdbcType=VARCHAR}
                                                                                                          
  </update>

      	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	

  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.Windturbine">
    update windturbine
    set 
             	        	    	 			code = #{code,jdbcType=VARCHAR},
		     	        	    	 			windpowerstationid = #{windpowerstationid,jdbcType=VARCHAR},
		     	        	    	 			longitude = #{longitude,jdbcType=DECIMAL},
		     	        	    	 			latitude = #{latitude,jdbcType=DECIMAL},
		     	        	    	 			modelid = #{modelid,jdbcType=VARCHAR},
		     	        	    	 			status = #{status,jdbcType=VARCHAR},
		     	        	    	 			projectid = #{projectid,jdbcType=VARCHAR},
		     	        	    	 			lineid = #{lineid,jdbcType=VARCHAR},
		     	        	    	 			firstintegratedtime = #{firstintegratedtime,jdbcType=TIMESTAMP},
		     	        	    	 			photo = #{photo,jdbcType=VARCHAR},
		     	        	    	 			name = #{name,jdbcType=VARCHAR},
		     	        	    	 			standardid = #{standardid,jdbcType=VARCHAR}
		     	        where 
            id = #{id,jdbcType=VARCHAR}
                                                                                                            
  </update>
  
                                                                     
</mapper>