<?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.ReportdetailMapper">
  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.Reportdetail">
    <result column="detailreportid" jdbcType="VARCHAR" property="detailreportid" />
    <result column="longitude" jdbcType="VARCHAR" property="longitude" />
    <result column="latitude" jdbcType="VARCHAR" property="latitude" />
    <result column="areaname" jdbcType="VARCHAR" property="areaname" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="powerstationid" jdbcType="VARCHAR" property="powerstationid" />
    <result column="powerstationname" jdbcType="VARCHAR" property="powerstationname" />
    <result column="arelongitude" jdbcType="VARCHAR" property="arelongitude" />
    <result column="arelatitude" jdbcType="VARCHAR" property="arelatitude" />
  </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">
	  	  	      	detailreportid,
       	  	      	longitude,
       	  	      	latitude,
       	  	      	areaname,
       	  	      	name,
       	  	      	powerstationid,
       	  	      	powerstationname,
       	  	      	arelongitude,
       	  	    	  	arelatitude
       	</sql>
  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.ReportdetailExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from reportdetail
    <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 reportdetail
    where detailreportid = #{detailreportid,jdbcType=VARCHAR}
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from reportdetail
    where detailreportid = #{detailreportid,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.ReportdetailExample">
    delete from reportdetail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  
  <insert id="insert" parameterType="com.gyee.frame.model.auto.Reportdetail">
    insert into reportdetail (
      	  	       detailreportid,
       	  	       longitude,
       	  	       latitude,
       	  	       areaname,
       	  	       name,
       	  	       powerstationid,
       	  	       powerstationname,
       	  	       arelongitude,
       	  	    	  arelatitude
       	    )
    values (
	  	  	      	#{detailreportid,jdbcType=VARCHAR},
       	  	      	#{longitude,jdbcType=VARCHAR},
       	  	      	#{latitude,jdbcType=VARCHAR},
       	  	      	#{areaname,jdbcType=VARCHAR},
       	  	      	#{name,jdbcType=VARCHAR},
       	  	      	#{powerstationid,jdbcType=VARCHAR},
       	  	      	#{powerstationname,jdbcType=VARCHAR},
       	  	      	#{arelongitude,jdbcType=VARCHAR},
       	  	    	  #{arelatitude,jdbcType=VARCHAR}
       	    )
  </insert>
  
  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.Reportdetail">
    insert into reportdetail
    <trim prefix="(" suffix=")" suffixOverrides=",">
          
      <if test="detailreportid != null">
        detailreportid,
      </if>
      
         
      <if test="longitude != null">
        longitude,
      </if>
      
         
      <if test="latitude != null">
        latitude,
      </if>
      
         
      <if test="areaname != null">
        areaname,
      </if>
      
         
      <if test="name != null">
        name,
      </if>
      
         
      <if test="powerstationid != null">
        powerstationid,
      </if>
      
         
      <if test="powerstationname != null">
        powerstationname,
      </if>
      
         
      <if test="arelongitude != null">
        arelongitude,
      </if>
      
         
      <if test="arelatitude != null">
        arelatitude,
      </if>
      
         </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
          <if test="detailreportid != null">
        #{detailreportid,jdbcType=VARCHAR},
      </if>
          <if test="longitude != null">
        #{longitude,jdbcType=VARCHAR},
      </if>
          <if test="latitude != null">
        #{latitude,jdbcType=VARCHAR},
      </if>
          <if test="areaname != null">
        #{areaname,jdbcType=VARCHAR},
      </if>
          <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
          <if test="powerstationid != null">
        #{powerstationid,jdbcType=VARCHAR},
      </if>
          <if test="powerstationname != null">
        #{powerstationname,jdbcType=VARCHAR},
      </if>
          <if test="arelongitude != null">
        #{arelongitude,jdbcType=VARCHAR},
      </if>
          <if test="arelatitude != null">
        #{arelatitude,jdbcType=VARCHAR},
      </if>
        </trim>
  </insert>
  
  <select id="countByExample" parameterType="com.gyee.frame.model.auto.ReportdetailExample" resultType="java.lang.Long">
    select count(*) from reportdetail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  
  <update id="updateByExampleSelective" parameterType="map">
    update reportdetail
    <set>
          <if test="record.detailreportid != null">
        detailreportid = #{record.detailreportid,jdbcType=VARCHAR},
      </if>
          <if test="record.longitude != null">
        longitude = #{record.longitude,jdbcType=VARCHAR},
      </if>
          <if test="record.latitude != null">
        latitude = #{record.latitude,jdbcType=VARCHAR},
      </if>
          <if test="record.areaname != null">
        areaname = #{record.areaname,jdbcType=VARCHAR},
      </if>
          <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
          <if test="record.powerstationid != null">
        powerstationid = #{record.powerstationid,jdbcType=VARCHAR},
      </if>
          <if test="record.powerstationname != null">
        powerstationname = #{record.powerstationname,jdbcType=VARCHAR},
      </if>
          <if test="record.arelongitude != null">
        arelongitude = #{record.arelongitude,jdbcType=VARCHAR},
      </if>
          <if test="record.arelatitude != null">
        arelatitude = #{record.arelatitude,jdbcType=VARCHAR},
      </if>
         
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  
  
  <update id="updateByExample" parameterType="map">
    update reportdetail
    set
            	     	 detailreportid = #{record.detailreportid,jdbcType=VARCHAR},
    	         	     	 longitude = #{record.longitude,jdbcType=VARCHAR},
    	         	     	 latitude = #{record.latitude,jdbcType=VARCHAR},
    	         	     	 areaname = #{record.areaname,jdbcType=VARCHAR},
    	         	     	 name = #{record.name,jdbcType=VARCHAR},
    	         	     	 powerstationid = #{record.powerstationid,jdbcType=VARCHAR},
    	         	     	 powerstationname = #{record.powerstationname,jdbcType=VARCHAR},
    	         	     	 arelongitude = #{record.arelongitude,jdbcType=VARCHAR},
    	         	     	 arelatitude = #{record.arelatitude,jdbcType=VARCHAR}
    	         <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  
  
      <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.Reportdetail">
    update reportdetail
    <set>
                          <if test="longitude != null">
        longitude = #{longitude,jdbcType=VARCHAR},
      </if>
                      <if test="latitude != null">
        latitude = #{latitude,jdbcType=VARCHAR},
      </if>
                      <if test="areaname != null">
        areaname = #{areaname,jdbcType=VARCHAR},
      </if>
                      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
                      <if test="powerstationid != null">
        powerstationid = #{powerstationid,jdbcType=VARCHAR},
      </if>
                      <if test="powerstationname != null">
        powerstationname = #{powerstationname,jdbcType=VARCHAR},
      </if>
                      <if test="arelongitude != null">
        arelongitude = #{arelongitude,jdbcType=VARCHAR},
      </if>
                      <if test="arelatitude != null">
        arelatitude = #{arelatitude,jdbcType=VARCHAR},
      </if>
              </set>
    where 
            detailreportid = #{detailreportid,jdbcType=VARCHAR}
                                                                          
  </update>

      	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	

  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.Reportdetail">
    update reportdetail
    set 
             	        	    	 			longitude = #{longitude,jdbcType=VARCHAR},
		     	        	    	 			latitude = #{latitude,jdbcType=VARCHAR},
		     	        	    	 			areaname = #{areaname,jdbcType=VARCHAR},
		     	        	    	 			name = #{name,jdbcType=VARCHAR},
		     	        	    	 			powerstationid = #{powerstationid,jdbcType=VARCHAR},
		     	        	    	 			powerstationname = #{powerstationname,jdbcType=VARCHAR},
		     	        	    	 			arelongitude = #{arelongitude,jdbcType=VARCHAR},
		     	        	    	 			arelatitude = #{arelatitude,jdbcType=VARCHAR}
		     	        where 
            detailreportid = #{detailreportid,jdbcType=VARCHAR}
                                                                            
  </update>
  
                                                 
</mapper>