<?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.dy.pipIrrGlobal.daoSe.SeClientTempMapper"> 
 | 
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeClientTemp"> 
 | 
    <!--@mbg.generated--> 
 | 
    <!--@Table se_client_temp--> 
 | 
    <id column="id" jdbcType="INTEGER" property="id" /> 
 | 
    <result column="town" jdbcType="VARCHAR" property="town" /> 
 | 
    <result column="village" jdbcType="VARCHAR" property="village" /> 
 | 
    <result column="name" jdbcType="VARCHAR" property="name" /> 
 | 
    <result column="idCard" jdbcType="VARCHAR" property="idcard" /> 
 | 
    <result column="phone" jdbcType="VARCHAR" property="phone" /> 
 | 
    <result column="address" jdbcType="VARCHAR" property="address" /> 
 | 
  </resultMap> 
 | 
  <sql id="Base_Column_List"> 
 | 
    <!--@mbg.generated--> 
 | 
    id, town, village, `name`, idCard, phone, address 
 | 
  </sql> 
 | 
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> 
 | 
    <!--@mbg.generated--> 
 | 
    select  
 | 
    <include refid="Base_Column_List" /> 
 | 
    from se_client_temp 
 | 
    where id = #{id,jdbcType=INTEGER} 
 | 
  </select> 
 | 
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> 
 | 
    <!--@mbg.generated--> 
 | 
    delete from se_client_temp 
 | 
    where id = #{id,jdbcType=INTEGER} 
 | 
  </delete> 
 | 
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientTemp" useGeneratedKeys="true"> 
 | 
    <!--@mbg.generated--> 
 | 
    insert into se_client_temp (town, village, `name`,  
 | 
      idCard, phone, address 
 | 
      ) 
 | 
    values (#{town,jdbcType=VARCHAR}, #{village,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},  
 | 
      #{idcard,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR} 
 | 
      ) 
 | 
  </insert> 
 | 
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientTemp" useGeneratedKeys="true"> 
 | 
    <!--@mbg.generated--> 
 | 
    insert into se_client_temp 
 | 
    <trim prefix="(" suffix=")" suffixOverrides=","> 
 | 
      <if test="town != null"> 
 | 
        town, 
 | 
      </if> 
 | 
      <if test="village != null"> 
 | 
        village, 
 | 
      </if> 
 | 
      <if test="name != null"> 
 | 
        `name`, 
 | 
      </if> 
 | 
      <if test="idcard != null"> 
 | 
        idCard, 
 | 
      </if> 
 | 
      <if test="phone != null"> 
 | 
        phone, 
 | 
      </if> 
 | 
      <if test="address != null"> 
 | 
        address, 
 | 
      </if> 
 | 
    </trim> 
 | 
    <trim prefix="values (" suffix=")" suffixOverrides=","> 
 | 
      <if test="town != null"> 
 | 
        #{town,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
      <if test="village != null"> 
 | 
        #{village,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
      <if test="name != null"> 
 | 
        #{name,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
      <if test="idcard != null"> 
 | 
        #{idcard,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
      <if test="phone != null"> 
 | 
        #{phone,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
      <if test="address != null"> 
 | 
        #{address,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
    </trim> 
 | 
  </insert> 
 | 
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientTemp"> 
 | 
    <!--@mbg.generated--> 
 | 
    update se_client_temp 
 | 
    <set> 
 | 
      <if test="town != null"> 
 | 
        town = #{town,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
      <if test="village != null"> 
 | 
        village = #{village,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
      <if test="name != null"> 
 | 
        `name` = #{name,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
      <if test="idcard != null"> 
 | 
        idCard = #{idcard,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
      <if test="phone != null"> 
 | 
        phone = #{phone,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
      <if test="address != null"> 
 | 
        address = #{address,jdbcType=VARCHAR}, 
 | 
      </if> 
 | 
    </set> 
 | 
    where id = #{id,jdbcType=INTEGER} 
 | 
  </update> 
 | 
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeClientTemp"> 
 | 
    <!--@mbg.generated--> 
 | 
    update se_client_temp 
 | 
    set town = #{town,jdbcType=VARCHAR}, 
 | 
      village = #{village,jdbcType=VARCHAR}, 
 | 
      `name` = #{name,jdbcType=VARCHAR}, 
 | 
      idCard = #{idcard,jdbcType=VARCHAR}, 
 | 
      phone = #{phone,jdbcType=VARCHAR}, 
 | 
      address = #{address,jdbcType=VARCHAR} 
 | 
    where id = #{id,jdbcType=INTEGER} 
 | 
  </update> 
 | 
  
 | 
  <!--根据镇名获取农户--> 
 | 
  <select id="getClientsByTownName" resultType="com.dy.pipIrrGlobal.pojoSe.SeClientTemp"> 
 | 
    SELECT * FROM se_client_temp WHERE town = #{townName} 
 | 
  </select> 
 | 
</mapper> 
 |