package com.gkhy.labRiskManage.domain.riskReport.repository.jpa;
|
|
import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLec;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.stereotype.Repository;
|
|
import java.util.List;
|
|
/**
|
* 评价方法LEC
|
*/
|
@Repository
|
public interface RiskAssessPlanEvaluateLecRepository extends JpaRepository<RiskAssessPlanEvaluateLec, Long>, JpaSpecificationExecutor<RiskAssessPlanEvaluateLec> {
|
|
/**
|
* 评价方法LEC 查询 - by id
|
*/
|
@Query(value = "select t from RiskAssessPlanEvaluateLec t where t.id = :id and t.deleteStatus = 0")
|
RiskAssessPlanEvaluateLec getLecById(Long id);
|
/**
|
* 评价方法LEC 删除 - by id
|
*/
|
@Query(value = "update RiskAssessPlanEvaluateLec set delete_status = 1 where id = :id and delete_status = 0", nativeQuery = true)
|
RiskAssessPlanEvaluateLec deleteLecByPlanId(Long id);
|
/**
|
* 评价方法LEC 查询 by 辨识方法
|
*/
|
@Query(value = "select t from RiskAssessPlanEvaluateLec t where t.identificationId = :identificationId and t.identificationMethod = :identificationMethod and t.deleteStatus = 0")
|
RiskAssessPlanEvaluateLec getLecByIdentification(Long identificationId, Byte identificationMethod);
|
/**
|
* 评价方法LEC - list
|
*/
|
@Query(value = "select t from RiskAssessPlanEvaluateLec t where t.assessPlanId = :id and t.deleteStatus = 0")
|
List<RiskAssessPlanEvaluateLec> listLecByPlanId(Long id);
|
|
// select t from BasicRiskUnit t where t.id in (?1) and t.deleteStatus = 0
|
@Query(value = "select t from RiskAssessPlanEvaluateLec t where t.assessPlanId in(?1) and t.deleteStatus = 0")
|
List<RiskAssessPlanEvaluateLec> getLecByIds(List<Long> assessPlanIds);
|
|
@Query(value = "select t from RiskAssessPlanEvaluateLec t where t.assessPlanId = :assessPlanId and t.deleteStatus = 0")
|
List<RiskAssessPlanEvaluateLec> getbyByAssessPlanId(Long assessPlanId);
|
|
@Query(value = "select t from RiskAssessPlanEvaluateLec t where t.assessPlanId = :id and t.deleteStatus = 0")
|
List<RiskAssessPlanEvaluateLec> getLecByPlanId(Long id);
|
|
|
@Query(value = "select t from RiskAssessPlanEvaluateLec t where t.assessPlanId = :assessPlanId and t.identificationId = :identificationId and t.identificationMethod = :identificationMethod and t.deleteStatus = 0")
|
List<RiskAssessPlanEvaluateLec> getLecByByParam(Long assessPlanId,Long identificationId, Byte identificationMethod);
|
|
}
|