fix(信创): 修复 Java Mapper @Select 注解中 MySQL 不兼容语法

将 5 个 Mapper 接口 @Select 注解内的 MySQL 特有语法替换为达梦兼容写法:
- LIMIT 1 → FETCH FIRST 1 ROWS ONLY(UserDataRecordBmiMapper × 2、
  UserDataRecordBWHMapper、UserDataRecordBloodAboMapper、
  UserDataRecordBloodPressureMapper)
- NOW() → SYSDATE(HealthHolidayMapper)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wanghao
2026-03-06 13:34:58 +08:00
co-authored by Claude Sonnet 4.6
parent 5f790c0c7e
commit 224dae23ee
5 changed files with 6 additions and 6 deletions
@@ -31,7 +31,7 @@ public interface UserDataRecordBmiMapper extends MPJBaseMapper<UserDataRecordBmi
* @param userId
* @return
*/
@Select("SELECT * from user_data_record_bmi where user_id = #{userId} ORDER BY data_date DESC LIMIT 1")
@Select("SELECT * from user_data_record_bmi where user_id = #{userId} ORDER BY data_date DESC FETCH FIRST 1 ROWS ONLY")
UserDataRecordBmi queryUserNewRecord(@Param("userId") String userId);
/**
@@ -39,7 +39,7 @@ public interface UserDataRecordBmiMapper extends MPJBaseMapper<UserDataRecordBmi
* @param userId
* @return
*/
@Select("SELECT fat_rate from user_data_record_bmi where user_id = #{userId} and fat_rate is not null ORDER BY data_date DESC LIMIT 1")
@Select("SELECT fat_rate from user_data_record_bmi where user_id = #{userId} and fat_rate is not null ORDER BY data_date DESC FETCH FIRST 1 ROWS ONLY")
BigDecimal fatRateLatest(@Param("userId") String userId);
/**
@@ -16,7 +16,7 @@ import java.util.List;
public interface HealthHolidayMapper extends BaseMapper<HealthHoliday> {
@Select("SELECT * FROM sys_banner WHERE status = '1' and del_flag = '0' and show_location = #{showLocation} and start_time <= NOW() and end_time >= NOW() order by sort")
@Select("SELECT * FROM sys_banner WHERE status = '1' and del_flag = '0' and show_location = #{showLocation} and start_time <= SYSDATE and end_time >= SYSDATE order by sort")
public List<SysBannerDO> selectBannerList(String showLocation);
}
@@ -15,7 +15,7 @@ public interface UserDataRecordBWHMapper extends MPJBaseMapper<UserDataRecordBWH
* @param userId
* @return
*/
@Select("SELECT * from user_data_record_bwh where user_id = #{userId} and waist is not null ORDER BY create_time DESC LIMIT 1")
@Select("SELECT * from user_data_record_bwh where user_id = #{userId} and waist is not null ORDER BY create_time DESC FETCH FIRST 1 ROWS ONLY")
UserDataRecordBWH queryUserNewRecord(@Param("userId") String userId);
List<EmployeeHeightWeight> userBodyInfo(@Param("userIds")List<String> userIds,@Param("dateStr") String dateStr);
@@ -11,6 +11,6 @@ public interface UserDataRecordBloodAboMapper extends MPJBaseMapper<UserDataReco
* @param userId
* @return
*/
@Select("SELECT * from user_data_record_blood_abo where user_id = #{userId} ORDER BY create_time DESC LIMIT 1")
@Select("SELECT * from user_data_record_blood_abo where user_id = #{userId} ORDER BY create_time DESC FETCH FIRST 1 ROWS ONLY")
UserDataRecordBloodAbo queryUserNewRecord(@Param("userId") String userId);
}
@@ -11,6 +11,6 @@ public interface UserDataRecordBloodPressureMapper extends MPJBaseMapper<UserDat
* @param userId
* @return
*/
@Select("SELECT * from user_data_record_blood_pressure where user_id = #{userId} ORDER BY create_time DESC LIMIT 1")
@Select("SELECT * from user_data_record_blood_pressure where user_id = #{userId} ORDER BY create_time DESC FETCH FIRST 1 ROWS ONLY")
UserDataRecordBloodPressure queryUserNewRecord(@Param("userId") String userId);
}