<?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.reptileclient.jlifeapp.dao.jz.SysCityMapper" >
  <resultMap id="BaseResultMap" type="com.reptileclient.jlifeapp.entity.jz.SysCity" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="city_name" property="cityName" jdbcType="VARCHAR" />
    <result column="city_address" property="cityAddress" jdbcType="VARCHAR" />
    <result column="area_id" property="areaId" jdbcType="BIGINT" />
    <result column="is_delete" property="isDelete" jdbcType="BIT" />
    <result column="create_user" property="createUser" jdbcType="BIGINT" />
    <result column="craete_time" property="craeteTime" jdbcType="TIMESTAMP" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, city_name, city_address, area_id, is_delete, create_user, craete_time, update_time, 
    create_time
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from sys_city
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from sys_city
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.reptileclient.jlifeapp.entity.jz.SysCity" >
    insert into sys_city (id, city_name, city_address, 
      area_id, is_delete, create_user, 
      craete_time, update_time, create_time
      )
    values (#{id,jdbcType=BIGINT}, #{cityName,jdbcType=VARCHAR}, #{cityAddress,jdbcType=VARCHAR}, 
      #{areaId,jdbcType=BIGINT}, #{isDelete,jdbcType=BIT}, #{createUser,jdbcType=BIGINT}, 
      #{craeteTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.reptileclient.jlifeapp.entity.jz.SysCity" >
    insert into sys_city
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="cityName != null" >
        city_name,
      </if>
      <if test="cityAddress != null" >
        city_address,
      </if>
      <if test="areaId != null" >
        area_id,
      </if>
      <if test="isDelete != null" >
        is_delete,
      </if>
      <if test="createUser != null" >
        create_user,
      </if>
      <if test="craeteTime != null" >
        craete_time,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="cityName != null" >
        #{cityName,jdbcType=VARCHAR},
      </if>
      <if test="cityAddress != null" >
        #{cityAddress,jdbcType=VARCHAR},
      </if>
      <if test="areaId != null" >
        #{areaId,jdbcType=BIGINT},
      </if>
      <if test="isDelete != null" >
        #{isDelete,jdbcType=BIT},
      </if>
      <if test="createUser != null" >
        #{createUser,jdbcType=BIGINT},
      </if>
      <if test="craeteTime != null" >
        #{craeteTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.reptileclient.jlifeapp.entity.jz.SysCity" >
    update sys_city
    <set >
      <if test="cityName != null" >
        city_name = #{cityName,jdbcType=VARCHAR},
      </if>
      <if test="cityAddress != null" >
        city_address = #{cityAddress,jdbcType=VARCHAR},
      </if>
      <if test="areaId != null" >
        area_id = #{areaId,jdbcType=BIGINT},
      </if>
      <if test="isDelete != null" >
        is_delete = #{isDelete,jdbcType=BIT},
      </if>
      <if test="createUser != null" >
        create_user = #{createUser,jdbcType=BIGINT},
      </if>
      <if test="craeteTime != null" >
        craete_time = #{craeteTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.reptileclient.jlifeapp.entity.jz.SysCity" >
    update sys_city
    set city_name = #{cityName,jdbcType=VARCHAR},
      city_address = #{cityAddress,jdbcType=VARCHAR},
      area_id = #{areaId,jdbcType=BIGINT},
      is_delete = #{isDelete,jdbcType=BIT},
      create_user = #{createUser,jdbcType=BIGINT},
      craete_time = #{craeteTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
  
  <select id="selectAll" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select
    <include refid="Base_Column_List" />
    from sys_city where is_delete =0
  </select>
</mapper>