| | |
| | | </foreach> |
| | | </select> |
| | | |
| | | <!--根据产线id查询设备id集合--> |
| | | <select id="getEquipmentList" resultType="org.jeecg.modules.mdc.entity.MdcEquipment"> |
| | | SELECT |
| | | me.* |
| | | FROM |
| | | mdc_equipment me |
| | | LEFT JOIN mdc_production_equipment mpe ON me.id = mpe.equipment_id |
| | | WHERE |
| | | mpe.production_id IN |
| | | <foreach collection="allProductionIds" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <!--查询设备监控信息--> |
| | | <select id="checkStatusFromEquipmentIds" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentMonitor"> |
| | | SELECT |
| | |
| | | |
| | | <select id="queryByProductionIdAndType" resultType="org.jeecg.modules.mdc.entity.MdcEquipment"> |
| | | SELECT |
| | | me.* |
| | | me.*, |
| | | mpe.production_id |
| | | FROM |
| | | mdc_production_equipment mpe, |
| | | mdc_equipment me |
| | |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="findByProIdsAndTeamCode" resultType="org.jeecg.modules.mdc.entity.MdcEquipment"> |
| | | SELECT |
| | | t1.* |
| | | FROM |
| | | mdc_equipment t1 |
| | | LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id |
| | | WHERE t2.production_id IN |
| | | <foreach collection="mdcProductionIds" item = "productionId" index = "index" open = "(" close= ")" separator = ","> |
| | | #{productionId} |
| | | </foreach> |
| | | AND t1.team_code IN |
| | | <foreach collection="teamCodeList" item = "teamCode" index = "index" open = "(" close= ")" separator = ","> |
| | | #{teamCode} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="findByProIdsAndType" resultType="org.jeecg.modules.mdc.entity.MdcEquipment"> |
| | | SELECT |
| | | t1.* |
| | | FROM |
| | | mdc_equipment t1 |
| | | LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id |
| | | WHERE t2.production_id IN |
| | | <foreach collection="mdcProductionIds" item = "productionId" index = "index" open = "(" close= ")" separator = ","> |
| | | #{productionId} |
| | | </foreach> |
| | | AND t1.equipment_type IN |
| | | <foreach collection="typeList" item = "equipmentType" index = "index" open = "(" close= ")" separator = ","> |
| | | #{equipmentType} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="queryByDepartIdsAndType" resultType="org.jeecg.modules.mdc.entity.MdcEquipment"> |
| | | SELECT |
| | | e.*, |
| | | ep.production_id |
| | | FROM |
| | | mdc_equipment e |
| | | INNER JOIN mdc_production_equipment ep ON e.id = ep.equipment_id |
| | | WHERE |
| | | ep.production_id IN |
| | | <foreach collection='productionIds' item='id' open='(' separator=',' close=')'> |
| | | #{id} |
| | | </foreach> |
| | | AND e.id IN |
| | | <foreach collection='deviceIds' item='deviceId' open='(' separator=',' close=')'> |
| | | #{deviceId} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="getEquIdsByProIds" resultType="java.lang.String"> |
| | | SELECT |
| | | t1.equipment_id |
| | | FROM |
| | | mdc_equipment t1 |
| | | LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id |
| | | <where> |
| | | t2.production_id IN |
| | | <foreach collection="proIds" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |