Lius
2025-04-28 572466e8ebaa67f1809a97ecf912d30e8802fd98
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml
@@ -5,26 +5,33 @@
    <select id="getBigScreenInfo" resultType="org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto">
        SELECT
            mew.id id,
            a.EquipmentID equipmentId,
            me.equipment_name equipmentName,
            me.equipment_type equipmentType,
            met.equipment_type_pictures equipmentImage,
            a.Oporation equipmentStatus,
            mew.coordinate_left coordinateLeft,
            mew.coordinate_top coordinateTop,
            mew.vw vw,
            mew.vh vh,
            me.id equId
            t3.id AS id,
            t2.EquipmentID AS equipmentId,
            t1.equipment_name AS equipmentName,
            t1.equipment_type AS equipmentType,
            t5.equipment_type_pictures AS equipmentImage,
            t2.oporation AS oporation,
            t1.equipment_status AS equipmentStatus,
            t3.coordinate_left AS coordinateLeft,
            t3.coordinate_top AS coordinateTop,
            t3.vw AS vw,
            t3.vh AS vh,
            t1.id AS equId
        FROM
            EquipmentLog a
            INNER JOIN ( SELECT EquipmentID, MAX ( CollectTime ) maxgdtime FROM EquipmentLog GROUP BY EquipmentID ) b ON a.EquipmentID= b.EquipmentID
            INNER JOIN mdc_workshop_equipment mew ON mew.equipment_id = a.EquipmentID
            INNER JOIN mdc_equipment me ON me.equipment_id = a.EquipmentID
            INNER JOIN mdc_equipment_type met ON me.equipment_type = met.equipment_type_name
            INNER JOIN mdc_workshop_info mwi ON mew.workshop_id = mwi.id
            AND a.CollectTime= b.maxgdtime
            AND mwi.production_id = #{ productionId }
            mdc_equipment t1
                LEFT JOIN
            equipment t2 ON t1.equipment_id = t2.EquipmentID
                LEFT JOIN
            mdc_workshop_equipment t3 ON t1.equipment_id = t3.equipment_id
                LEFT JOIN
            mdc_equipment_type t5 ON t1.equipment_type = t5.equipment_type_name
        WHERE
            EXISTS (
                SELECT 1
                FROM mdc_workshop_info t4
                WHERE t3.workshop_id = t4.id
                  AND t4.production_id = #{ productionId }
            );
    </select>
    <select id="listByUser" resultType="org.jeecg.modules.mdc.entity.MdcWorkshopInfo">