Browse Source

热点场景对应关系

jun.zhou 9 years ago
parent
commit
d4ab6669c0

+ 43 - 0
src/main/java/com/cloudcross/ssp/model/mapper/place-operator.sql.xml

@@ -108,4 +108,47 @@
 		        #{id}
 			</foreach>
 	</update>
+	
+	<select id="queryPlaceNameCountByCondition" parameterType="java.util.Map" resultType="java.lang.Integer">
+		SELECT
+			count(1)
+		FROM
+			t_operator tor,
+			t_place_operator tpor,
+			t_place tp,
+			t_place_class_info tpci,
+			t_place_class tpc
+		WHERE
+			tor.id = tpor.operator_id
+		AND tp.id = tpor.place_id
+		AND tpc.place_id = tp.id
+		AND tpc.class_id = tpci.id
+		and tpor.operator_id = #{operatorId}
+		<if test="searchValue != null">
+		and (tpor.name like #{searchValue} or tp.name like #{searchValue} or tpci.name like #{searchValue})
+		</if>
+	</select>
+	
+	<select id="queryPlaceNameByCondition" parameterType="java.util.Map" resultType="com.cloudcross.ssp.model.pojo.PlaceNamePojo">
+		SELECT 
+			tor.company_name operatorName,
+			tpor. NAME opeatorPlaceName,
+			tp. NAME placeName,
+			tpci. NAME placeClassName
+		FROM
+			t_operator tor,
+			t_place_operator tpor,
+			t_place tp,
+			t_place_class_info tpci,
+			t_place_class tpc
+		WHERE
+			tor.id = tpor.operator_id
+		AND tp.id = tpor.place_id
+		AND tpc.place_id = tp.id
+		AND tpc.class_id = tpci.id
+		and tpor.operator_id = #{operatorId}
+		<if test="searchValue != null">
+		and (tpor.name like #{searchValue} or tp.name like #{searchValue} or tpci.name like #{searchValue})
+		</if>
+	</select>
 </mapper>

+ 5 - 0
src/main/java/com/cloudcross/ssp/service/IPlaceOperatorService.java

@@ -6,6 +6,7 @@ import java.util.Map;
 import com.cloudcross.ssp.base.service.IGenericService;
 import com.cloudcross.ssp.common.utils.Pager;
 import com.cloudcross.ssp.model.PlaceOperator;
+import com.cloudcross.ssp.model.pojo.PlaceNamePojo;
 
 /**
  * 
@@ -59,4 +60,8 @@ public interface IPlaceOperatorService extends IGenericService<PlaceOperator> {
 	 * @return
 	 */
 	boolean update(Map<String, Object> paramMap);
+	
+	public Integer queryPlaceNameCountByCondition(Map<String,Object>condition);
+	
+	public List<PlaceNamePojo> queryPlaceNameByCondition(Map<String,Object>condition,Pager pager);
 }

+ 12 - 0
src/main/java/com/cloudcross/ssp/service/impl/PlaceOperatorService.java

@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
 import com.cloudcross.ssp.base.dao.GenericIBatisDao;
 import com.cloudcross.ssp.common.utils.Pager;
 import com.cloudcross.ssp.model.PlaceOperator;
+import com.cloudcross.ssp.model.pojo.PlaceNamePojo;
 import com.cloudcross.ssp.service.IPlaceOperatorService;
 
 @Service
@@ -108,4 +109,15 @@ public class PlaceOperatorService implements IPlaceOperatorService{
 		return true;
 	}
 
+	@Override
+	public Integer queryPlaceNameCountByCondition(Map<String, Object> condition) {
+		return myBatisDao.get("placeOperatorSqlMapper.queryPlaceNameCountByCondition", condition);
+	}
+
+	@Override
+	public List<PlaceNamePojo> queryPlaceNameByCondition(Map<String, Object> condition,Pager pager){
+		condition.put("pager", pager);
+		return myBatisDao.getList("placeOperatorSqlMapper.queryPlaceNameByCondition", condition);
+	}
+
 }

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

@@ -35,6 +35,7 @@ import com.cloudcross.ssp.model.Location;
 import com.cloudcross.ssp.model.Log;
 import com.cloudcross.ssp.model.PlaceOperator;
 import com.cloudcross.ssp.model.Wifi;
+import com.cloudcross.ssp.model.pojo.PlaceNamePojo;
 import com.cloudcross.ssp.service.ILocationService;
 import com.cloudcross.ssp.service.ILogService;
 import com.cloudcross.ssp.service.IOperatorService;
@@ -195,10 +196,10 @@ public class ApmacController extends SimpleController {
 		Pager pager = null;
 		pager = new Pager();
 		//查询符合条件的总的条数
-		totalRow = placeOperatorService.countByParams(paramMap);
+		totalRow = placeOperatorService.queryPlaceNameCountByCondition(paramMap);
 		pager.setPage(page);
 		pager.setTotalRow(totalRow);
-		List<PlaceOperator> placeOperatorList = placeOperatorService.findByParams(paramMap, pager);
+		List<PlaceNamePojo> placeOperatorList = placeOperatorService.queryPlaceNameByCondition(paramMap, pager);
 		model.addAttribute("placeOperatorList", placeOperatorList);
 		model.addAttribute("pager",pager);
 		model.addAttribute("searchValue",searchStr);

+ 7 - 5
src/main/webapp/WEB-INF/pages/operator/main/ap/apmac/relationship.ftl

@@ -35,16 +35,18 @@
 						<tr class="theadTr">
 							<th class="theadTh" style="width:20%;">媒体</th>
 							<th class="theadTh" style="width:20%;">场景</th>
-							<th class="theadTh" style="width:20%;">数聚场景</th>
+							<th class="theadTh" style="width:20%;">数聚场景(小)</th>
+							<th class="theadTh" style="width:20%;">数聚场景(大)</th>
 						</tr>
 					</thead>
 					<tbody>
 						<#if placeOperatorList ??>
-				        <#list placeOperatorList as placeOperator>
+				        <#list placeOperatorList as placeNamePojo>
 				        <tr id="tbodyTr">
-							<td class="tbodyTd">${placeOperator.operatorName!}</td>
-							<td class="tbodyTd">${placeOperator.name!}</td>
-							<td class="tbodyTd">${placeOperator.placeName!}</td>
+							<td class="tbodyTd">${placeNamePojo.operatorName!}</td>
+							<td class="tbodyTd">${placeNamePojo.opeatorPlaceName!}</td>
+							<td class="tbodyTd">${placeNamePojo.placeName!}</td>
+							<td class="tbodyTd">${placeNamePojo.placeClassName!}</td>
 					    </tr>
 					    </#list>  
 				       	</#if>