nnnjjj123
2021-01-28 71b6b716361c52af290493d365a328fc1a3467e2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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.regions.mapper.RegionsMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="regionsResultMap" type="org.springblade.modules.regions.entity.Regions">
        <id column="id" property="id"/>
        <result column="regionId" property="regionId"/>
        <result column="regionName" property="regionName"/>
        <result column="tTime" property="tTime"/>
        <result column="coordinate" property="coordinate"/>
        <result column="remarks" property="remarks"/>
    </resultMap>
 
 
    <select id="selectRegionsPage" resultMap="regionsResultMap">
        select * from sys_regions where is_deleted = 0
    </select>
 
 
    <insert id="insertqy">
    INSERT INTO sys_regions (regionId,regionName,tTime,coordinate,remarks) VALUES (#{regionId},#{regionName},#{time},ST_GeomFromText(${a}),#{remarks});
</insert>
 
    <update id="updateqy">
        update sys_regions SET regionId=#{regionId},regionName=#{regionName},tTime=#{tTime},coordinate=ST_GeomFromText(${a}),remarks=#{remarks} where id=#{id}
    </update>
 
    <select id="selectList" resultMap="regionsResultMap">
        SELECT id,regionId,regionName,tTime,ST_ASTEXT ( coordinate ) AS coordinate,remarks FROM sys_regions where 1=1
        <if test="regionName!=null and regionName!=''">
            and regionName  like '%${regionName}%'
        </if>
    </select>
 
    <select id="selectqy" resultType="java.util.HashMap">
        select regionId,regionName from sys_regions
    </select>
</mapper>