远程控制修改
This commit is contained in:
@ -17,6 +17,9 @@ public class StationRemoteControl implements Serializable {
|
|||||||
@ApiModelProperty(value = "电站id")
|
@ApiModelProperty(value = "电站id")
|
||||||
private Integer stationId;
|
private Integer stationId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电站名称")
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "远程访问ip、也可以是域名")
|
@ApiModelProperty(value = "远程访问ip、也可以是域名")
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,9 +1,12 @@
|
|||||||
package com.ho.business.mapper;
|
package com.ho.business.mapper;
|
||||||
|
|
||||||
import com.ho.business.entity.StationRemoteControl;
|
import com.ho.business.entity.StationRemoteControl;
|
||||||
|
import com.ho.business.vo.req.StationRemoteControlPageVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface StationRemoteControlMapper {
|
public interface StationRemoteControlMapper {
|
||||||
void insert(@Param("entity") StationRemoteControl entity);
|
void insert(@Param("entity") StationRemoteControl entity);
|
||||||
@ -13,4 +16,6 @@ public interface StationRemoteControlMapper {
|
|||||||
void delete(@Param("id") Integer id);
|
void delete(@Param("id") Integer id);
|
||||||
|
|
||||||
StationRemoteControl search(@Param("stationId") Integer stationId);
|
StationRemoteControl search(@Param("stationId") Integer stationId);
|
||||||
|
|
||||||
|
List<StationRemoteControl> selectList(@Param("vo") StationRemoteControlPageVo vo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package com.ho.business.service;
|
package com.ho.business.service;
|
||||||
|
|
||||||
import com.ho.business.entity.StationRemoteControl;
|
import com.ho.business.entity.StationRemoteControl;
|
||||||
|
import com.ho.business.vo.req.StationRemoteControlPageVo;
|
||||||
|
import com.ho.common.tools.util.PageResult;
|
||||||
|
|
||||||
public interface StationRemoteControlService {
|
public interface StationRemoteControlService {
|
||||||
void insert(StationRemoteControl entity);
|
void insert(StationRemoteControl entity);
|
||||||
@ -10,4 +12,6 @@ public interface StationRemoteControlService {
|
|||||||
void delete(Integer id);
|
void delete(Integer id);
|
||||||
|
|
||||||
StationRemoteControl search(Integer stationId);
|
StationRemoteControl search(Integer stationId);
|
||||||
|
|
||||||
|
PageResult<StationRemoteControl> selectPageList(StationRemoteControlPageVo vo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,19 @@
|
|||||||
package com.ho.business.service.impl;
|
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.entity.StationRemoteControl;
|
||||||
import com.ho.business.mapper.StationRemoteControlMapper;
|
import com.ho.business.mapper.StationRemoteControlMapper;
|
||||||
import com.ho.business.service.StationRemoteControlService;
|
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 lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class StationRemoteControlServiceImpl implements StationRemoteControlService {
|
public class StationRemoteControlServiceImpl implements StationRemoteControlService {
|
||||||
@ -33,4 +40,11 @@ public class StationRemoteControlServiceImpl implements StationRemoteControlServ
|
|||||||
public StationRemoteControl search(Integer stationId) {
|
public StationRemoteControl search(Integer stationId) {
|
||||||
return stationRemoteControlMapper.search(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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,7 +63,25 @@
|
|||||||
<delete id="delete">
|
<delete id="delete">
|
||||||
delete from station_remote_control where id = #{id,jdbcType=INTEGER}
|
delete from station_remote_control where id = #{id,jdbcType=INTEGER}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="search" resultType="com.ho.business.entity.StationRemoteControl">
|
<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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -1,18 +1,18 @@
|
|||||||
package com.ho.business.controller;
|
package com.ho.business.controller;
|
||||||
|
|
||||||
import com.ho.business.entity.Station;
|
|
||||||
import com.ho.business.entity.StationRemoteControl;
|
import com.ho.business.entity.StationRemoteControl;
|
||||||
import com.ho.business.service.StationRemoteControlService;
|
import com.ho.business.service.StationRemoteControlService;
|
||||||
import com.ho.business.service.StationService;
|
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.LogAnnotation;
|
||||||
import com.ho.common.tools.annotation.TokenIgnore;
|
import com.ho.common.tools.annotation.TokenIgnore;
|
||||||
import com.ho.common.tools.constant.ContextConstant;
|
import com.ho.common.tools.constant.ContextConstant;
|
||||||
import com.ho.common.tools.exception.BaseResponseCode;
|
import com.ho.common.tools.exception.BaseResponseCode;
|
||||||
import com.ho.common.tools.exception.BusinessException;
|
import com.ho.common.tools.exception.BusinessException;
|
||||||
import com.ho.common.tools.exception.DataResult;
|
import com.ho.common.tools.exception.DataResult;
|
||||||
|
import com.ho.common.tools.util.PageResult;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import jodd.util.StringUtil;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -67,4 +67,11 @@ public class StationRemoteController {
|
|||||||
StationRemoteControl stationRemoteControl=stationRemoteControlService.search(StationId);
|
StationRemoteControl stationRemoteControl=stationRemoteControlService.search(StationId);
|
||||||
return DataResult.success(stationRemoteControl);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user