heheng
2025-05-16 8485affcb0d4de05059d80cb1e844d6b18291654
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.RiskAssessPlanIdentificationPha;
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;
 
/**
 * 辨识方法-Pha
 */
@Repository
public interface RiskAssessPlanIdentificationPhaRepository extends JpaRepository<RiskAssessPlanIdentificationPha, Long>, JpaSpecificationExecutor<RiskAssessPlanIdentificationPha> {
 
    /**
     * 辨识方法 - 查询 by id
     */
    @Query(value = "select t from RiskAssessPlanIdentificationPha t where t.id = :id and t.deleteStatus = 0")
    RiskAssessPlanIdentificationPha getPhaById(Long id);
    /**
     * 辨识方法 - 删除
     */
    @Query(value = "update RiskAssessPlanIdentificationPha set delete_status = 1,update_time = :date where id = :id and delete_status = 0", nativeQuery = true)
    RiskAssessPlanIdentificationPha deletePhaByPlanId(Long id, LocalDateTime date);
    /**
     * 辨识方法-Pha  - list
     */
    @Query(value = "select t from RiskAssessPlanIdentificationPha t where t.assessPlanId = :id and t.deleteStatus = 0")
    List<RiskAssessPlanIdentificationPha> listPhaByPlanId(Long id);
}