|
@@ -27,14 +27,13 @@
|
|
|
|
|
|
<select id="countByParamsBack" parameterType="map" resultType="int">
|
|
|
SELECT
|
|
|
- count(DISTINCT(tw.id))
|
|
|
+ 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
|
|
|
- LEFT JOIN t_place_operator tpo on tpo.place_id = tp.id
|
|
|
- where tw.status != -1 and tpo.operator_id = tw.operator_id
|
|
|
+ where tw.status != -1
|
|
|
<if test="cn != null">
|
|
|
and tl.cn = #{cn}
|
|
|
</if>
|
|
@@ -42,7 +41,7 @@
|
|
|
and tl.cn_city = #{cnCity}
|
|
|
</if>
|
|
|
<if test="place != null">
|
|
|
- and tpo.name = #{place}
|
|
|
+ and tw.place = #{place}
|
|
|
</if>
|
|
|
<if test="operatorId != null">
|
|
|
and tw.operator_id = #{operatorId}
|
|
@@ -57,8 +56,8 @@
|
|
|
|
|
|
<select id="findByParamsBack" parameterType="map" resultType="Wifi">
|
|
|
SELECT
|
|
|
- DISTINCT(tw.id) id,
|
|
|
- tw. NAME NAME,
|
|
|
+ tw.id id,
|
|
|
+ tw.NAME name,
|
|
|
tw.SSID SSID,
|
|
|
tl.cn cn,
|
|
|
tl.cn_city cnCity,
|
|
@@ -68,6 +67,7 @@
|
|
|
tw.apmac apmac,
|
|
|
tw.place place,
|
|
|
tp.name placeName,
|
|
|
+ tpci.name as placeClassName,
|
|
|
tw.updated updated,
|
|
|
tw.status status,
|
|
|
tw.operator_id operatorId
|
|
@@ -76,8 +76,7 @@
|
|
|
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
|
|
|
- LEFT JOIN t_place_operator tpo on tpo.place_id = tp.id
|
|
|
- where tw.status != -1 and tpo.operator_id = tw.operator_id
|
|
|
+ where tw.status != -1
|
|
|
<if test="cn != null">
|
|
|
and tl.cn = #{cn}
|
|
|
</if>
|
|
@@ -85,7 +84,7 @@
|
|
|
and tl.cn_city = #{cnCity}
|
|
|
</if>
|
|
|
<if test="place != null">
|
|
|
- and tpo.name = #{place}
|
|
|
+ and tw.place = #{place}
|
|
|
</if>
|
|
|
<if test="operatorId != null">
|
|
|
and tw.operator_id = #{operatorId}
|
|
@@ -101,35 +100,47 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findByParams1Back" parameterType="map" resultType="Wifi">
|
|
|
- select c.*, t_place_class_info.name as placeClassName from
|
|
|
- (
|
|
|
- select
|
|
|
- <include refid="base_column" />, t_location.cn as cn, t_location.cn_city as cnCity, t_place.name as placeName, t_operator.company_name as operatorName
|
|
|
- from t_wifi, t_location, t_place, t_operator
|
|
|
- <where>
|
|
|
- t_wifi.location = t_location.location and t_wifi.place_id = t_place.id and t_wifi.operator_id = t_operator.id
|
|
|
- and t_wifi.status != -1
|
|
|
- <if test="operatorId != null">
|
|
|
- and t_wifi.operator_id = #{operatorId}
|
|
|
- </if>
|
|
|
- <if test="cn != null">
|
|
|
- and t_location.cn = #{cn}
|
|
|
- </if>
|
|
|
- <if test="cnCity != null">
|
|
|
- and t_location.cn_city = #{cnCity}
|
|
|
- </if>
|
|
|
- <if test="place != null">
|
|
|
- and t_wifi.place = #{place}
|
|
|
- </if>
|
|
|
- <if test="mac != null">
|
|
|
- and (t_wifi.apmac like #{mac})
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ) as c left join t_place_class pc on c.placeId = pc.place_id
|
|
|
- left join t_place_class_info on pc.class_id = t_place_class_info.id
|
|
|
- <if test="placeClassId != null">
|
|
|
- and pc.class_id = #{placeClassId}
|
|
|
+ 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
|
|
|
+ <if test="cn != null">
|
|
|
+ and tl.cn = #{cn}
|
|
|
+ </if>
|
|
|
+ <if test="cnCity != null">
|
|
|
+ and tl.cn_city = #{cnCity}
|
|
|
</if>
|
|
|
+ <if test="place != null">
|
|
|
+ and tw.place = #{place}
|
|
|
+ </if>
|
|
|
+ <if test="operatorId != null">
|
|
|
+ and tw.operator_id = #{operatorId}
|
|
|
+ </if>
|
|
|
+ <if test="placeClassId != null">
|
|
|
+ and tpci.id = #{placeClassId}
|
|
|
+ </if>
|
|
|
+ <if test="mac != null">
|
|
|
+ and tw.apmac like #{mac}
|
|
|
+ </if>
|
|
|
+ order by tw.id asc
|
|
|
</select>
|
|
|
|
|
|
<select id="countByParamsOperator" parameterType="map" resultType="int">
|