소스 검색

fix(app):修复教练课程查询条件与详情查询SQL错误

- 将教练课程查询条件从精确匹配改为模糊匹配
-修正教练详情查询SQL语句语法错误
- 调整SQL查询条件格式以提高可读性
SheepHy 1 주 전
부모
커밋
04d7731703

+ 3 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/AppHomeServiceImpl.java

@@ -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();

+ 3 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppInstructorMapper.xml

@@ -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>
     <select id="findPage" resultType="org.jeecg.modules.system.app.vo.staff.StaffResponseVO">