Sfoglia il codice sorgente

解决量表分组查询失败

yazhe 8 mesi fa
parent
commit
f8f9f5b5ec

+ 2 - 2
src/main/java/com/rf/psychological/scale/dao/repository/SubjectRepository.java

@@ -341,12 +341,12 @@ public interface SubjectRepository extends BaseRepository<SubjectEntity, String>
             "                tcs.ename cateEname,men,icon_info,report_version,reference,report_reference,report_keyboarder " +
             "         from t_group_info tgi\n" +
             "                  join t_subject_info tsi\n" +
-            "                  join t_group_auth tga join t_category_subject tcs on tsi.flag = tcs.flag and tgi.id = group_id and b_id = tsi.id\n  order by tsi.id desc" +
+            "                  join t_group_auth tga join t_category_subject tcs on tsi.flag = tcs.flag and tgi.id = group_id and b_id = tsi.id\n  order by tsi.test_num desc" +
             "     ) g_auth\n" +
             "         join t_user_info tui on tui.g_id = g_auth.groupId\n" +
             "\n" +
             //"where tui.id = ?1 and cateEname= ?3 and if(?2 is not null and ?2 !='',name like %?2%  ,1=1) order by test_num desc",
-            "where tui.id = ?1 and cateEname= ?3 and if(?2 is not null and ?2 !='',name like %?2%  ,1=1)  desc",
+            "where tui.id = ?1 and cateEname= ?3 and if(?2 is not null and ?2 !='',name like %?2%  ,1=1) order by test_num desc",
             countQuery = "select count(g_auth.id) " +
                     "from (\n" +
                     "         select tgi.group_name,\n" +