|
|
@@ -0,0 +1,95 @@
|
|
|
+<?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.goafanti.common.dao.AdminLocationMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.AdminLocation" >
|
|
|
+ <id column="id" property="id" jdbcType="VARCHAR" />
|
|
|
+ <result column="admin_id" property="adminId" jdbcType="VARCHAR" />
|
|
|
+ <result column="province" property="province" jdbcType="INTEGER" />
|
|
|
+ <result column="city" property="city" jdbcType="INTEGER" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ id, admin_id, province, city
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from admin_location
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
|
+ delete from admin_location
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.AdminLocation" >
|
|
|
+ insert into admin_location (id, admin_id, province,
|
|
|
+ city)
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{adminId,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER},
|
|
|
+ #{city,jdbcType=INTEGER})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.AdminLocation" >
|
|
|
+ insert into admin_location
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="id != null" >
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="adminId != null" >
|
|
|
+ admin_id,
|
|
|
+ </if>
|
|
|
+ <if test="province != null" >
|
|
|
+ province,
|
|
|
+ </if>
|
|
|
+ <if test="city != null" >
|
|
|
+ city,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="id != null" >
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="adminId != null" >
|
|
|
+ #{adminId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="province != null" >
|
|
|
+ #{province,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="city != null" >
|
|
|
+ #{city,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AdminLocation" >
|
|
|
+ update admin_location
|
|
|
+ <set >
|
|
|
+ <if test="adminId != null" >
|
|
|
+ admin_id = #{adminId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="province != null" >
|
|
|
+ province = #{province,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="city != null" >
|
|
|
+ city = #{city,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.AdminLocation" >
|
|
|
+ update admin_location
|
|
|
+ set admin_id = #{adminId,jdbcType=VARCHAR},
|
|
|
+ province = #{province,jdbcType=INTEGER},
|
|
|
+ city = #{city,jdbcType=INTEGER}
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <insert id="insertBatch" parameterType="com.goafanti.common.model.AdminLocation">
|
|
|
+ insert into admin_location
|
|
|
+ (id, admin_id,
|
|
|
+ province, city)
|
|
|
+ values
|
|
|
+ <foreach item="item" index="index" collection="list" separator=",">
|
|
|
+ (
|
|
|
+ #{item.id,jdbcType=VARCHAR}, #{item.adminId,jdbcType=VARCHAR},
|
|
|
+ #{item.province,jdbcType=INTEGER}, #{item.city,jdbcType=INTEGER}
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+</mapper>
|