修复问题
This commit is contained in:
parent
2f7a01984a
commit
b831d28e89
|
@ -39,8 +39,8 @@ public class DeviceController {
|
||||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||||
@RequestParam(required = false) String gasWellName,
|
@RequestParam(required = false) String gasWellName,
|
||||||
@RequestParam(required = false) String gasStationName,
|
@RequestParam(required = false) String gasStationName,
|
||||||
@RequestParam Long deviceTypeId) {
|
@RequestParam Long deviceTypeId,@RequestParam Long blockId) {
|
||||||
return Response.succeed(deviceService.page(currentPage, pageSize, gasWellName,gasStationName,deviceTypeId));
|
return Response.succeed(deviceService.page(currentPage, pageSize, gasWellName,gasStationName,deviceTypeId,blockId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -20,7 +20,8 @@ public interface DeviceDao extends BaseMapper<Device> {
|
||||||
Page<DeviceVO> page(Page<Object> page,
|
Page<DeviceVO> page(Page<Object> page,
|
||||||
@Param("gasWellName") String gasWellName,
|
@Param("gasWellName") String gasWellName,
|
||||||
@Param("gasStationName") String gasStationName,
|
@Param("gasStationName") String gasStationName,
|
||||||
@Param("deviceTypeId") Long deviceTypeId);
|
@Param("deviceTypeId") Long deviceTypeId,
|
||||||
|
@Param("blockId") Long blockId);
|
||||||
|
|
||||||
|
|
||||||
DeviceVO getDeviceById(@Param("id") Long id);
|
DeviceVO getDeviceById(@Param("id") Long id);
|
||||||
|
|
|
@ -15,7 +15,7 @@ import java.util.Map;
|
||||||
|
|
||||||
public interface DeviceService extends IService<Device> {
|
public interface DeviceService extends IService<Device> {
|
||||||
|
|
||||||
Page<DeviceVO> page(Integer currentPage, Integer pageSize, String gasWellName, String gasStationName, Long deviceTypeId);
|
Page<DeviceVO> page(Integer currentPage, Integer pageSize, String gasWellName, String gasStationName, Long deviceTypeId, Long blockId);
|
||||||
|
|
||||||
void add(DeviceCreateDTO deviceCreateDTO);
|
void add(DeviceCreateDTO deviceCreateDTO);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,6 @@ import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
|
|
||||||
@Service("deviceService")
|
@Service("deviceService")
|
||||||
|
@ -53,8 +52,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceDao, Device> implements
|
||||||
private DynamicRabbitListener dynamicRabbitListener;
|
private DynamicRabbitListener dynamicRabbitListener;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<DeviceVO> page(Integer currentPage, Integer pageSize, String gasWellName, String gasStationName,Long deviceTypeId){
|
public Page<DeviceVO> page(Integer currentPage, Integer pageSize, String gasWellName, String gasStationName, Long deviceTypeId, Long blockId){
|
||||||
Page<DeviceVO> page = deviceDao.page(new Page<>(currentPage, pageSize),gasWellName,gasStationName,deviceTypeId);
|
Page<DeviceVO> page = deviceDao.page(new Page<>(currentPage, pageSize),gasWellName,gasStationName,deviceTypeId,blockId);
|
||||||
List<DeviceVO> deviceVOList = page.getRecords();
|
List<DeviceVO> deviceVOList = page.getRecords();
|
||||||
// 从Redis获取设备运行数据
|
// 从Redis获取设备运行数据
|
||||||
if(CollectionUtil.isNotEmpty(deviceVOList)) {
|
if(CollectionUtil.isNotEmpty(deviceVOList)) {
|
||||||
|
|
|
@ -48,6 +48,9 @@
|
||||||
<if test="deviceTypeId!=null and deviceTypeId!='' ">
|
<if test="deviceTypeId!=null and deviceTypeId!='' ">
|
||||||
and u.device_type = #{deviceTypeId}
|
and u.device_type = #{deviceTypeId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="blockId!=null and blockId!='' ">
|
||||||
|
and g.block_id = #{blockId}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by u.id desc
|
order by u.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue