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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?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.duty.mapper.DutyMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="dutyResultMap" type="org.springblade.modules.duty.entity.Duty">
        <id column="id" property="id"/>
        <result column="snumber" property="snumber"/>
        <result column="rid" property="rid"/>
        <result column="regionId" property="regionId"/>
        <result column="type" property="type"/>
        <result column="sname" property="sname"/>
    </resultMap>
 
 
    <!--新增-->
    <insert id="insertduty">
       INSERT INTO act_duty (snumber,rid,regionId,type,sname) VALUES (#{snumber},#{rid},#{regionId},#{type},#{sname})
    </insert>
 
    <select id="selectDutyPage" resultMap="dutyResultMap">
        select * from act_duty where is_deleted = 0
    </select>
 
    <select id="selectInfo" resultType="java.util.HashMap">
        SELECT
    d.snumber,
    se.sname,
    r.regionId,
    r.regionName,
    ST_ASTEXT ( r.coordinate ) AS coordinater,
    r.remarks AS qybz,
    ro.id,
    ro.routeName,
    ST_ASTEXT ( ro.routeInfo ) AS routeInfo,
    ro.remarks AS lxbz,
    d.type
FROM
    act_duty d
    LEFT JOIN sys_regions r ON r.regionId = d.regionId
    LEFT JOIN sys_routein ro ON ro.id = d.rid
    LEFT JOIN sys_security se ON se.snumber = d.snumber
    where d.snumber=#{snumber}
    </select>
 
    <update id="updatedt">
        update act_duty SET type=#{type} where snumber=#{snumber}
    </update>
 
    <update id="updatedtInfo">
        update act_duty SET snumber=#{snumber},sname=#{sname} where rid=#{rid}
    </update>
 
</mapper>