ParkingLotGeoSMapper.xml
4.91 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?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.zteits.park.mapper.smapper.ParkingLotGeoSMapper">
<resultMap id="BaseResultMap" type="com.zteits.park.domain.ParkingLotGeo">
<id column="geo_id" jdbcType="BIGINT" property="geoId"/>
<result column="lon_id" jdbcType="DECIMAL" property="lonId"/>
<result column="lat_id" jdbcType="DECIMAL" property="latId"/>
<result column="geo_no" jdbcType="CHAR" property="geoNo"/>
<result column="geo_name" jdbcType="VARCHAR" property="geoName"/>
<result column="geo_type" jdbcType="INTEGER" property="geoType"/>
<result column="pl_id" jdbcType="BIGINT" property="plId"/>
<result column="pl_name" jdbcType="VARCHAR" property="plName"/>
<result column="pl_no" jdbcType="VARCHAR" property="plNo"/>
<result column="data_status" jdbcType="INTEGER" property="dataStatus"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="create_op" jdbcType="BIGINT" property="createOp"/>
<result column="modify_time" jdbcType="DATE" property="modifyTime"/>
<result column="modify_op" jdbcType="BIGINT" property="modifyOp"/>
</resultMap>
<sql id="Base_Column_List">
geo_id, lon_id, lat_id, geo_no, geo_name, geo_type, pl_id, pl_name, pl_no, data_status,
create_time, create_op, modify_time, modify_op
</sql>
<!-- 停车场经纬度列表查询 -->
<select id="queryParkingLotGeoForList" resultMap="BaseResultMap"
parameterType="com.zteits.park.domain.ParkingLotGeo">
select
<include refid="Base_Column_List"/>
from parking_lot_geo
where 1=1
<choose>
<when test="parkingLotGeo.dataStatus != null">
and data_status = #{parkingLotGeo.dataStatus,jdbcType=INTEGER}
</when>
<otherwise>
and data_status =1
</otherwise>
</choose>
</select>
<insert id="batchSaveParkingLotGeo">
insert into parking_lot_geo (lon_id, lat_id, geo_no,
geo_name, geo_type, pl_id,
pl_name, pl_no, data_status,
create_time, create_op, modify_time,
modify_op)VALUES
<foreach collection="lotGeos" item="lotGeo" index="index" separator=",">
(
<trim>
#{lotGeo.lonId,jdbcType=DECIMAL},
#{lotGeo.latId,jdbcType=DECIMAL},
#{lotGeo.geoNo,jdbcType=CHAR},
#{lotGeo.geoName,jdbcType=VARCHAR},
#{lotGeo.geoType,jdbcType=INTEGER},
#{lotGeo.plId,jdbcType=BIGINT},
#{lotGeo.plName,jdbcType=VARCHAR},
#{lotGeo.plNo,jdbcType=VARCHAR},
<choose>
<when test="lotGeo.dataStatus != null">
#{lotGeo.dataStatus,jdbcType=INTEGER},
</when>
<otherwise>
1,
</otherwise>
</choose>
<choose>
<when test="lotGeo.createTime != null">
#{lotGeo.createTime,jdbcType=TIMESTAMP},
</when>
<otherwise>
NOW(),
</otherwise>
</choose>
#{lotGeo.createOp,jdbcType=BIGINT},
<choose>
<when test="lotGeo.modifyTime != null">
#{lotGeo.modifyTime,jdbcType=TIMESTAMP},
</when>
<otherwise>
NOW(),
</otherwise>
</choose>
#{lotGeo.modifyOp,jdbcType=BIGINT}
</trim>
)
</foreach>
</insert>
<!-- 停车场经纬度查询 -->
<select id="queryParkingLotGeoByParkNo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from parking_lot_geo
where data_status=1
<if test="null != geoType">
AND geo_type = #{geoType}
</if>
<if test="null != lonLatType">
AND lon_lat_type = #{lonLatType}
</if>
<if test="plNo != null">
and pl_no = #{plNo,jdbcType=VARCHAR}
</if>
</select>
<!-- 停车场经纬度list查询 -->
<select id="queryParkingLotGeoListByParkNos" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from parking_lot_geo
where data_status=1
<if test="null != geoType">
AND geo_type = #{geoType}
</if>
<if test="null != lonLatType">
AND lon_lat_type = #{lonLatType}
</if>
and pl_no in
<foreach collection="pklNos" open="(" close=")" separator="," item="plNo">
#{plNo}
</foreach>
</select>
</mapper>