Lius
2025-04-28 572466e8ebaa67f1809a97ecf912d30e8802fd98
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml
@@ -4,37 +4,34 @@
    <select id="getBigScreenInfo" resultType="org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto">
        WITH LatestEquipmentLog AS (
            SELECT
                EquipmentID,
                MAX(CollectTime) AS maxgdtime
            FROM
                EquipmentLog
            GROUP BY
                EquipmentID
        )
        SELECT
            mew.id AS id,
            a.EquipmentID AS equipmentId,
            me.equipment_name AS equipmentName,
            me.equipment_type AS equipmentType,
            met.equipment_type_pictures AS equipmentImage,
            a.Oporation AS oporation,
            me.equipment_status AS equipmentStatus,
            mew.coordinate_left AS coordinateLeft,
            mew.coordinate_top AS coordinateTop,
            mew.vw AS vw,
            mew.vh AS vh,
            me.id AS 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 LatestEquipmentLog b ON a.EquipmentID = b.EquipmentID AND a.CollectTime = b.maxgdtime
                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
            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
            mwi.production_id = #{productionId}
            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">