package com.sifang.modules.supply.warehouse.dao;

import com.sifang.modules.supply.warehouse.entity.CrmSupplyPurchaseOrderInspectionDetail;
import com.sifang.modules.sys.common.persistence.BaseDao;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class CrmSupplyPurchaseOrderInspectionDetailDao extends BaseDao<CrmSupplyPurchaseOrderInspectionDetail> {


    public List<CrmSupplyPurchaseOrderInspectionDetail> getDetailList(String inspectionId){
        String sql = "from CrmSupplyPurchaseOrderInspectionDetail where inspectionId = :inspectionId and status ='1'";
        Query query = getSession().createQuery(sql);
        query.setParameter("inspectionId", inspectionId);
        List<CrmSupplyPurchaseOrderInspectionDetail> list = query.list();
        return list;
    }
}
