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

@@ -28,4 +28,33 @@
</resultMap>
<!-- 分页查询:联查类型名称 -->
<select id="selectVoPagePlus" resultType="com.klp.mes.eqp.domain.vo.EqpEquipmentManagementVo">
SELECT
em.equipment_id,
em.equipment_name,
em.model,
em.type_id,
et.type_name AS type_name,
em.equipment_code,
em.location,
em.quantity,
em.manager,
em.oss_id,
em.status,
em.stop_reason,
em.equipment_destination,
em.enable_time,
em.retire_time,
em.remark
FROM eqp_equipment_management em
LEFT JOIN eqp_equipment_type et ON em.type_id = et.type_id
<where>
em.del_flag = '0'
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
</mapper>

View File

@@ -19,6 +19,26 @@
<result property="delFlag" column="del_flag"/>
<result property="remark" column="remark"/>
</resultMap>
<select id="selectVoPagePlus" resultType="com.klp.mes.eqp.domain.vo.EqpEquipmentParamVo">
SELECT
ep.param_id,
ep.param_name,
ep.equipment_id,
ee.equipment_name AS equipment_name,
ep.param_type,
ep.param_standard,
ep.param_unit,
ep.param_source,
ep.remark
FROM eqp_equipment_param ep
LEFT JOIN eqp_equipment_management ee ON ep.equipment_id = ee.equipment_id
<where>
ep.del_flag = '0'
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
</mapper>

View File

@@ -20,6 +20,27 @@
<result property="delFlag" column="del_flag"/>
<result property="remark" column="remark"/>
</resultMap>
<select id="selectVoPagePlus" resultType="com.klp.mes.eqp.domain.vo.EqpTypeParamVo">
SELECT
tp.type_param_id,
tp.type_id,
tp.param_name,
tp.param_type,
tp.param_standard,
tp.param_unit,
tp.param_source,
tp.is_mandatory,
tp.remark,
t.type_name AS typeName
FROM eqp_type_param tp
LEFT JOIN eqp_equipment_type t ON tp.type_id = t.type_id
<where>
tp.del_flag = 0
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
</mapper>