feat(eqp): 增加设备名称和备件名称的关联查询功能

- 在多个Mapper接口中添加selectVoPagePlus方法支持分页查询
- 在XML映射文件中新增selectVoPagePlus查询语句,联查设备管理表或备件表获取设备名称/备件名称- 修改ServiceImpl中的分页查询方法调用selectVoPagePlus替换原有的selectVoPage- 在Vo类中增加equipmentName和partName字段用于展示关联信息- 更新EqpEquipmentManagementMapper.xml中eqp_equipment_type关联查询条件,过滤已删除数据
- 优化queryList方法使用selectVoPagePlus实现列表查询功能
This commit is contained in:
2025-10-18 10:07:33 +08:00
parent c9e6fe6226
commit 843843ae06
18 changed files with 121 additions and 6 deletions

View File

@@ -48,7 +48,7 @@
em.retire_time,
em.remark
FROM eqp_equipment_management em
LEFT JOIN eqp_equipment_type et ON em.type_id = et.type_id
LEFT JOIN eqp_equipment_type et ON em.type_id = et.type_id and et.del_flag = '0'
<where>
em.del_flag = '0'
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">

View File

@@ -18,6 +18,25 @@
<result property="delFlag" column="del_flag"/>
<result property="remark" column="remark"/>
</resultMap>
<select id="selectVoPagePlus" resultType="com.klp.mes.eqp.domain.vo.EqpInspectedEquipmentVo">
SELECT
ie.inspect_id,
ie.equipment_id,
em.equipment_name AS equipmentName,
ie.inspect_time,
ie.inspect_vendor,
ie.remain_time,
ie.status,
ie.remark
FROM eqp_inspected_equipment ie
LEFT JOIN eqp_equipment_management em ON ie.equipment_id = em.equipment_id and em.del_flag = '0'
<where>
ie.del_flag = '0'
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
</mapper>

View File

@@ -18,6 +18,26 @@
<result property="delFlag" column="del_flag"/>
<result property="remark" column="remark"/>
</resultMap>
<select id="selectVoPagePlus" resultType="com.klp.mes.eqp.domain.vo.EqpInspectionRecordVo">
-- 联查设备管理表拿设备名称
SELECT
ir.record_id,
ir.equipment_id,
em.equipment_name AS equipmentName,
ir.inspect_time,
ir.inspect_vendor,
ir.inspect_content,
ir.result,
ir.remark
FROM eqp_inspection_record ir
LEFT JOIN eqp_equipment_management em ON ir.equipment_id = em.equipment_id and em.del_flag = '0'
<where>
ir.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.EqpSparePartVo">
SELECT
sp.part_id,
sp.part_name,
sp.material_category,
sp.model,
sp.unit,
sp.equipment_id,
em.equipment_name AS equipmentName,
sp.quantity,
sp.remark
FROM eqp_spare_part sp
LEFT JOIN eqp_equipment_management em ON sp.equipment_id = em.equipment_id and em.del_flag = '0'
<where>
sp.del_flag = '0'
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
</mapper>

View File

@@ -18,6 +18,26 @@
<result property="delFlag" column="del_flag"/>
<result property="remark" column="remark"/>
</resultMap>
<select id="selectVoPagePlus" resultType="com.klp.mes.eqp.domain.vo.EqpSparePartsChangeVo">
-- 联查备件表拿备件名称
SELECT
pc.change_id,
pc.part_id,
sp.part_name AS partName,
pc.change_type,
pc.change_quantity,
pc.reason,
pc.change_time,
pc.remark
FROM eqp_spare_parts_change pc
LEFT JOIN eqp_spare_part sp ON pc.part_id = sp.part_id and sp.del_flag = '0'
<where>
pc.del_flag = '0'
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
AND ${ew.sqlSegment}
</if>
</where>
</select>
</mapper>