| | |
| | | package me.zhengjie.modules.treatment.repository; |
| | | |
| | | import me.zhengjie.modules.system.domain.SysUserLevelOther; |
| | | import me.zhengjie.modules.treatment.domain.MeritLevel; |
| | | import me.zhengjie.modules.treatment.domain.MeritWage; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | |
| | | import org.springframework.data.jpa.repository.Query; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Transactional |
| | | public interface MeritLevelRepository extends JpaRepository<MeritLevel, Long>, JpaSpecificationExecutor<MeritWage> { |
| | | |
| | | @Modifying |
| | | @Query(value = "delete from merit_level where merit_wage_id = ?1", nativeQuery = true) |
| | | void deleteByMeritWageId(Long wageId); |
| | | |
| | | |
| | | List<MeritLevel> findByMeritWageId(Long meritWageId); |
| | | |
| | | /** |
| | | * 查询等级 |
| | | * @param levelId |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT * FROM merit_level WHERE merit_wage_id = (SELECT id FROM merit_wage WHERE level_id = ?1) ORDER BY merit_standard ASC LIMIT 1", nativeQuery = true) |
| | | MeritLevel findMinMeritStandardByLevelId(Long levelId); |
| | | } |