diff --git a/business-service-api/src/main/java/com/ho/business/entity/StationRemoteControl.java b/business-service-api/src/main/java/com/ho/business/entity/StationRemoteControl.java index ffe239f..36a5ef0 100644 --- a/business-service-api/src/main/java/com/ho/business/entity/StationRemoteControl.java +++ b/business-service-api/src/main/java/com/ho/business/entity/StationRemoteControl.java @@ -17,6 +17,9 @@ public class StationRemoteControl implements Serializable { @ApiModelProperty(value = "电站id") private Integer stationId; + @ApiModelProperty(value = "电站名称") + private String stationName; + @ApiModelProperty(value = "远程访问ip、也可以是域名") private String ip; diff --git a/business-service-api/src/main/java/com/ho/business/vo/req/StationRemoteControlPageVo.java b/business-service-api/src/main/java/com/ho/business/vo/req/StationRemoteControlPageVo.java new file mode 100644 index 0000000..bbf6adf --- /dev/null +++ b/business-service-api/src/main/java/com/ho/business/vo/req/StationRemoteControlPageVo.java @@ -0,0 +1,16 @@ +package com.ho.business.vo.req; + +import com.ho.business.entity.StationRemoteControl; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class StationRemoteControlPageVo extends StationRemoteControl { + + @ApiModelProperty(value = "第几页") + private Integer pageNum=1; + + @ApiModelProperty(value = "分页数量") + private Integer pageSize=10; + +} diff --git a/business-service-dao/src/main/java/com/ho/business/mapper/StationRemoteControlMapper.java b/business-service-dao/src/main/java/com/ho/business/mapper/StationRemoteControlMapper.java index 4cf137c..987a4da 100644 --- a/business-service-dao/src/main/java/com/ho/business/mapper/StationRemoteControlMapper.java +++ b/business-service-dao/src/main/java/com/ho/business/mapper/StationRemoteControlMapper.java @@ -1,9 +1,12 @@ package com.ho.business.mapper; import com.ho.business.entity.StationRemoteControl; +import com.ho.business.vo.req.StationRemoteControlPageVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + @Mapper public interface StationRemoteControlMapper { void insert(@Param("entity") StationRemoteControl entity); @@ -13,4 +16,6 @@ public interface StationRemoteControlMapper { void delete(@Param("id") Integer id); StationRemoteControl search(@Param("stationId") Integer stationId); + + List selectList(@Param("vo") StationRemoteControlPageVo vo); } diff --git a/business-service-dao/src/main/java/com/ho/business/service/StationRemoteControlService.java b/business-service-dao/src/main/java/com/ho/business/service/StationRemoteControlService.java index be283c7..f5cadfb 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/StationRemoteControlService.java +++ b/business-service-dao/src/main/java/com/ho/business/service/StationRemoteControlService.java @@ -1,6 +1,8 @@ package com.ho.business.service; import com.ho.business.entity.StationRemoteControl; +import com.ho.business.vo.req.StationRemoteControlPageVo; +import com.ho.common.tools.util.PageResult; public interface StationRemoteControlService { void insert(StationRemoteControl entity); @@ -10,4 +12,6 @@ public interface StationRemoteControlService { void delete(Integer id); StationRemoteControl search(Integer stationId); + + PageResult selectPageList(StationRemoteControlPageVo vo); } diff --git a/business-service-dao/src/main/java/com/ho/business/service/impl/StationRemoteControlServiceImpl.java b/business-service-dao/src/main/java/com/ho/business/service/impl/StationRemoteControlServiceImpl.java index 33fdfca..d0f21a0 100644 --- a/business-service-dao/src/main/java/com/ho/business/service/impl/StationRemoteControlServiceImpl.java +++ b/business-service-dao/src/main/java/com/ho/business/service/impl/StationRemoteControlServiceImpl.java @@ -1,12 +1,19 @@ package com.ho.business.service.impl; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import com.ho.business.entity.StationRemoteControl; import com.ho.business.mapper.StationRemoteControlMapper; import com.ho.business.service.StationRemoteControlService; +import com.ho.business.vo.req.StationRemoteControlPageVo; +import com.ho.common.tools.util.PageResult; +import com.ho.common.tools.util.PageUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service @Slf4j public class StationRemoteControlServiceImpl implements StationRemoteControlService { @@ -33,4 +40,11 @@ public class StationRemoteControlServiceImpl implements StationRemoteControlServ public StationRemoteControl search(Integer stationId) { return stationRemoteControlMapper.search(stationId); } + + @Override + public PageResult selectPageList(StationRemoteControlPageVo vo) { + PageHelper.startPage(vo.getPageNum(), vo.getPageSize()); + List list = stationRemoteControlMapper.selectList(vo); + return PageUtils.getPageResult(new PageInfo<>(list)); + } } diff --git a/business-service-dao/src/main/resources/mapper/StationRemoteControlMapper.xml b/business-service-dao/src/main/resources/mapper/StationRemoteControlMapper.xml index 482cecd..43f8d26 100644 --- a/business-service-dao/src/main/resources/mapper/StationRemoteControlMapper.xml +++ b/business-service-dao/src/main/resources/mapper/StationRemoteControlMapper.xml @@ -63,7 +63,25 @@ delete from station_remote_control where id = #{id,jdbcType=INTEGER} + + + diff --git a/business-service/src/main/java/com/ho/business/controller/StationRemoteController.java b/business-service/src/main/java/com/ho/business/controller/StationRemoteController.java index 3ef6524..db63e83 100644 --- a/business-service/src/main/java/com/ho/business/controller/StationRemoteController.java +++ b/business-service/src/main/java/com/ho/business/controller/StationRemoteController.java @@ -1,18 +1,18 @@ package com.ho.business.controller; -import com.ho.business.entity.Station; import com.ho.business.entity.StationRemoteControl; import com.ho.business.service.StationRemoteControlService; import com.ho.business.service.StationService; +import com.ho.business.vo.req.StationRemoteControlPageVo; import com.ho.common.tools.annotation.LogAnnotation; import com.ho.common.tools.annotation.TokenIgnore; import com.ho.common.tools.constant.ContextConstant; import com.ho.common.tools.exception.BaseResponseCode; import com.ho.common.tools.exception.BusinessException; import com.ho.common.tools.exception.DataResult; +import com.ho.common.tools.util.PageResult; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import jodd.util.StringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -67,4 +67,11 @@ public class StationRemoteController { StationRemoteControl stationRemoteControl=stationRemoteControlService.search(StationId); return DataResult.success(stationRemoteControl); } + + @PostMapping("pageList") + @ApiOperation(value = "查询远控电站信息") + public DataResult> pageList(StationRemoteControlPageVo vo) { + PageResult page = stationRemoteControlService.selectPageList(vo); + return DataResult.success(page); + } }