heheng
2024-11-07 3ca43826a747fda1447b2501901f84fc1a9019dd
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
package com.gkhy.labRiskManage.domain.riskReport.repository.jpa;
 
import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationScl;
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.time.LocalDateTime;
import java.util.List;
 
/**
 * 辨识方法-Scl
 */
@Repository
public interface RiskAssessPlanIdentificationSclRepository extends JpaRepository<RiskAssessPlanIdentificationScl, Long>, JpaSpecificationExecutor<RiskAssessPlanIdentificationScl> {
 
    /**
     * 辨识方法-Scl - 查询 by id
     */
    @Query(value = "select t from RiskAssessPlanIdentificationScl t where t.id = :id and t.deleteStatus = 0")
    RiskAssessPlanIdentificationScl getSclById(Long id);
    /**
     * 辨识方法-Scl -- 删除
     */
    @Query(value = "update RiskAssessPlanIdentificationScl set delete_status = 1,update_time = :date where id = :id and delete_status = 0", nativeQuery = true)
    RiskAssessPlanIdentificationScl deleteSclByPlanId(Long id, LocalDateTime date);
    /**
     * 辨识方法-Scl - list
     */
    @Query(value = "select t from RiskAssessPlanIdentificationScl t where t.assessPlanId = :id and t.deleteStatus = 0")
    List<RiskAssessPlanIdentificationScl> listSclByPlanId(Long id);
}