2018-08-29 18:45:12 +08:00

114 lines
3.7 KiB
XML

<?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.fhy.mapper.CityMapper" >
<resultMap id="BaseResultMap" type="com.fhy.pojo.City" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="city_id" property="cityId" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="province_id" property="provinceId" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, city_id, name, province_id
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from city
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from city
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.fhy.pojo.City" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into city (id, city_id, name,
province_id)
values (#{id,jdbcType=INTEGER}, #{cityId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{provinceId,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.fhy.pojo.City" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into city
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="cityId != null" >
city_id,
</if>
<if test="name != null" >
name,
</if>
<if test="provinceId != null" >
province_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="cityId != null" >
#{cityId,jdbcType=VARCHAR},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="provinceId != null" >
#{provinceId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.fhy.pojo.City" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update city
<set >
<if test="cityId != null" >
city_id = #{cityId,jdbcType=VARCHAR},
</if>
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="provinceId != null" >
province_id = #{provinceId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.fhy.pojo.City" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update city
set city_id = #{cityId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
province_id = #{provinceId,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>