远程控制修改

This commit is contained in:
2026-01-27 15:16:58 +08:00
parent a0841d75d7
commit 1295adb885
7 changed files with 70 additions and 3 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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<StationRemoteControl> selectList(@Param("vo") StationRemoteControlPageVo vo);
}

View File

@ -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<StationRemoteControl> selectPageList(StationRemoteControlPageVo vo);
}

View File

@ -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<StationRemoteControl> selectPageList(StationRemoteControlPageVo vo) {
PageHelper.startPage(vo.getPageNum(), vo.getPageSize());
List<StationRemoteControl> list = stationRemoteControlMapper.selectList(vo);
return PageUtils.getPageResult(new PageInfo<>(list));
}
}

View File

@ -63,7 +63,25 @@
<delete id="delete">
delete from station_remote_control where id = #{id,jdbcType=INTEGER}
</delete>
<select id="search" resultType="com.ho.business.entity.StationRemoteControl">
select * from station_remote_control where station_id = #{stationId,jdbcType=INTEGER}
select s.*,t.name stationName from station_remote_control s
left join station t on s.station_id = t.id
<where>
<if test="stationId != null and stationId !=''">
and s.station_id = #{stationId}
</if>
</where>
</select>
<select id="selectList" resultType="com.ho.business.entity.StationRemoteControl">
select s.*,t.name stationName from station_remote_control s
left join station t on s.station_id = t.id
<where>
<if test="vo.stationId != null and vo.stationId !=''">
and s.station_id = #{vo.stationId}
</if>
</where>
order by s.create_time desc
</select>
</mapper>

View File

@ -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<PageResult<StationRemoteControl>> pageList(StationRemoteControlPageVo vo) {
PageResult<StationRemoteControl> page = stationRemoteControlService.selectPageList(vo);
return DataResult.success(page);
}
}