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.CuttingOptPattern;
|
|
|
public interface CuttingOptPatternDao extends JpaRepository<CuttingOptPattern, Long>{
|
|
//1号线待切割的任务
|
@Query("select t from CuttingOptPattern t where t.state= '待切割' and t.groups='1'")
|
public List<CuttingOptPattern> findByState();
|
|
//1号线待切割或者待开始的任务
|
@Query("select t from CuttingOptPattern t where (t.state= '待切割' or t.state='待开始') and t.groups='1'")
|
public List<CuttingOptPattern> findTask();
|
|
|
//找到1号线最大id的对象的文件名(领取的最新任务)
|
@Query("select m from CuttingOptPattern m where m.txt_name =(select t.txt_name from CuttingOptPattern t where t.id =(select max(id) from CuttingOptPattern p where 1=1))")
|
public List<CuttingOptPattern> findNewTasks();
|
|
//找到1号线领取的最新任务处于待开始任务的状态
|
@Query("select m from CuttingOptPattern m where m.txt_name =(select t.txt_name from CuttingOptPattern t where t.id =(select max(id) from CuttingOptPattern p where 1=1)) and m.state='待开始'")
|
public List<CuttingOptPattern> findWaitTasks();
|
|
}
|