feat(eqp): 实现设备管理分页联查功能

-PagePlus 新增 selectVo 接口支持关联查询
- 修改 EquipmentManagement、EquipmentParam 和 TypeParam 的分页查询逻辑
- 在 VO 对象中增加类型名称和设备名称字段用于展示- 更新 Mapper XML 文件中的 SQL 查询语句以支持左连接查询
- 调整 Service 层实现使用新的分页方法获取数据列表
This commit is contained in:
2025-10-17 18:09:17 +08:00
parent 7e5a82fa4f
commit f90623e18b
12 changed files with 116 additions and 6 deletions

View File

@@ -45,6 +45,12 @@ public class EqpEquipmentManagementVo {
@ExcelProperty(value = "设备类型ID")
private Long typeId;
/**
* 设备类型名称
*/
@ExcelProperty(value = "设备类型名称")
private String typeName;
/**
* 设备编码
*/

View File

@@ -69,5 +69,8 @@ public class EqpEquipmentParamVo {
@ExcelProperty(value = "备注")
private String remark;
@ExcelProperty(value = "设备名称")
private String equipmentName;
}

View File

@@ -77,5 +77,8 @@ public class EqpTypeParamVo {
@ExcelProperty(value = "备注")
private String remark;
//类型名称
@ExcelProperty(value = "类型名称")
private String typeName;
}

View File

@@ -1,5 +1,10 @@
package com.klp.mes.eqp.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import com.klp.mes.eqp.domain.EqpEquipmentManagement;
import com.klp.mes.eqp.domain.vo.EqpEquipmentManagementVo;
import com.klp.common.core.mapper.BaseMapperPlus;
@@ -12,4 +17,9 @@ import com.klp.common.core.mapper.BaseMapperPlus;
*/
public interface EqpEquipmentManagementMapper extends BaseMapperPlus<EqpEquipmentManagementMapper, EqpEquipmentManagement, EqpEquipmentManagementVo> {
/**
* 分页联查设备类型名称
*/
Page<EqpEquipmentManagementVo> selectVoPagePlus(Page<EqpEquipmentManagementVo> page, @Param("ew") LambdaQueryWrapper<EqpEquipmentManagement> lqw);
}

View File

@@ -1,8 +1,11 @@
package com.klp.mes.eqp.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.klp.mes.eqp.domain.EqpEquipmentParam;
import com.klp.mes.eqp.domain.vo.EqpEquipmentParamVo;
import com.klp.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
/**
* 设备参数Mapper接口
@@ -12,4 +15,5 @@ import com.klp.common.core.mapper.BaseMapperPlus;
*/
public interface EqpEquipmentParamMapper extends BaseMapperPlus<EqpEquipmentParamMapper, EqpEquipmentParam, EqpEquipmentParamVo> {
Page<EqpEquipmentParamVo> selectVoPagePlus(Page<Object> build,@Param("ew") LambdaQueryWrapper<EqpEquipmentParam> lqw);
}

View File

@@ -1,8 +1,11 @@
package com.klp.mes.eqp.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.klp.mes.eqp.domain.EqpTypeParam;
import com.klp.mes.eqp.domain.vo.EqpTypeParamVo;
import com.klp.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
/**
* 设备类型参数某类设备的通用参数标准Mapper接口
@@ -12,4 +15,5 @@ import com.klp.common.core.mapper.BaseMapperPlus;
*/
public interface EqpTypeParamMapper extends BaseMapperPlus<EqpTypeParamMapper, EqpTypeParam, EqpTypeParamVo> {
Page<EqpTypeParamVo> selectVoPagePlus(Page<Object> build,@Param("ew") LambdaQueryWrapper<EqpTypeParam> lqw);
}

View File

@@ -45,7 +45,7 @@ public class EqpEquipmentManagementServiceImpl implements IEqpEquipmentManagemen
@Override
public TableDataInfo<EqpEquipmentManagementVo> queryPageList(EqpEquipmentManagementBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<EqpEquipmentManagement> lqw = buildQueryWrapper(bo);
Page<EqpEquipmentManagementVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
Page<EqpEquipmentManagementVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
@@ -55,7 +55,11 @@ public class EqpEquipmentManagementServiceImpl implements IEqpEquipmentManagemen
@Override
public List<EqpEquipmentManagementVo> queryList(EqpEquipmentManagementBo bo) {
LambdaQueryWrapper<EqpEquipmentManagement> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
// 使用联查类型名称的 SQL
Page<EqpEquipmentManagementVo> build = new PageQuery().build();
build.setSize(Long.MAX_VALUE);
Page<EqpEquipmentManagementVo> eqpEquipmentManagementVoPage = baseMapper.selectVoPagePlus(build, lqw);
return eqpEquipmentManagementVoPage.getRecords();
}
private LambdaQueryWrapper<EqpEquipmentManagement> buildQueryWrapper(EqpEquipmentManagementBo bo) {

View File

@@ -45,7 +45,7 @@ public class EqpEquipmentParamServiceImpl implements IEqpEquipmentParamService {
@Override
public TableDataInfo<EqpEquipmentParamVo> queryPageList(EqpEquipmentParamBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<EqpEquipmentParam> lqw = buildQueryWrapper(bo);
Page<EqpEquipmentParamVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
Page<EqpEquipmentParamVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
@@ -55,7 +55,10 @@ public class EqpEquipmentParamServiceImpl implements IEqpEquipmentParamService {
@Override
public List<EqpEquipmentParamVo> queryList(EqpEquipmentParamBo bo) {
LambdaQueryWrapper<EqpEquipmentParam> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
Page<Object> build = new PageQuery().build();
build.setSize(Long.MAX_VALUE);
Page<EqpEquipmentParamVo> eqpEquipmentParamVoPage = baseMapper.selectVoPagePlus(build, lqw);
return eqpEquipmentParamVoPage.getRecords();
}
private LambdaQueryWrapper<EqpEquipmentParam> buildQueryWrapper(EqpEquipmentParamBo bo) {

View File

@@ -45,7 +45,7 @@ public class EqpTypeParamServiceImpl implements IEqpTypeParamService {
@Override
public TableDataInfo<EqpTypeParamVo> queryPageList(EqpTypeParamBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<EqpTypeParam> lqw = buildQueryWrapper(bo);
Page<EqpTypeParamVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
Page<EqpTypeParamVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
@@ -55,7 +55,10 @@ public class EqpTypeParamServiceImpl implements IEqpTypeParamService {
@Override
public List<EqpTypeParamVo> queryList(EqpTypeParamBo bo) {
LambdaQueryWrapper<EqpTypeParam> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
Page<Object> eqpTypeParamVoPage = new Page<>();
eqpTypeParamVoPage.setSize(Long.MAX_VALUE);
Page<EqpTypeParamVo> eqpTypeParamVoPage1 = baseMapper.selectVoPagePlus(eqpTypeParamVoPage, lqw);
return eqpTypeParamVoPage1.getRecords();
}
private LambdaQueryWrapper<EqpTypeParam> buildQueryWrapper(EqpTypeParamBo bo) {