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

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

import java.util.List;

public interface SeedPlanOrderDao extends BaseDao<SeedPlanOrder,Long> {
    //根据编码获取籽晶计划单
    @Query(value = "select * from seed_plan_order where plan_code = ?1",nativeQuery = true)
    SeedPlanOrder findByCode(@Param("planCode") String planCode);
    //获取合格的计划单,过滤掉关闭和不生产的单子
    @Query(value = "select * from seed_plan_order where status != 'CLOSE' and production_status = 1",nativeQuery = true)
    List<SeedPlanOrder> findNormalOrder();
}
