package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLs; 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; /** * 评价方法LS */ @Repository public interface RiskAssessPlanEvaluateLsRepository extends JpaRepository, JpaSpecificationExecutor { /** * 评价方法LS 查询 - by id */ @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.id = :id and t.deleteStatus = 0") RiskAssessPlanEvaluateLs getLsById(Long id); /** * 评价方法LS 删除 - by id */ @Query(value = "update RiskAssessPlanEvaluateLs set delete_status = 1 where id = :id and delete_status = 0", nativeQuery = true) RiskAssessPlanEvaluateLs deleteLecByPlanId(Long id); /** * 评价方法LS - 查询 by 辨识方法 */ @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.identificationId = :identificationId and t.identificationMethod = :identificationMethod and t.deleteStatus = 0") RiskAssessPlanEvaluateLs getLsByIdentification(Long identificationId, Byte identificationMethod); /** * 评价方法LS - list */ @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId = :id and t.deleteStatus = 0") List listLsByPlanId(Long id); @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId in(?1) and t.deleteStatus = 0") List getLsByIds(List assessPlanIds); @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId = :assessPlanId and t.deleteStatus = 0") List getLsByAssessPlanId(Long assessPlanId); @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId = :id and t.deleteStatus = 0") List getLsByPlanId(Long id); }