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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
| <?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="com.se.nsl.mapper.SimuMapper">
| <insert id="insert" parameterType="com.se.nsl.domain.po.Simu">
| <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="id">
| select currval('nsl.simu_id_seq'::regclass) as id
| </selectKey>
|
| insert into nsl.tbl_yj_tr_simulate (
| name, service_name, type, area_type, area_name, data, status, result, create_time, create_user, bak, geom)
| values (
| #{name},
| #{serviceName},
| #{type},
| #{areaType},
| #{areaName},
| #{data},
| #{status},
| #{result},
| now(),
| #{createUser},
| #{bak},
| <choose>
| <when test="geom != null and geom != ''">
| ST_GeomFromText('${geom}')
| </when>
| <otherwise>
| null
| </otherwise>
| </choose>
| )
| </insert>
|
| <insert id="inserts" parameterType="com.se.nsl.domain.po.Simu">
| insert into nsl.tbl_yj_tr_simulate (
| name, service_name, type, area_type, data, status, result, create_time, create_user, bak, geom)
| values
| <foreach collection="list" item="item" separator=",">
| (
| #{item.name},
| #{item.serviceName},
| #{item.type},
| #{item.areaType},
| #{item.data},
| #{item.status},
| #{item.result},
| now(),
| #{item.createUser},
| #{item.bak},
| <choose>
| <when test="item.geom != null and item.geom != ''">
| ST_GeomFromText('${item.geom}')
| </when>
| <otherwise>
| null
| </otherwise>
| </choose>
| )
| </foreach>
| </insert>
|
| <update id="updates" parameterType="com.se.nsl.domain.po.Simu">
| <foreach collection="list" item="item" separator=";">
| update nsl.tbl_yj_tr_simulate
| set name=#{item.name},
| service_name=#{item.serviceName},
| type=#{item.type},
| area_type=#{item.areaType},
| data=#{item.data},
| status=#{item.status},
| result=#{item.result},
| update_time=now(),
| update_user=#{item.updateUser},
| bak=#{item.bak},
| <choose>
| <when test="item.geom != null and item.geom != ''">
| geom = ST_GeomFromText('${item.geom}')
| </when>
| <otherwise>
| geom = null
| </otherwise>
| </choose>
| where id = #{item.id}
| </foreach>
| </update>
| </mapper>
|
|