郑永安
2023-06-19 9d488beac4ff8bdb47f90e2ddd5fd9d907371797
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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<RiskAssessPlanEvaluateLs, Long>, JpaSpecificationExecutor<RiskAssessPlanEvaluateLs> {
 
    /**
     * 评价方法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<RiskAssessPlanEvaluateLs> listLsByPlanId(Long id);
 
    @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId in(?1) and t.deleteStatus = 0")
    List<RiskAssessPlanEvaluateLs> getLsByIds(List<Long> assessPlanIds);
 
    @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId = :assessPlanId and t.deleteStatus = 0")
    List<RiskAssessPlanEvaluateLs> getLsByAssessPlanId(Long assessPlanId);
 
    @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId = :id and t.deleteStatus = 0")
    List<RiskAssessPlanEvaluateLs> getLsByPlanId(Long id);
}