74 lines
2.9 KiB
XML
74 lines
2.9 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.yanzhu.xd.system.mapper.SysNativeMapper">
|
||
|
|
||
|
<resultMap type="SysNative" id="SysNativeResult">
|
||
|
<result property="id" column="id" />
|
||
|
<result property="address" column="address" />
|
||
|
<result property="provinces" column="provinces" />
|
||
|
<result property="citiy" column="citiy" />
|
||
|
<result property="areas" column="areas" />
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectSysNativeVo">
|
||
|
select id, address, provinces, citiy, areas from sys_native
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectSysNativeList" parameterType="SysNative" resultMap="SysNativeResult">
|
||
|
<include refid="selectSysNativeVo"/>
|
||
|
<where>
|
||
|
<if test="address != null and address != ''"> and address = #{address}</if>
|
||
|
<if test="provinces != null and provinces != ''"> and provinces = #{provinces}</if>
|
||
|
<if test="citiy != null and citiy != ''"> and citiy = #{citiy}</if>
|
||
|
<if test="areas != null and areas != ''"> and areas = #{areas}</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectSysNativeById" parameterType="Long" resultMap="SysNativeResult">
|
||
|
<include refid="selectSysNativeVo"/>
|
||
|
where id = #{id}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertSysNative" parameterType="SysNative">
|
||
|
insert into sys_native
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="id != null">id,</if>
|
||
|
<if test="address != null">address,</if>
|
||
|
<if test="provinces != null">provinces,</if>
|
||
|
<if test="citiy != null">citiy,</if>
|
||
|
<if test="areas != null">areas,</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="id != null">#{id},</if>
|
||
|
<if test="address != null">#{address},</if>
|
||
|
<if test="provinces != null">#{provinces},</if>
|
||
|
<if test="citiy != null">#{citiy},</if>
|
||
|
<if test="areas != null">#{areas},</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateSysNative" parameterType="SysNative">
|
||
|
update sys_native
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="address != null">address = #{address},</if>
|
||
|
<if test="provinces != null">provinces = #{provinces},</if>
|
||
|
<if test="citiy != null">citiy = #{citiy},</if>
|
||
|
<if test="areas != null">areas = #{areas},</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteSysNativeById" parameterType="Long">
|
||
|
delete from sys_native where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteSysNativeByIds" parameterType="String">
|
||
|
delete from sys_native where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
</mapper>
|