<?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="org.springblade.modules.lang.mapper.LandMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="landResultMap" type="org.springblade.modules.lang.entity.Land">
|
<result column="id" property="id"/>
|
<result column="user_id" property="userId"/>
|
<result column="land_name" property="landName"/>
|
<result column="land_type" property="landType"/>
|
<result column="land_area" property="landArea"/>
|
<result column="land_range" property="landRange"/>
|
<result column="type" property="type"/>
|
<result column="land_unit" property="landUnit"/>
|
</resultMap>
|
|
|
<select id="selectLandPage" resultMap="landResultMap">
|
select *
|
from sys_land
|
where is_deleted = 0
|
</select>
|
|
<insert id="saveLandInfo">
|
insert into sys_land
|
(user_id,land_name,land_type,land_area,land_range,type,land_unit)
|
values
|
(#{land.userId},#{land.landName},#{land.landType},#{land.landArea},
|
<if test="land.landRange!=null and land.landRange!=''">
|
ST_GeomFromText(${land.landRange}),
|
</if>
|
#{land.type},#{land.landUnit})
|
</insert>
|
|
<!--详情信息(自定义查询)-->
|
<select id="getLandInfo" resultType="org.springblade.modules.lang.vo.LandVO">
|
select user_id,
|
land_name,
|
land_type,
|
land_area,
|
ST_ASTEXT(land_range) as landRange,
|
type,
|
land_unit
|
from sys_land
|
where 1 = 1 and is_deleted = 0
|
and id = #{land.id}
|
</select>
|
|
<!--自定义修改电子围栏数据-->
|
<update id="updateLandById">
|
update sys_land set user_id = #{land.userId},
|
land_name = #{land.landName},
|
land_type = #{land.landType},
|
land_area = #{land.landArea},
|
<if test="land.landRange!=null and land.landRange!=''">
|
land_range = ST_GeomFromText(${land.landRange}),
|
</if>
|
type = #{land.type},
|
land_unit = #{land.landUnit},
|
where id = #{land.id}
|
</update>
|
|
<select id="selectLandList" resultType="java.util.HashMap">
|
select id,land_name as landName from sys_land where user_id=#{userid} and is_deleted = 0
|
</select>
|
|
</mapper>
|