From 10740191a1cc9c75dbe290b35ab9aee706933e06 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Mon, 20 Jan 2020 18:02:45 +0800 Subject: [PATCH] update --- .../MapTop/AndroidMapController.java | 27 +++++++++++++++---- .../com/yutou/jianrdb/Dao/MapNodeDao.java | 9 +++++-- .../yutou/jianrdb/Mapper/MapNodeService.java | 10 +++++-- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/yutou/controller/MapTop/AndroidMapController.java b/src/main/java/com/yutou/controller/MapTop/AndroidMapController.java index 293b3b4..2d41d4f 100644 --- a/src/main/java/com/yutou/controller/MapTop/AndroidMapController.java +++ b/src/main/java/com/yutou/controller/MapTop/AndroidMapController.java @@ -3,12 +3,16 @@ package com.yutou.controller.MapTop; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.yutou.enums.UserEnum; +import com.yutou.jianrdb.Bean.GameInfoLog; import com.yutou.jianrdb.Bean.MapNode; import com.yutou.jianrdb.Mapper.MapNodeService; import com.yutou.maptop.Bean.MapTop; import com.yutou.maptop.Bean.UserTeam; import com.yutou.maptop.services.MapTopService; import com.yutou.maptop.services.UserTeamService; +import com.yutou.mybatis.ZsShipType; +import com.yutou.mybatis.ZsShipTypeExample; +import com.yutou.mybatis.dao.ZsShipTypeMapper; import com.yutou.utlis.Tools; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -21,12 +25,11 @@ import java.util.List; @Controller public class AndroidMapController { - @Resource - UserTeamService userTeamService; - @Resource - MapTopService mapTopService; + @Resource MapNodeService mapNodeService; + @Resource + ZsShipTypeMapper jianTypeMapper; /** * 全部数据 @@ -90,7 +93,7 @@ public class AndroidMapController { } int count=50; - List list=mapNodeService.selectNodeByMid(node,limit,count); + List list=mapNodeService.selectNodeByMid(node,limit,count); json.put("count",list.size()); json.put("data", JSONArray.toJSON(list)); if(list.size()==count){ @@ -100,5 +103,19 @@ public class AndroidMapController { } return json.toJSONString(); } + @ResponseBody + @RequestMapping("/android/ship/type.do") + public String getShipType(HttpServletRequest request){ + JSONObject json=new JSONObject(); + if(Tools.getUidOfToken(request)<=0){ + json.put("msg",UserEnum.LOGIN_NOT_LOGIN.msg); + json.put("code", UserEnum.LOGIN_NOT_LOGIN.code); + return json.toString(); + } + List list=mapNodeService.selectAllShipType(); + json.put("count",list.size()); + json.put("data", JSONArray.toJSON(list)); + return json.toJSONString(); + } } diff --git a/src/main/java/com/yutou/jianrdb/Dao/MapNodeDao.java b/src/main/java/com/yutou/jianrdb/Dao/MapNodeDao.java index af0f006..c22b341 100644 --- a/src/main/java/com/yutou/jianrdb/Dao/MapNodeDao.java +++ b/src/main/java/com/yutou/jianrdb/Dao/MapNodeDao.java @@ -1,7 +1,9 @@ package com.yutou.jianrdb.Dao; +import com.yutou.jianrdb.Bean.GameInfoLog; import com.yutou.jianrdb.Bean.MapNode; import com.yutou.maptop.Bean.UserTeam; +import com.yutou.mybatis.ZsShipType; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.springframework.beans.factory.annotation.Qualifier; @@ -22,6 +24,9 @@ public interface MapNodeDao { @Select("SELECT * FROM jrmbdb.zs_node_info where chapter_name=#{chapterName} and level_name=#{lievelName};") List selectMapByNode(@Param("chapterName")String chapterName,@Param("lievelName")String levelName); - @Select("SELECT * FROM jrmbdb.game_info_log where `type`='DealNode' and ext like '%pve%' and ext like '%#{nid}%' order by id desc limit #{limit},#{count};") - List selectNodeByMid(@Param("nid")int nodeId,@Param("limit")int limit,@Param("count")int count); + @Select("SELECT * FROM jrmbdb.game_info_log where `type`='DealNode' and message like '%warReport%' and ext like '%pve%' and ext like #{nid} order by id desc limit #{limit},#{count};") + List selectNodeByMid(@Param("nid")String nodeId, @Param("limit")int limit, @Param("count")int count); + + @Select("SELECT * FROM jrmbdb.zs_ship_type;") + List selectAllShipType(); } diff --git a/src/main/java/com/yutou/jianrdb/Mapper/MapNodeService.java b/src/main/java/com/yutou/jianrdb/Mapper/MapNodeService.java index 3154a70..09491a3 100644 --- a/src/main/java/com/yutou/jianrdb/Mapper/MapNodeService.java +++ b/src/main/java/com/yutou/jianrdb/Mapper/MapNodeService.java @@ -1,8 +1,10 @@ package com.yutou.jianrdb.Mapper; +import com.yutou.jianrdb.Bean.GameInfoLog; import com.yutou.jianrdb.Bean.MapNode; import com.yutou.jianrdb.Dao.MapNodeDao; import com.yutou.maptop.Bean.UserTeam; +import com.yutou.mybatis.ZsShipType; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -29,8 +31,12 @@ public class MapNodeService { return dao.selectMapByNode(chapterName, levelName); } - public List selectNodeByMid(int nodeId, int limit, int count) { - return dao.selectNodeByMid(nodeId, limit, count); + public List selectNodeByMid(int nodeId, int limit, int count) { + return dao.selectNodeByMid("%"+nodeId+"%", limit, count); + } + + public List selectAllShipType(){ + return dao.selectAllShipType(); } }