src/main/java/com/whyc/controller/Li9130BmsStateController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/mapper/Li9130BmsStateMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/Li9130BmsStateService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/Li9130BmsStateMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/controller/Li9130BmsStateController.java
New file @@ -0,0 +1,26 @@ package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.service.Li9130BmsStateService; 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("Li9130BmsStateAction") public class Li9130BmsStateController { @Autowired private Li9130BmsStateService service; @ApiOperation("读取模拟量") @GetMapping("searchParam") private Response searchParam(@RequestParam int devId){ return service.searchParam(devId); } } src/main/java/com/whyc/mapper/Li9130BmsStateMapper.java
New file @@ -0,0 +1,6 @@ package com.whyc.mapper; import com.whyc.pojo.Li9130BmsState; public interface Li9130BmsStateMapper extends CustomMapper<Li9130BmsState>{ } src/main/java/com/whyc/service/Li9130BmsStateService.java
New file @@ -0,0 +1,28 @@ package com.whyc.service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.whyc.dto.Response; import com.whyc.mapper.Li9130BmsStateMapper; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @Service public class Li9130BmsStateService { @Resource private Li9130BmsStateMapper mapper; //读取模拟量 public Response searchParam(int devId) { PageHelper.startPage(1,4); QueryWrapper wrapper=new QueryWrapper(); wrapper.eq("dev_id",devId); wrapper.orderByAsc("num"); List list=mapper.selectList(wrapper); PageInfo pageInfo=new PageInfo(list); return new Response().set(1,pageInfo); } } src/main/resources/mapper/Li9130BmsStateMapper.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.Li9130BmsStateMapper"> </mapper>