t_wifi.id as id,
t_wifi.name as name,
t_wifi.SSID as SSID,
t_wifi.location as location,
t_wifi.apmac as apmac,
t_wifi.address as address,
t_wifi.longitude as longitude,
t_wifi.latitude as latitude,
t_wifi.place as place,
t_wifi.place_id as placeId,
t_wifi.operator_id as operatorId,
t_wifi.status as status,
t_wifi.updated as updated
id,
location,
address,
longitude,
latitude
SELECT
count(tw.id)
FROM
t_wifi tw LEFT JOIN t_location tl on tl.location = tw.location
LEFT JOIN t_place tp on tp.id = tw.place_id
LEFT JOIN t_place_class tpc on tp.id = tpc.place_id
LEFT JOIN t_place_class_info tpci on tpci.id = tpc.class_id
where tw.status != -1
and tl.cn = #{cn}
and tl.cn_city = #{cnCity}
and tw.place = #{place}
and tw.operator_id = #{operatorId}
and tpci.id = #{placeClassId}
and tw.apmac like #{mac}
SELECT
tw.id id,
tw.NAME name,
tw.SSID SSID,
tl.cn cn,
tl.cn_city cnCity,
tw.address address,
tw.longitude longitude,
tw.latitude latitude,
tw.apmac apmac,
tw.place place,
tp.name placeName,
tpci.name as placeClassName,
tw.updated updated,
tw.status status,
tw.operator_id operatorId
FROM
t_wifi tw LEFT JOIN t_location tl on tl.location = tw.location
LEFT JOIN t_place tp on tp.id = tw.place_id
LEFT JOIN t_place_class tpc on tp.id = tpc.place_id
LEFT JOIN t_place_class_info tpci on tpci.id = tpc.class_id
where tw.status != -1
and tl.cn = #{cn}
and tl.cn_city = #{cnCity}
and tw.place = #{place}
and tw.operator_id = #{operatorId}
and tpci.id = #{placeClassId}
and tw.apmac like #{mac}
order by tw.id asc
limit #{pager.offset}, #{pager.limit}
SELECT
tw.id id,
tw.NAME name,
tw.SSID SSID,
tl.cn cn,
tl.cn_city cnCity,
tw.address address,
tw.longitude longitude,
tw.latitude latitude,
tw.apmac apmac,
tw.place place,
tp.name placeName,
tpci.name as placeClassName,
tw.updated updated,
tw.status status,
tw.operator_id operatorId
FROM
t_wifi tw LEFT JOIN t_location tl on tl.location = tw.location
LEFT JOIN t_place tp on tp.id = tw.place_id
LEFT JOIN t_place_class tpc on tp.id = tpc.place_id
LEFT JOIN t_place_class_info tpci on tpci.id = tpc.class_id
where tw.status != -1
and tl.cn = #{cn}
and tl.cn_city = #{cnCity}
and tw.place = #{place}
and tw.operator_id = #{operatorId}
and tpci.id = #{placeClassId}
and tw.apmac like #{mac}
order by tw.id asc
select count(w.id) from t_wifi w, t_location l
w.location = l.location and w.status != -1 and w.operator_id = #{operatorId}
and l.cn = #{cn}
and l.cn_city = #{cnCity}
and w.place_id = #{placeId}
and w.place = #{place}
and (w.address like #{searchValue} or w.name like #{searchValue})
select
, t_location.cn as cn, t_location.cn_city as cnCity, t_place.name as placeName
from t_wifi, t_location, t_place
t_wifi.location = t_location.location and t_wifi.place_id = t_place.id
and t_wifi.status != -1 and t_wifi.operator_id = #{operatorId}
and t_location.cn = #{cn}
and t_location.cn_city = #{cnCity}
and t_wifi.place_id = #{placeId}
and t_wifi.place = #{place}
and (t_wifi.address like #{searchValue} or t_wifi.name like #{searchValue})
limit #{pager.offset}, #{pager.limit}
select
, t_location.cn as cn, t_location.cn_city as cnCity, t_place.name as placeName
from t_wifi, t_location, t_place
t_wifi.location = t_location.location and t_wifi.place_id = t_place.id
and t_wifi.status != -1 and t_wifi.operator_id = #{operatorId}
and t_location.cn = #{cn}
and t_location.cn_city = #{cnCity}
and t_wifi.place_id = #{placeId}
and t_wifi.place = #{place}
and (t_wifi.address like #{searchValue} or t_wifi.name like #{searchValue})
select
, t_location.cn as cn, t_location.cn_city as cnCity, t_place.name as placeName
from t_wifi, t_location, t_place
t_wifi.location = t_location.location and t_wifi.place_id = t_place.id
and t_wifi.status != -1 and t_wifi.id = #{id}
update t_wifi
set status=#{status},updated = #{updated}
where id in
#{id}
update t_wifi set name = #{name},
location = #{location},
address = #{address},
longitude = #{longitude},
latitude = #{latitude},
apmac = #{apmac},
place = #{place},
place_id = #{placeId}
where id = #{id}
insert into t_wifi(name, SSID, location, apmac, address, longitude, latitude, place, place_id, operator_id, updated)
values(#{name}, #{SSID}, #{location}, #{apmac}, #{address}, #{longitude}, #{latitude}, #{place}, #{placeId}, #{operatorId}, #{updated})
select
from t_wifi where 1 = 1
and address like #{value}
order by id
select
from t_wifi where location in (select location from t_wifi where location = #{location})
and latitude <= #{maxlat} and latitude >= #{minlat}
and longitude <= #{maxlng} and longitude >= #{minlng}
select
from t_wifi where location = #{location}
select
from t_wifi where id in (select wifi_id from t_adgroup_wifi where adgroup_id = #{adGroupId})
order by id
insert into
t_adgroup_wifi (adgroup_id,wifi_id)
values (#{adGroupId},#{wifiId})
delete from t_adgroup_wifi where adgroup_id = #{adGroupId}
select
from t_wifi where 1 = 1
and address like #{value}
order by id
limit #{pager.offset}, #{pager.limit}
select count(id)
from t_wifi where 1 = 1
and address like #{value}
SELECT count(wifi.id) FROM t_wifi wifi,t_wifi_group wg,t_wifi_group_info wgi
WHERE wg.wifi_id = wifi.id AND wg.group_id = wgi.id
and wifi.operator_id = #{operatorId} and wgi.name = #{name}
and wifi.apmac = #{apmac}
SELECT
wifi.id id,
wifi.operator_id operatorId,
wifi.name name,
wifi.SSID SSID,
wifi.location location,
wifi.apmac apmac,
wifi.address adderss,
wifi.longitude longitude,
wifi.latitude latitude,
wgi.name groupName,
wg.supdated supdated,
wg.status status
FROM
t_wifi wifi,
t_wifi_group wg,
t_wifi_group_info wgi
WHERE
wg.wifi_id = wifi.id
AND wg.group_id = wgi.id
and wifi.operator_id = #{operatorId}
and wgi.name = #{name}
and wifi.apmac = #{apmac}
SELECT
wifi.id id,
wifi.NAME name,
wifi.SSID SSID,
wifi.location location,
wifi.apmac apmac,
wifi.address address,
wifi.longitude longitude,
wifi.latitude latitude,
loc.cn cn,
loc.cn_city cnCity
FROM
t_wifi wifi,
t_location loc
WHERE
wifi.place_id = loc.id
and wifi.operator_id = #{operatorId}
and wifi.apmac = #{apmac}
and loc.cn = #{cn}
and loc.cn_city = #{cnCity}
limit #{pager.offset}, #{pager.limit}
SELECT count(wifi.id) FROM t_wifi wifi,t_location loc WHERE
wifi.place_id = loc.id
and wifi.operator_id = #{operatorId}
and wifi.apmac = #{apmac}
and loc.cn = #{cn}
and loc.cn_city = #{cnCity}