<?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.yssh.dao.YsshLocationMapper">
|
<resultMap id="YsshLocationResult" type="com.yssh.entity.YsshLocation">
|
<id column="id" property="id" javaType="java.lang.Integer" />
|
<id column="name" property="name" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="type" property="type" javaType="java.lang.String" jdbcType="VARCHAR"/>
|
<id column="lon" property="lon" javaType="java.lang.Float" jdbcType="DOUBLE"/>
|
<id column="lat" property="lat" javaType="java.lang.Float" jdbcType="DOUBLE"/>
|
</resultMap>
|
<select id="query" resultType="com.yssh.entity.YsshLocation">
|
select * from yssh_location where 1=1
|
<if test="name != null and name != ''">
|
and name = #{name}
|
</if>
|
<if test="type != null and type != ''">
|
and type = #{type}
|
</if>
|
</select>
|
<select id="getAll" resultType="com.yssh.entity.YsshLocation">
|
select * from yssh_location where 1=1
|
</select>
|
<insert id="insertLocation" parameterType="com.yssh.entity.YsshLocation">
|
insert into yssh_location(
|
name, type, lon, lat
|
)
|
values (
|
#{name},#{type},#{lon},#{lat}
|
)
|
</insert>
|
<delete id="deleteLocation">
|
delete from yssh_location where id = #{id}
|
</delete>
|
</mapper>
|