Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
practical_train
Commits
c1404eed
"src/main/git@gitlab.ruzhoukj.com:wujipeng/relation.git" did not exist on "db2763e47f82d5543752d87c7faea059a84a1b39"
Commit
c1404eed
authored
Sep 08, 2026
by
wujipeng
Browse files
bug修复
parent
8fc878c3
Changes
2
Show whitespace changes
Inline
Side-by-side
practical-business/src/main/resources/com/platform/business/mapper/ExamMapper.xml
View file @
c1404eed
...
@@ -35,8 +35,11 @@
...
@@ -35,8 +35,11 @@
and e.type = #{type}
and e.type = #{type}
</if>
</if>
</where>
</where>
ORDER BY
<!--
STR_TO_DATE(SUBSTRING_INDEX(exam_time, '-', 1), '%Y.%m.%d %H:%i:%s') DESC
教师端考试管理默认按真实考试时间倒序展示,最近开考的场次排在最前面。
同一考试时间下再按主键倒序,避免分页查询时记录顺序不稳定。
-->
ORDER BY e.exam_time DESC, e.id DESC
</select>
</select>
<!--
<!--
...
...
practical-business/src/test/java/com/platform/business/mapper/ExamMapperXmlTest.java
View file @
c1404eed
...
@@ -44,6 +44,13 @@ class ExamMapperXmlTest {
...
@@ -44,6 +44,13 @@ class ExamMapperXmlTest {
.
getBoundSql
(
Collections
.
emptyMap
());
.
getBoundSql
(
Collections
.
emptyMap
());
String
pageSql
=
pageBoundSql
.
getSql
().
replaceAll
(
"\\s+"
,
" "
).
toLowerCase
();
String
pageSql
=
pageBoundSql
.
getSql
().
replaceAll
(
"\\s+"
,
" "
).
toLowerCase
();
assertTrue
(
pageSql
.
contains
(
"e.duration"
));
assertTrue
(
pageSql
.
contains
(
"e.duration"
));
/*
* 教师端考试管理应直接使用数据库时间字段倒序;不能截取日期字符串后再转换,
* 否则标准 yyyy-MM-dd 时间会只按年份排序,同一年内的考试顺序将不可控。
*/
assertTrue
(
pageSql
.
contains
(
"order by e.exam_time desc, e.id desc"
));
assertFalse
(
pageSql
.
contains
(
"str_to_date"
));
assertFalse
(
pageSql
.
contains
(
"substring_index"
));
org
.
apache
.
ibatis
.
mapping
.
BoundSql
summaryBoundSql
=
configuration
.
getMappedStatement
(
org
.
apache
.
ibatis
.
mapping
.
BoundSql
summaryBoundSql
=
configuration
.
getMappedStatement
(
"com.platform.business.mapper.ExamMapper.summary"
)
"com.platform.business.mapper.ExamMapper.summary"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment