src/main/java/com/whyc/controller/LithiumDataController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/mapper/LithiumDataMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/Fbs9100ChargerstateService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/LithiumDataService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/LithiumDataMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/controller/LithiumDataController.java
New file @@ -0,0 +1,25 @@ package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.service.LithiumDataService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @Api(tags = "在线监测-实时监控") @RestController @RequestMapping("LithiumAction") public class LithiumDataController { @Autowired private LithiumDataService service; @ApiOperation("根据电池id查询锂电池信息") @GetMapping("/getInfoByBattGroupId") private Response getInfoByBattGroupId(@RequestParam int battGroupId){ return service.getInfoByBattGroupId(battGroupId); } } src/main/java/com/whyc/mapper/LithiumDataMapper.java
New file @@ -0,0 +1,6 @@ package com.whyc.mapper; import com.whyc.pojo.LithiumData; public interface LithiumDataMapper extends CustomMapper<LithiumData>{ } src/main/java/com/whyc/service/Fbs9100ChargerstateService.java
@@ -20,6 +20,5 @@ List list=mapper.selectList(wrapper); PageInfo pageInfo=new PageInfo(list); return new Response().set(1,pageInfo); } } src/main/java/com/whyc/service/LithiumDataService.java
New file @@ -0,0 +1,25 @@ package com.whyc.service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageInfo; import com.whyc.dto.Response; import com.whyc.mapper.LithiumDataMapper; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @Service public class LithiumDataService { @Resource private LithiumDataMapper mapper; //根据电池id查询锂电池信息 public Response getInfoByBattGroupId(int battGroupId) { QueryWrapper wrapper=new QueryWrapper(); wrapper.eq("BattGroupId",battGroupId); List list=mapper.selectList(wrapper); PageInfo pageInfo=new PageInfo(list); return new Response().set(1,pageInfo); } } src/main/resources/mapper/LithiumDataMapper.xml
New file @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.whyc.mapper.LithiumDataMapper"> </mapper>