src/main/java/com/whyc/mapper/StationInfMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/StationInfService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/StationInfMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/mapper/StationInfMapper.java
@@ -33,4 +33,7 @@ //站点信息 List<StationInf> getSateAnalysis(int userId); //找最大的stationid String getMaxStationId(); } src/main/java/com/whyc/service/StationInfService.java
@@ -2,7 +2,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.whyc.dto.Response; @@ -300,15 +299,21 @@ return new Response().set(1, false, "发生异常:" + e.getCause()); } } //找最大的stationid public String getMaxStationId() { QueryWrapper<StationInf> query = Wrappers.query(); /*QueryWrapper<StationInf> query = Wrappers.query(); query.select("stationId").orderByDesc("stationId").last(" limit 1"); StationInf stationInf = mapper.selectOne(query); if (stationInf == null) { return "42000000"; } else { return stationInf.getStationId(); }*/ String stationid = mapper.getMaxStationId(); if (stationid == null) { return "42000000"; } else { return stationid; } } src/main/resources/mapper/StationInfMapper.xml
@@ -243,4 +243,8 @@ and db_user.tb_user_battgroup_baojigroup_usr.uId = #{userId} ) </select> <select id="getMaxStationId" resultType="java.lang.String"> select max(cast(stationid as SIGNED)) from db_battinf.tb_station_inf </select> </mapper>