PoiFenceMapper.xml
5.21 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?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="cn.com.glsx.admin.modules.mapper.PoiFenceMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.admin.modules.entity.PoiFence">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="poi_name" jdbcType="VARCHAR" property="poiName"/>
<result column="poi_type" jdbcType="TINYINT" property="poiType"/>
<result column="enable_status" jdbcType="TINYINT" property="enableStatus"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="created_by" jdbcType="INTEGER" property="createdBy"/>
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
<result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.com.glsx.admin.modules.entity.PoiFence">
<!--
WARNING - @mbg.generated
-->
<result column="lnglat" jdbcType="LONGVARCHAR" property="lnglat"/>
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, poi_name, poi_type, enable_status, remark, del_flag, created_date, created_by, updated_date,
updated_by
</sql>
<sql id="Blob_Column_List">
<!--
WARNING - @mbg.generated
-->
lnglat
</sql>
<update id="modify">
UPDATE t_poi_fence
SET enable_status = #{enableStatus}
WHERE id = #{id}
</update>
<delete id="logicDeleteById">
UPDATE t_poi_fence
SET del_flag = -1
WHERE id = #{id}
</delete>
<select id="search" resultType="cn.com.glsx.admin.modules.model.vo.PoiFenceSearchVO">
SELECT tpf.id AS id,
tpf.poi_name AS poiName,
tpf.poi_type AS poiType,
tpf.enable_status AS enableStatus,
tpf.created_date AS createdDate,
tu.username AS createUserName,
tpf.created_by AS createdBy
FROM t_poi_fence tpf LEFT JOIN t_user tu ON tu.Id = tpf.created_by
where tpf.del_flag = 0
<if test="keywords != null and keywords !=''">
and (
tpf.poi_name like CONCAT('%',#{keywords},'%')
or
tu.username like CONCAT('%',#{keywords},'%')
)
</if>
<if test="poiType != null">
and tpf.poi_type = #{poiType}
</if>
<if test="createBeginDate != null and createBeginDate != ''">
and LEFT(tpf.created_date,10) >= #{createBeginDate}
</if>
<if test="createEndDate != null and createEndDate != ''">
and LEFT(tpf.created_date,10) <= #{createEndDate}
</if>
<if test="userId != null ">
and tpf.created_by in (#{userId})
</if>
order by tpf.id desc
</select>
<select id="export" resultType="cn.com.glsx.admin.modules.model.export.PoiFenceExport">
SELECT tpf.poi_name AS poiName,
tpf.poi_type AS poiType,
tpf.enable_status AS enableStatus,
tpf.created_date AS createdDate,
tu.username AS createUserName,
tpf.created_by AS createdBy
FROM t_poi_fence tpf LEFT JOIN t_user tu ON tu.Id = tpf.created_by
where tpf.del_flag = 0
<if test="keywords != null and keywords !=''">
and (
tpf.poi_name like CONCAT('%',#{keywords},'%')
or
tu.username like CONCAT('%',#{keywords},'%')
)
</if>
<if test="poiType != null">
and tpf.poi_type = #{poiType}
</if>
<if test="createBeginDate != null and createBeginDate != ''">
and LEFT(tpf.created_date,10) >= #{createBeginDate}
</if>
<if test="createEndDate != null and createEndDate != ''">
and LEFT(tpf.created_date,10) <= #{createEndDate}
</if>
<if test="userId != null ">
and tpf.created_by in (#{userId})
</if>
order by tpf.id desc
</select>
<select id="checkPoiName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from t_poi_fence
where del_flag = 0
and poi_name = #{poiName}
limit 1
</select>
<select id="findOneById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from t_poi_fence
where del_flag = 0
and id = #{id}
</select>
<select id="queryPoiTrack" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from t_poi_fence
where del_flag = 0
and enable_status = 1
<if test="userId != null ">
and created_by in (#{userId})
</if>
order by id desc
limit 3000
</select>
</mapper>