Browse Source

热点管理的更新

Signed-off-by: you.chen <you.chen@cloudcross.com>
you.chen 9 years ago
parent
commit
4a11ec852e

+ 1 - 1
src/main/java/com/cloudcross/ssp/model/mapper/place.sql.xml

@@ -45,7 +45,7 @@
 	<select id="findUnclassfiedPlace" resultType="Place">
 	select <include refid="base_column"/> from t_place
 	where id not in(select place_id from t_place_class)
-	limit #{pager.offset}, #{pager.limit}
+	limit #{offset}, #{limit}
 	</select>
 	
 	<select id="countUnclassfiedPlace" resultType="int">

+ 48 - 37
src/main/java/com/cloudcross/ssp/model/mapper/wifi.sql.xml

@@ -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">

+ 2 - 3
src/main/java/com/cloudcross/ssp/web/back/main/ap/ApmacController.java

@@ -109,8 +109,7 @@ public class ApmacController extends SimpleController {
 			cn = String.valueOf(paramMap.get("cn"));
 		} 
 		
-		if(!StringUtils.hasLength((String)paramMap.get("cnCity"))) {
-			
+		if(null != paramMap.get("cnCity") && !"".equals(paramMap.get("cnCity"))) {
 			cnCity = String.valueOf(paramMap.get("cnCity"));
 		}
 		
@@ -157,7 +156,7 @@ public class ApmacController extends SimpleController {
 			place = "场景";
 		}
 		
-		if(null == placeClassId ||-1 == placeClassId) {
+		if(null == placeClassId || -1 == placeClassId) {
 			placeClassName = "数聚场景";
 		} else {
 			placeClassName = placeClassInformationService.findById(placeClassId).getName();

+ 4 - 2
src/main/webapp/assets/js/back/apPlace.js

@@ -4,7 +4,7 @@ $(document).ready(function() {
 	/***************************        新增数聚场景列表页    ***************************/
 
 	$("#btn-submit").click(function(){
-		var checkboxs = $("#place_left input[type='checkbox']:checked");
+		var checkboxs = $(".place_left input[type='checkbox']:checked");
 		var placeId = "";
 		if(checkboxs.length > 0){
 			placeId = checkboxs.map(function(i,span){
@@ -12,10 +12,12 @@ $(document).ready(function() {
 			}).toArray().join('-');
 		}else{
 			bootbox.alert("请选择待分类的子场景!");
+			return false;
 		}
-		var placeClassId = $("#place_right input[type='radio']:checked").val();
+		var placeClassId = $(".place_right input[type='radio']:checked").val();
 		if(placeClassId == undefined || placeClassId == ""){
 			bootbox.alert("请选择对应的数据场景!");
+			return false;
 		}
 		$.post(ctx+"/back/main/ap/place/add",{placeId:placeId,placeClassId:placeClassId},function(data){
 			$("#placeTopform").submit();