修复问题

This commit is contained in:
qinjie 2024-11-28 16:38:54 +08:00
parent 2f7a01984a
commit b831d28e89
5 changed files with 10 additions and 7 deletions

View File

@ -39,8 +39,8 @@ public class DeviceController {
@RequestParam(defaultValue = "10") Integer pageSize,
@RequestParam(required = false) String gasWellName,
@RequestParam(required = false) String gasStationName,
@RequestParam Long deviceTypeId) {
return Response.succeed(deviceService.page(currentPage, pageSize, gasWellName,gasStationName,deviceTypeId));
@RequestParam Long deviceTypeId,@RequestParam Long blockId) {
return Response.succeed(deviceService.page(currentPage, pageSize, gasWellName,gasStationName,deviceTypeId,blockId));
}
/**

View File

@ -20,7 +20,8 @@ public interface DeviceDao extends BaseMapper<Device> {
Page<DeviceVO> page(Page<Object> page,
@Param("gasWellName") String gasWellName,
@Param("gasStationName") String gasStationName,
@Param("deviceTypeId") Long deviceTypeId);
@Param("deviceTypeId") Long deviceTypeId,
@Param("blockId") Long blockId);
DeviceVO getDeviceById(@Param("id") Long id);

View File

@ -15,7 +15,7 @@ import java.util.Map;
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);

View File

@ -29,7 +29,6 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Service("deviceService")
@ -53,8 +52,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceDao, Device> implements
private DynamicRabbitListener dynamicRabbitListener;
@Override
public Page<DeviceVO> page(Integer currentPage, Integer pageSize, String gasWellName, String gasStationName,Long deviceTypeId){
Page<DeviceVO> page = deviceDao.page(new Page<>(currentPage, pageSize),gasWellName,gasStationName,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,blockId);
List<DeviceVO> deviceVOList = page.getRecords();
// 从Redis获取设备运行数据
if(CollectionUtil.isNotEmpty(deviceVOList)) {

View File

@ -48,6 +48,9 @@
<if test="deviceTypeId!=null and deviceTypeId!='' ">
and u.device_type = #{deviceTypeId}
</if>
<if test="blockId!=null and blockId!='' ">
and g.block_id = #{blockId}
</if>
</where>
order by u.id desc
</select>