分页查询围栏进出记录列表

This commit is contained in:
2025-09-22 15:58:00 +08:00
parent 5f36c25550
commit 9d642f4913
4 changed files with 110 additions and 22 deletions

View File

@ -8,7 +8,9 @@ import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
@ -25,19 +27,24 @@ public class DeviceFenceAccessRecordBo extends BaseEntity {
/**
* 记录ID
*/
@NotNull(message = "记录ID不能为空", groups = { EditGroup.class })
@NotNull(message = "记录ID不能为空", groups = {EditGroup.class})
private Long id;
/**
* 围栏ID
*/
@NotNull(message = "围栏ID不能为空", groups = { AddGroup.class, EditGroup.class })
@NotNull(message = "围栏ID不能为空", groups = {AddGroup.class, EditGroup.class})
private Long fenceId;
/**
* 围栏名称
*/
private String fenceName;
/**
* 设备标识
*/
@NotBlank(message = "设备标识不能为空", groups = { AddGroup.class, EditGroup.class })
@NotBlank(message = "设备标识不能为空", groups = {AddGroup.class, EditGroup.class})
private String deviceId;
/**
@ -48,19 +55,19 @@ public class DeviceFenceAccessRecordBo extends BaseEntity {
/**
* 事件类型
*/
@NotNull(message = "事件类型不能为空", groups = { AddGroup.class, EditGroup.class })
@NotNull(message = "事件类型不能为空", groups = {AddGroup.class, EditGroup.class})
private Long eventType;
/**
* 纬度
*/
@NotNull(message = "纬度不能为空", groups = { AddGroup.class, EditGroup.class })
@NotNull(message = "纬度不能为空", groups = {AddGroup.class, EditGroup.class})
private Double latitude;
/**
* 经度
*/
@NotNull(message = "经度不能为空", groups = { AddGroup.class, EditGroup.class })
@NotNull(message = "经度不能为空", groups = {AddGroup.class, EditGroup.class})
private Double longitude;
/**
@ -71,7 +78,7 @@ public class DeviceFenceAccessRecordBo extends BaseEntity {
/**
* 事件时间
*/
@NotNull(message = "事件时间不能为空", groups = { AddGroup.class, EditGroup.class })
@NotNull(message = "事件时间不能为空", groups = {AddGroup.class, EditGroup.class})
private Date eventTime;
/**

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuyuanshen.common.mybatis.core.mapper.BaseMapperPlus;
import com.fuyuanshen.equipment.domain.DeviceFenceAccessRecord;
import com.fuyuanshen.equipment.domain.bo.DeviceFenceAccessRecordBo;
import com.fuyuanshen.equipment.domain.vo.DeviceFenceAccessRecordVo;
import org.apache.ibatis.annotations.Param;
@ -29,5 +30,14 @@ public interface DeviceFenceAccessRecordMapper extends BaseMapperPlus<DeviceFenc
List<DeviceFenceAccessRecordVo> selectVoPageWithFenceAndDeviceName(@Param(Constants.WRAPPER) Wrapper<DeviceFenceAccessRecord> wrapper);
/**
* 分页查询围栏进出记录列表纯XML形式
*
* @param page 分页参数
* @param bo 查询条件
* @return 围栏进出记录分页列表
*/
Page<DeviceFenceAccessRecordVo> selectVoPageByXml(Page<DeviceFenceAccessRecord> page, @Param("bo") DeviceFenceAccessRecordBo bo);
}

View File

@ -54,7 +54,8 @@ public class DeviceFenceAccessRecordServiceImpl implements IDeviceFenceAccessRec
@Override
public TableDataInfo<DeviceFenceAccessRecordVo> queryPageList(DeviceFenceAccessRecordBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<DeviceFenceAccessRecord> lqw = buildQueryWrapper(bo);
Page<DeviceFenceAccessRecordVo> result = baseMapper.selectVoPageWithFenceAndDeviceName(pageQuery.build(), lqw);
// Page<DeviceFenceAccessRecordVo> result = baseMapper.selectVoPageWithFenceAndDeviceName(pageQuery.build(), lqw);
Page<DeviceFenceAccessRecordVo> result = baseMapper.selectVoPageByXml(pageQuery.build(), bo);
return TableDataInfo.build(result);
}
@ -85,6 +86,9 @@ public class DeviceFenceAccessRecordServiceImpl implements IDeviceFenceAccessRec
lqw.eq(bo.getAccuracy() != null, DeviceFenceAccessRecord::getAccuracy, bo.getAccuracy());
lqw.eq(bo.getEventTime() != null, DeviceFenceAccessRecord::getEventTime, bo.getEventTime());
lqw.eq(bo.getCreateTime() != null, DeviceFenceAccessRecord::getCreateTime, bo.getCreateTime());
if (StringUtils.isNotBlank(bo.getFenceName())) {
params.put("fenceName", bo.getFenceName());
}
return lqw;
}