weicd
2023-12-01 3bb8a496bb332a45ec71ce622bda039cada1a33a
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/repository/UserLevelWageRepository.java
@@ -15,9 +15,14 @@
*/
package me.zhengjie.modules.treatment.repository;
import me.zhengjie.modules.system.domain.SysUserLevelWage;
import me.zhengjie.modules.treatment.domain.UserInsurance;
import me.zhengjie.modules.treatment.domain.UserLevelWage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
* @website https://eladmin.vip
@@ -27,4 +32,14 @@
public interface UserLevelWageRepository extends JpaRepository<UserLevelWage, Long>, JpaSpecificationExecutor<UserLevelWage> {
   UserLevelWage findByUserIdAndYearMonth(Long userId, String yearMonth);
   @Query(value = "(select performance_coefficient from new_user_level_wage where user_id = ?1) order by `year_month` DESC",nativeQuery = true)
   List<Double> findPerformanceCoefficientByUserId(Long userId);
   @Query(value = "(select * from new_user_level_wage where user_id = ?1) order by `year_month` DESC",nativeQuery = true)
   List<UserLevelWage> findUserLevelWageByUserId(Long userId);
   @Query(value = "SELECT * from new_user_level_wage WHERE user_id = ?1 AND `year_month` = ?2 ORDER BY create_time DESC LIMIT 1",nativeQuery = true)
   UserLevelWage findbyUserIdAndDate(Long userId, String yearMonth);
}