From 4d730af0447c686133130d0116a0fa3dd82c2dca Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Tue, 10 Nov 2026 01:41:03 +0000
Subject: [PATCH] Merge branch 'wcd-2411-update' into wcd

---
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SysUserLevelOtherRepository.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SysUserLevelOtherRepository.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SysUserLevelOtherRepository.java
index ae6da98..00a41b0 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SysUserLevelOtherRepository.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SysUserLevelOtherRepository.java
@@ -46,7 +46,7 @@
     List<SysUserLevelOther> findByUserId(Long userId);
 
     /**
-     * 根据用户ID、指定年月查询
+     * 根据用户ID、指定年月查询(旧)
      * @param userId
      * @param targetDate
      * @return
@@ -70,10 +70,12 @@
     SysUserLevelOther findByNewUserId(Long userId);
 
     /**
-     * 根据用户ID查询最早记录
-     * @param userId /
-     * @return /
+     * 查询级别其他(新)
+     * @param userId
+     * @param targetDate
+     * @return
      */
-    @Query(value = "SELECT * FROM sys_user_level_other WHERE user_id = ?1 ORDER BY start_date ASC LIMIT 1", nativeQuery = true)
-    SysUserLevelOther findOldByUserId(Long userId);
+    @Query(value = "SELECT * FROM sys_user_level_other WHERE user_id = ?1 AND `year_month` <= ?2 ORDER BY `year_month` DESC LIMIT 1", nativeQuery = true)
+    SysUserLevelOther findByUserIdAndData(Long userId, String targetDate);
+
 }
\ No newline at end of file

--
Gitblit v1.9.3