package com.sw.mes.yb.seed.dao;

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.yb.seed.entity.SeedRequireTask;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

public interface SeedRequireTaskDao extends BaseDao<SeedRequireTask,Long> {
    @Query(value = "select * from seed_require_task where code = ?1 and del = 0 order by id desc limit 1",nativeQuery = true)
    SeedRequireTask findByCode(String code);
    @Query(value = "select * from seed_require_task where del = 0 and end_time > ?1 order by create_time desc",nativeQuery = true)
    List<SeedRequireTask> findOldSeedRequireTask(String endTime);
    @Query(value = "select * from seed_require_task where del = 0 and end_time < ?1 order by create_time desc",nativeQuery = true)
    List<SeedRequireTask> findSeedRequireTask(String endTime);
}
