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="com.se.nsl.mapper.SimuMapper">
| <insert id="inserts" parameterType="com.se.nsl.domain.po.Simu">
| insert into nsl.simu (
| 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.simu
| 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>
|
|