<?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.fuxi.ws.data.dao.DistrictMapper" >
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.District" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    <id column="DistrictID" property="districtid" jdbcType="VARCHAR" />
    <result column="District" property="district" jdbcType="VARCHAR" />
    <result column="EName" property="ename" jdbcType="VARCHAR" />
    <result column="OtherName" property="othername" jdbcType="VARCHAR" />
    <result column="UseFlag" property="useflag" jdbcType="BIT" />
    <result column="Code" property="code" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    DistrictID, District, EName, OtherName, UseFlag, Code
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.fuxi.ws.data.entity.DistrictExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    select
    <if test="distinct" >
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from District
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    select 
    <include refid="Base_Column_List" />
    from District
    where DistrictID = #{districtid,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    delete from District
    where DistrictID = #{districtid,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.District" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    insert into District (DistrictID, District, EName, 
      OtherName, UseFlag, Code
      )
    values (#{districtid,jdbcType=VARCHAR}, #{district,jdbcType=VARCHAR}, #{ename,jdbcType=VARCHAR}, 
      #{othername,jdbcType=VARCHAR}, #{useflag,jdbcType=BIT}, #{code,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.District" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    insert into District
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="districtid != null" >
        DistrictID,
      </if>
      <if test="district != null" >
        District,
      </if>
      <if test="ename != null" >
        EName,
      </if>
      <if test="othername != null" >
        OtherName,
      </if>
      <if test="useflag != null" >
        UseFlag,
      </if>
      <if test="code != null" >
        Code,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="districtid != null" >
        #{districtid,jdbcType=VARCHAR},
      </if>
      <if test="district != null" >
        #{district,jdbcType=VARCHAR},
      </if>
      <if test="ename != null" >
        #{ename,jdbcType=VARCHAR},
      </if>
      <if test="othername != null" >
        #{othername,jdbcType=VARCHAR},
      </if>
      <if test="useflag != null" >
        #{useflag,jdbcType=BIT},
      </if>
      <if test="code != null" >
        #{code,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.DistrictExample" resultType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    select count(*) from District
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.District" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    update District
    <set >
      <if test="district != null" >
        District = #{district,jdbcType=VARCHAR},
      </if>
      <if test="ename != null" >
        EName = #{ename,jdbcType=VARCHAR},
      </if>
      <if test="othername != null" >
        OtherName = #{othername,jdbcType=VARCHAR},
      </if>
      <if test="useflag != null" >
        UseFlag = #{useflag,jdbcType=BIT},
      </if>
      <if test="code != null" >
        Code = #{code,jdbcType=VARCHAR},
      </if>
    </set>
    where DistrictID = #{districtid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.District" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Dec 07 19:57:22 CST 2016.
    -->
    update District
    set District = #{district,jdbcType=VARCHAR},
      EName = #{ename,jdbcType=VARCHAR},
      OtherName = #{othername,jdbcType=VARCHAR},
      UseFlag = #{useflag,jdbcType=BIT},
      Code = #{code,jdbcType=VARCHAR}
    where DistrictID = #{districtid,jdbcType=VARCHAR}
  </update>
</mapper>