package com.northglass.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import com.northglass.entity.MachineType; import com.northglass.entity.Machines; public interface MachineDao extends JpaRepository{ /*@Query("select t from Machine t where t.flag=?1") public List SelectMinchineFlag(String flag); @Query("select t from Machine t where t.number=?1") public Machines SelectMinchineNumber(String number); @Query("select t from Machine t where t.machineType.id=?1") public List SelectMinchineTypeid(Long typeid); @Query(nativeQuery=true,value="SELECT * FROM `gmms_machine` order by id desc limit 1") public Machines selectid();*/ @Query("select t from Machines t where t.machineName = '上片机1' and t.machineType.id=1 and t.ipAddress = '192.168.10.120' and t.port = 502 and t.state = '正常' and t.connectState = '未连接' and t.workState = '暂停' and t.workId = 1 and t.flag = '1' and t.remarks = '1' ") public List findMachineDispose(); @Query("select t from Machines t where t.machineType.id = 1") public List findload(); //有用 @Query("select t from Machines t where t.machineType.id = ?1") public List findLoadMachineRacksByLoadMachineId(long id); }