| | |
| | | */ |
| | | package me.zhengjie.modules.treatment.repository; |
| | | |
| | | import me.zhengjie.modules.treatment.domain.CmnLevelRank; |
| | | import me.zhengjie.modules.treatment.domain.UserInsurance; |
| | | |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | | import org.springframework.data.jpa.repository.Query; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | |
| | | public interface UserInsuranceRepository extends JpaRepository<UserInsurance, Long>, JpaSpecificationExecutor<UserInsurance> { |
| | | |
| | | Optional<UserInsurance> findByUserIdAndYearMonth(Long userId, String monthYear); |
| | | |
| | | @Query(value = "SELECT * from new_user_insurance WHERE user_id = ?1 AND `year_month` = ?2 ORDER BY create_time DESC LIMIT 1",nativeQuery = true) |
| | | UserInsurance findbyUserIdAndDate(Long userId, String yearMonth); |
| | | } |