zhangherong
2025-06-25 23855599412c4d61b38d78f0f3abd3430a48b5b1
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/DocRelativeMapper.xml
对比新文件
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="org.jeecg.modules.dnc.mapper.DocRelativeMapper">
    <select id="findDeviceByDocId" resultType="org.jeecg.modules.mdc.entity.MdcEquipment" parameterType="String">
     SELECT
      d.id,
      d.equipment_id,
      d.equipment_name,
      d.control_system,
      d.equipment_model,
      d.equipment_type,
      d.equipment_ip,
      d.data_port,
      p.production_name
     FROM
      mdc_equipment d
       JOIN mdc_production_equipment g ON d.id = g.equipment_id
       JOIN mdc_production p ON p.id = g.production_id
     WHERE
      EXISTS (
       SELECT
        1
       FROM
        nc_doc_relative nr
       WHERE
        nr.doc_id = #{docId}
         AND nr.delete_flag = 0
         AND nr.attribution_type = 7
         AND nr.attribution_id = d.id
      );
    </select>
</mapper>