<?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.SysStreetMapper">
  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.SysStreet">
    <result column="id" jdbcType="INTEGER" property="id" />
    <result column="street_code" jdbcType="VARCHAR" property="streetCode" />
    <result column="area_code" jdbcType="VARCHAR" property="areaCode" />
    <result column="street_name" jdbcType="VARCHAR" property="streetName" />
    <result column="short_name" jdbcType="VARCHAR" property="shortName" />
    <result column="lng" jdbcType="VARCHAR" property="lng" />
    <result column="lat" jdbcType="VARCHAR" property="lat" />
    <result column="sort" jdbcType="INTEGER" property="sort" />
    <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
    <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
    <result column="memo" jdbcType="VARCHAR" property="memo" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
  </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,
       	  	      	street_code,
       	  	      	area_code,
       	  	      	street_name,
       	  	      	short_name,
       	  	      	lng,
       	  	      	lat,
       	  	      	sort,
       	  	      	gmt_create,
       	  	      	gmt_modified,
       	  	      	memo,
       	  	    	  	data_state
       	</sql>
  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.SysStreetExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_sys_street
    <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 t_sys_street
    where id = #{id,jdbcType=INTEGER}
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from t_sys_street
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.SysStreetExample">
    delete from t_sys_street
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  
  <insert id="insert" parameterType="com.gyee.frame.model.auto.SysStreet">
    insert into t_sys_street (
      	  	       id,
       	  	       street_code,
       	  	       area_code,
       	  	       street_name,
       	  	       short_name,
       	  	       lng,
       	  	       lat,
       	  	       sort,
       	  	       gmt_create,
       	  	       gmt_modified,
       	  	       memo,
       	  	    	  data_state
       	    )
    values (
	  	  	      	#{id,jdbcType=INTEGER},
       	  	      	#{streetCode,jdbcType=VARCHAR},
       	  	      	#{areaCode,jdbcType=VARCHAR},
       	  	      	#{streetName,jdbcType=VARCHAR},
       	  	      	#{shortName,jdbcType=VARCHAR},
       	  	      	#{lng,jdbcType=VARCHAR},
       	  	      	#{lat,jdbcType=VARCHAR},
       	  	      	#{sort,jdbcType=INTEGER},
       	  	      	#{gmtCreate,jdbcType=TIMESTAMP},
       	  	      	#{gmtModified,jdbcType=TIMESTAMP},
       	  	      	#{memo,jdbcType=VARCHAR},
       	  	    	  #{dataState,jdbcType=INTEGER}
       	    )
  </insert>
  
  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.SysStreet">
    insert into t_sys_street
    <trim prefix="(" suffix=")" suffixOverrides=",">
          
      <if test="id != null">
        id,
      </if>
      
         
      <if test="streetCode != null">
        street_code,
      </if>
      
         
      <if test="areaCode != null">
        area_code,
      </if>
      
         
      <if test="streetName != null">
        street_name,
      </if>
      
         
      <if test="shortName != null">
        short_name,
      </if>
      
         
      <if test="lng != null">
        lng,
      </if>
      
         
      <if test="lat != null">
        lat,
      </if>
      
         
      <if test="sort != null">
        sort,
      </if>
      
         
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      
         
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      
         
      <if test="memo != null">
        memo,
      </if>
      
         
      <if test="dataState != null">
        data_state,
      </if>
      
         </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
          <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
          <if test="streetCode != null">
        #{streetCode,jdbcType=VARCHAR},
      </if>
          <if test="areaCode != null">
        #{areaCode,jdbcType=VARCHAR},
      </if>
          <if test="streetName != null">
        #{streetName,jdbcType=VARCHAR},
      </if>
          <if test="shortName != null">
        #{shortName,jdbcType=VARCHAR},
      </if>
          <if test="lng != null">
        #{lng,jdbcType=VARCHAR},
      </if>
          <if test="lat != null">
        #{lat,jdbcType=VARCHAR},
      </if>
          <if test="sort != null">
        #{sort,jdbcType=INTEGER},
      </if>
          <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
          <if test="gmtModified != null">
        #{gmtModified,jdbcType=TIMESTAMP},
      </if>
          <if test="memo != null">
        #{memo,jdbcType=VARCHAR},
      </if>
          <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
        </trim>
  </insert>
  
  <select id="countByExample" parameterType="com.gyee.frame.model.auto.SysStreetExample" resultType="java.lang.Long">
    select count(*) from t_sys_street
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  
  <update id="updateByExampleSelective" parameterType="map">
    update t_sys_street
    <set>
          <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
          <if test="record.streetCode != null">
        street_code = #{record.streetCode,jdbcType=VARCHAR},
      </if>
          <if test="record.areaCode != null">
        area_code = #{record.areaCode,jdbcType=VARCHAR},
      </if>
          <if test="record.streetName != null">
        street_name = #{record.streetName,jdbcType=VARCHAR},
      </if>
          <if test="record.shortName != null">
        short_name = #{record.shortName,jdbcType=VARCHAR},
      </if>
          <if test="record.lng != null">
        lng = #{record.lng,jdbcType=VARCHAR},
      </if>
          <if test="record.lat != null">
        lat = #{record.lat,jdbcType=VARCHAR},
      </if>
          <if test="record.sort != null">
        sort = #{record.sort,jdbcType=INTEGER},
      </if>
          <if test="record.gmtCreate != null">
        gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
      </if>
          <if test="record.gmtModified != null">
        gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
      </if>
          <if test="record.memo != null">
        memo = #{record.memo,jdbcType=VARCHAR},
      </if>
          <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
         
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  
  
  <update id="updateByExample" parameterType="map">
    update t_sys_street
    set
            	     	 id = #{record.id,jdbcType=INTEGER},
    	         	     	 street_code = #{record.streetCode,jdbcType=VARCHAR},
    	         	     	 area_code = #{record.areaCode,jdbcType=VARCHAR},
    	         	     	 street_name = #{record.streetName,jdbcType=VARCHAR},
    	         	     	 short_name = #{record.shortName,jdbcType=VARCHAR},
    	         	     	 lng = #{record.lng,jdbcType=VARCHAR},
    	         	     	 lat = #{record.lat,jdbcType=VARCHAR},
    	         	     	 sort = #{record.sort,jdbcType=INTEGER},
    	         	     	 gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
    	         	     	 gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
    	         	     	 memo = #{record.memo,jdbcType=VARCHAR},
    	         	     	 data_state = #{record.dataState,jdbcType=INTEGER}
    	         <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  
  
      <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.SysStreet">
    update t_sys_street
    <set>
                          <if test="streetCode != null">
        street_code = #{streetCode,jdbcType=VARCHAR},
      </if>
                      <if test="areaCode != null">
        area_code = #{areaCode,jdbcType=VARCHAR},
      </if>
                      <if test="streetName != null">
        street_name = #{streetName,jdbcType=VARCHAR},
      </if>
                      <if test="shortName != null">
        short_name = #{shortName,jdbcType=VARCHAR},
      </if>
                      <if test="lng != null">
        lng = #{lng,jdbcType=VARCHAR},
      </if>
                      <if test="lat != null">
        lat = #{lat,jdbcType=VARCHAR},
      </if>
                      <if test="sort != null">
        sort = #{sort,jdbcType=INTEGER},
      </if>
                      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
                      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      </if>
                      <if test="memo != null">
        memo = #{memo,jdbcType=VARCHAR},
      </if>
                      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
              </set>
    where 
            id = #{id,jdbcType=INTEGER}
                                                                                                  
  </update>

      	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	

  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.SysStreet">
    update t_sys_street
    set 
             	        	    	 			street_code = #{streetCode,jdbcType=VARCHAR},
		     	        	    	 			area_code = #{areaCode,jdbcType=VARCHAR},
		     	        	    	 			street_name = #{streetName,jdbcType=VARCHAR},
		     	        	    	 			short_name = #{shortName,jdbcType=VARCHAR},
		     	        	    	 			lng = #{lng,jdbcType=VARCHAR},
		     	        	    	 			lat = #{lat,jdbcType=VARCHAR},
		     	        	    	 			sort = #{sort,jdbcType=INTEGER},
		     	        	    	 			gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
		     	        	    	 			gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
		     	        	    	 			memo = #{memo,jdbcType=VARCHAR},
		     	        	    	 			data_state = #{dataState,jdbcType=INTEGER}
		     	        where 
            id = #{id,jdbcType=INTEGER}
                                                                                                    
  </update>
  
                                                                
</mapper>