廖井涛
2025-06-11 42154214c5698326710edf336b3148830b646bb2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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<Machines, Long>{
    /*@Query("select t from Machine t where t.flag=?1")
    public List<Machines> 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<Machines> 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<Machines> findMachineDispose();
    
    @Query("select t from Machines t where t.machineType.id = 1")
    public List<Machines> findload();
    //有用
    @Query("select t from Machines t where t.machineType.id = ?1")
    public List<Machines> findLoadMachineRacksByLoadMachineId(long id);
}