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.constants.StateConstants.CountMachineTaskState;
|
import com.northglass.entity.CountMachineTask;
|
|
public interface CountMachineTaskDao extends JpaRepository<CountMachineTask, Long> {
|
|
@Query("select t from CountMachineTask t where t.state = '" + CountMachineTaskState.IN_WORK + "' and t.countMachine.id = ?1")
|
public List<CountMachineTask> findInWorkTaskByCountMachine(Long countMachineId);
|
|
@Query("select t from CountMachineTask t where t.state = '" + CountMachineTaskState.IN_WORK + "' and t.countMachine.id = ?1 and t.rank = ?2")
|
public List<CountMachineTask> findInWorkTaskByCountMachineAndRank(Long countMachineId,String rank);
|
|
@Query("select t from CountMachineTask t where t.state = '" + CountMachineTaskState.WAITING + "' and t.countMachine.id = ?1")
|
public List<CountMachineTask> findWaitingTasksByCountMachine(Long countMachineId);
|
|
@Query("select t from CountMachineTask t where t.state = '" + CountMachineTaskState.WARNING + "' and t.countMachine.id = ?1")
|
public List<CountMachineTask> findWarningTasksByCountMachine(Long countMachineId);
|
|
@Query("select t from CountMachineTask t where t.state = '" + CountMachineTaskState.COMPLETED + "' and t.countMachine.id = ?1")
|
public List<CountMachineTask> findCompletedTasksByCountMachine(Long countMachineId);
|
|
@Query("select t from CountMachineTask t where t.state = '" + CountMachineTaskState.COMPLETED + "' and t.countMachine.id = ?1 and t.apart=?2")
|
public List<CountMachineTask> findCompletedTasksByCountMachineAndApartId(Long countMachineId,String apartId);
|
|
@Query("select t from CountMachineTask t where t.countMachine.id = ?1 and t.apart=?2")
|
public List<CountMachineTask> findTasksByCountMachineAndApartId(Long countMachineId,String apartId);
|
|
@Query("select t from CountMachineTask t where t.countMachine.id = ?1")
|
public List<CountMachineTask> findByCountMachine(Long countMachineId);
|
|
@Query("select t from CountMachineTask t where t.state =?1")
|
public List<CountMachineTask> findCompletedTasks(String state);
|
|
@Query("select t from CountMachineTask t where (t.state = '" + CountMachineTaskState.IN_WORK + "' or t.state = '" + CountMachineTaskState.WAITING + "') and t.countMachine.id = ?1")
|
public List<CountMachineTask> findInWorkTaskByid(Long countMachineId);
|
|
//新版本使用
|
//磨边后队列
|
@Query("select t from CountMachineTask t where t.state = '" + CountMachineTaskState.IN_WORK + "' and t.countMachine.id = ?1")
|
public List<CountMachineTask> findInworkTaskByid(Long countMachineId);
|
|
@Query("select t from CountMachineTask t where t.rawPackageTxt.id = ?1")
|
public List<CountMachineTask> findRawPackageTxtByid(Long countMachineId);
|
}
|