nnnjjj123
2021-01-06 3b67e70f41bac39d1d74d2039a2fb286a32a8d41
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
<?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.trajectory.mapper.TrajectoryMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="trajectoryResultMap" type="org.springblade.modules.trajectory.entity.Trajectory">
        <id column="id" property="id"/>
        <result column="snumber" property="snumber"/>
        <result column="sname" property="sname"/>
        <result column="jd" property="jd"/>
        <result column="wd" property="wd"/>
        <result column="stime" property="stime"/>
        <result column="coordinate" property="coordinate"/>
    </resultMap>
 
 
    <select id="selectTrajectoryPage" resultMap="trajectoryResultMap">
        select * from sys_trajectory where is_deleted = 0
    </select>
 
 
    <insert id="s">
       INSERT INTO sys_trajectory (snumber,sname,jd,wd,stime,coordinate) VALUES (#{snumber},#{sname},#{jd},#{wd},#{stime},POINT(#{jd},#{wd}))
    </insert>
 
 
 
    <!--获取安保人员实时的所有位置信息-->
    <select id="selectList" resultMap="trajectoryResultMap">
        SELECT
        id,snumber,sname,jd,wd,stime,ST_ASTEXT(coordinate) as coordinate
        FROM
        sys_trajectory
        WHERE snumber=#{snumber}
    </select>
 
</mapper>