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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?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.task.mapper.TaskMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="taskResultMap" type="org.springblade.modules.task.entity.Task">
        <id column="id" property="id"/>
        <result column="taskname" property="taskname"/>
        <result column="content" property="content"/>
        <result column="type" property="type"/>
        <result column="handlep" property="handlep"/>
        <result column="handname" property="handname"/>
        <result column="handletime" property="handletime"/>
        <result column="jd" property="jd"/>
        <result column="wd" property="wd"/>
        <result column="coordinate" property="coordinate"/>
 
        <result column="tid" property="tid"/>
        <result column="address" property="address"/>
    </resultMap>
 
 
    <select id="selectTaskPage" resultMap="taskResultMap">
        select id,taskname,content,type,handlep,handname,handletime,FORMAT(jd,6) as jd,FORMAT(wd,6) as wd,ST_ASTEXT(coordinate) as coordinate,address from sys_task
    </select>
 
 
<!--新增-->
    <insert id="insertTask" parameterType="org.springblade.modules.task.entity.Task">
       INSERT INTO sys_task (taskname,content,jd,wd,coordinate,tid,address) VALUES (#{taskname},#{content},#{jd},#{wd},POINT(#{jd},#{wd}),#{tid},#{address})
    </insert>
 
    <update id="updatet">
 update sys_task SET type=#{type},handlep=#{handlep},handname=#{handname},handletime=#{handletime} where id=#{id}
</update>
 
    <!--日常任务列表-->
    <select id="selectList" resultMap="taskResultMap">
        select id,taskname,content,type,handlep,handname,handletime,jd,wd,ST_ASTEXT(coordinate) as coordinate,tid,address from sys_task where type=0
    </select>
 
    <select id="selectInfo" resultMap="taskResultMap">
        select id,taskname,content,type,handlep,handname,handletime,FORMAT(jd,6) as jd,FORMAT(wd,6) as wd,tid,address from sys_task where id=#{id}
    </select>
 
    <!--App日常任务列表-->
    <select id="selectLists" resultMap="taskResultMap">
        select id,taskname,content,type,handlep,handname,handletime,jd,wd,ST_ASTEXT(coordinate) as coordinate,tid,address from sys_task where 1=1
        <if test="handleP!=null and handleP!=''">
            and handleP=#{handleP}
        </if>
        <if test="type!=null and type!=''">
            and type=#{type}
        </if>
    </select>
</mapper>