- 将教练课程查询条件从精确匹配改为模糊匹配 -修正教练详情查询SQL语句语法错误 - 调整SQL查询条件格式以提高可读性
@@ -114,7 +114,9 @@ public class AppHomeServiceImpl implements IAppHomeService {
}
// 获取该教练的课程(最多取2个)
List<AppCourses> courses = appCoursesMapper.selectList(
- Wrappers.<AppCourses>lambdaQuery().eq(AppCourses::getUserId, userId).eq(AppCourses::getRackingStatus,0).gt(AppCourses::getEndTime, new Date()).last("LIMIT 2"));
+ Wrappers.<AppCourses>lambdaQuery().like(AppCourses::getUserId, userId)
+ .eq(AppCourses::getRackingStatus,0)
+ .gt(AppCourses::getEndTime, new Date()).last("LIMIT 2"));
List<InstructorVO.CourseInfoVO> courseInfoVOS = courses.stream()
.map(course -> {
InstructorVO.CourseInfoVO vo = new InstructorVO.CourseInfoVO();
@@ -94,7 +94,9 @@
</select>
<select id="findById" resultType="org.jeecg.modules.app.vo.coach.AppCoachDetailsVO">
select a.id,a.user_id,b.realname,a.training_programs,a.good_rate,a.teaching_philosophy,a.excel_msg,b.avatar,a.background_img,
- b.certificate_innocence,b.healthy,b.honor from nm_instructor a left join sys_user b on a.user_id = b.id where a.user_id = #{id}
+ b.certificate_innocence,b.healthy,b.honor
+ from nm_instructor a left join sys_user b on a.user_id = b.id
+ where a.user_id LIKE CONCAT('', #{id}, '%'))
<select id="findPage" resultType="org.jeecg.modules.system.app.vo.staff.StaffResponseVO">