|
|
@ -1,7 +1,7 @@ |
|
|
<?xml version="1.0" encoding="UTF-8" ?> |
|
|
<?xml version="1.0" encoding="UTF-8" ?> |
|
|
<!DOCTYPE mapper |
|
|
<!DOCTYPE mapper |
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
|
|
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
<mapper namespace="com.chenhai.system.mapper.MapFeaturesMapper"> |
|
|
<mapper namespace="com.chenhai.system.mapper.MapFeaturesMapper"> |
|
|
|
|
|
|
|
|
<resultMap type="MapFeatures" id="MapFeaturesResult"> |
|
|
<resultMap type="MapFeatures" id="MapFeaturesResult"> |
|
|
@ -10,21 +10,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<result property="type" column="type" /> |
|
|
<result property="type" column="type" /> |
|
|
<result property="longitude" column="longitude" /> |
|
|
<result property="longitude" column="longitude" /> |
|
|
<result property="latitude" column="latitude" /> |
|
|
<result property="latitude" column="latitude" /> |
|
|
|
|
|
<result property="coordinates" column="coordinates" /> |
|
|
<result property="createdAt" column="created_at" /> |
|
|
<result property="createdAt" column="created_at" /> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
|
|
|
<sql id="selectMapFeaturesVo"> |
|
|
<sql id="selectMapFeaturesVo"> |
|
|
select id, name, type, longitude, latitude, created_at from map_features |
|
|
|
|
|
|
|
|
select id, name, type, longitude, latitude, coordinates, created_at from map_features |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<select id="selectMapFeaturesList" parameterType="MapFeatures" resultMap="MapFeaturesResult"> |
|
|
<select id="selectMapFeaturesList" parameterType="MapFeatures" resultMap="MapFeaturesResult"> |
|
|
<include refid="selectMapFeaturesVo"/> |
|
|
<include refid="selectMapFeaturesVo"/> |
|
|
<where> |
|
|
<where> |
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> |
|
|
|
|
|
<if test="type != null and type != ''"> and type = #{type}</if> |
|
|
|
|
|
<if test="longitude != null "> and longitude = #{longitude}</if> |
|
|
|
|
|
<if test="latitude != null "> and latitude = #{latitude}</if> |
|
|
|
|
|
<if test="createdAt != null "> and created_at = #{createdAt}</if> |
|
|
|
|
|
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> |
|
|
|
|
|
<if test="type != null and type != ''"> and type = #{type}</if> |
|
|
|
|
|
<if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if> |
|
|
|
|
|
<if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if> |
|
|
|
|
|
<if test="coordinates != null and coordinates != ''"> and coordinates = #{coordinates}</if> |
|
|
|
|
|
<if test="createdAt != null"> and created_at = #{createdAt}</if> |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
@ -38,17 +40,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
<if test="name != null and name != ''">name,</if> |
|
|
<if test="name != null and name != ''">name,</if> |
|
|
<if test="type != null and type != ''">type,</if> |
|
|
<if test="type != null and type != ''">type,</if> |
|
|
<if test="longitude != null">longitude,</if> |
|
|
|
|
|
<if test="latitude != null">latitude,</if> |
|
|
|
|
|
|
|
|
<if test="longitude != null and longitude != ''">longitude,</if> |
|
|
|
|
|
<if test="latitude != null and latitude != ''">latitude,</if> |
|
|
|
|
|
<if test="coordinates != null and coordinates != ''">coordinates,</if> |
|
|
<if test="createdAt != null">created_at,</if> |
|
|
<if test="createdAt != null">created_at,</if> |
|
|
</trim> |
|
|
|
|
|
|
|
|
</trim> |
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
<if test="name != null and name != ''">#{name},</if> |
|
|
<if test="name != null and name != ''">#{name},</if> |
|
|
<if test="type != null and type != ''">#{type},</if> |
|
|
<if test="type != null and type != ''">#{type},</if> |
|
|
<if test="longitude != null">#{longitude},</if> |
|
|
|
|
|
<if test="latitude != null">#{latitude},</if> |
|
|
|
|
|
|
|
|
<if test="longitude != null and longitude != ''">#{longitude},</if> |
|
|
|
|
|
<if test="latitude != null and latitude != ''">#{latitude},</if> |
|
|
|
|
|
<if test="coordinates != null and coordinates != ''">#{coordinates},</if> |
|
|
<if test="createdAt != null">#{createdAt},</if> |
|
|
<if test="createdAt != null">#{createdAt},</if> |
|
|
</trim> |
|
|
|
|
|
|
|
|
</trim> |
|
|
</insert> |
|
|
</insert> |
|
|
|
|
|
|
|
|
<update id="updateMapFeatures" parameterType="MapFeatures"> |
|
|
<update id="updateMapFeatures" parameterType="MapFeatures"> |
|
|
@ -56,8 +60,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
<if test="name != null and name != ''">name = #{name},</if> |
|
|
<if test="name != null and name != ''">name = #{name},</if> |
|
|
<if test="type != null and type != ''">type = #{type},</if> |
|
|
<if test="type != null and type != ''">type = #{type},</if> |
|
|
<if test="longitude != null">longitude = #{longitude},</if> |
|
|
|
|
|
<if test="latitude != null">latitude = #{latitude},</if> |
|
|
|
|
|
|
|
|
<if test="longitude != null and longitude != ''">longitude = #{longitude},</if> |
|
|
|
|
|
<if test="latitude != null and latitude != ''">latitude = #{latitude},</if> |
|
|
|
|
|
<if test="coordinates != null and coordinates != ''">coordinates = #{coordinates},</if> |
|
|
<if test="createdAt != null">created_at = #{createdAt},</if> |
|
|
<if test="createdAt != null">created_at = #{createdAt},</if> |
|
|
</trim> |
|
|
</trim> |
|
|
where id = #{id} |
|
|
where id = #{id} |
|
|
|