| | |
| | | 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> |
| | |
| | | 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 |
| | |
| | | #{id} |
| | | </foreach> |
| | | </where> |
| | | ORDER BY mp.production_order |
| | | ORDER BY mp.sorter |
| | | </select> |
| | | |
| | | <!--根据大屏车间id查询设备列表--> |
| | |
| | | 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}),'%') |
| | |
| | | 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}),'%') |