新火炬后端单体项目初始化代码
cuilei
2025-08-07 60025c612e4d068255d498ad69fb737ff27bf521
src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
@@ -12,7 +12,7 @@
    <!--查询设备的所属产线名称信息-->
    <select id="getProNamesByEquipmentIds" resultType="org.jeecg.modules.mdc.vo.MdcEquipmentProVo">
        SELECT p.production_name, pe.equipment_id FROM mdc_production_equipment pe, mdc_production p WHERE p.id = pe.production_id AND pe.equipment_id IN
        SELECT f.factory_name, bef.equipment_id FROM base_equipment_factory bef, base_factory f WHERE f.id = bef.factory_id AND bef.equipment_id IN
        <foreach collection="equipmentIds" index="index" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
@@ -95,10 +95,10 @@
        me.*
        FROM
        mdc_equipment me
        LEFT JOIN mdc_production_equipment mpe ON me.id = mpe.equipment_id
        LEFT JOIN base_equipment_factory mpe ON me.id = mpe.equipment_id
        WHERE
        mpe.production_id IN
        <foreach collection="allProductionIds" index="index" item="id" open="(" separator="," close=")">
        mpe.factory_id IN
        <foreach collection="allFactoryIds" index="index" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </select>
@@ -181,14 +181,14 @@
        SELECT
            mp.id,
            mp.parent_id,
            mp.production_name,
            mp.org_type,
            mp.factory_name AS productionName,
            mp.factory_category AS orgtype,
            me.equipment_id,
            me.equipment_name,
            me.equipment_type
        FROM
            mdc_production_equipment mpe
            LEFT JOIN mdc_production mp ON mpe.production_id = mp.id
            base_equipment_factory mpe
            LEFT JOIN base_factory mp ON mpe.factory_id = mp.id
            LEFT JOIN mdc_equipment me ON me.id = mpe.equipment_id
        <where>
            me.equipment_id IN
@@ -196,7 +196,7 @@
                #{id}
            </foreach>
        </where>
        ORDER BY mp.production_order
        ORDER BY mp.sorter
    </select>
    <!--根据大屏车间id查询设备列表-->
@@ -221,8 +221,8 @@
            t1.*
        FROM
            mdc_equipment t1
            LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id
            LEFT JOIN mdc_production t3 ON t2.production_id = t3.id
            LEFT JOIN base_equipment_factory t2 ON t1.id = t2.equipment_id
            LEFT JOIN base_factory t3 ON t2.factory_id = t3.id
        <where>
            <if test="mdcEquipment.equipmentId != null and mdcEquipment.equipmentId != '' ">
                AND t1.equipment_id LIKE CONCAT(CONCAT('%',#{mdcEquipment.equipmentId}),'%')
@@ -260,8 +260,8 @@
            t1.*
        FROM
            mdc_equipment t1
            LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id
            LEFT JOIN mdc_production t3 ON t2.production_id = t3.id
            LEFT JOIN base_equipment_factory t2 ON t1.id = t2.equipment_id
            LEFT JOIN base_factory t3 ON t2.production_id = t3.id
        <where>
            <if test="mdcEquipment.equipmentId != null and mdcEquipment.equipmentId != '' ">
                AND t1.equipment_id LIKE CONCAT(CONCAT('%',#{mdcEquipment.equipmentId}),'%')
@@ -402,4 +402,29 @@
        </where>
    </select>
    <select id="queryByFactoryId" resultType="org.jeecg.modules.mdc.entity.MdcEquipment">
        SELECT
            me.*
        FROM
            base_equipment_factory bef,
            mdc_equipment me
        WHERE
            bef.equipment_id = me.id
          AND bef.factory_id = #{ factoryId }
        ORDER BY me.equipment_id
    </select>
    <select id="queryIdsByFactorys" resultType="java.lang.String">
        SELECT
            me.equipment_id
        FROM
            mdc_equipment me
            LEFT JOIN base_equipment_factory bef ON me.id = bef.equipment_id
        WHERE
            bef.factory_id IN
        <foreach collection="allFactoryIds" index="index" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </select>
</mapper>