Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangquan wangquan
test
Commits
64d4f18d
Commit
64d4f18d
authored
Aug 26, 2025
by
bing zhang
Browse files
1
parent
539344b2
Changes
869
Show whitespace changes
Inline
Side-by-side
source/java/src/main/java/com/mindskip/xzs/viewmodel/task/TaskPageRequestVM.java
0 → 100644
View file @
64d4f18d
package
com.mindskip.xzs.viewmodel.task
;
import
com.mindskip.xzs.base.BasePage
;
public
class
TaskPageRequestVM
extends
BasePage
{
private
Integer
gradeLevel
;
public
Integer
getGradeLevel
()
{
return
gradeLevel
;
}
public
void
setGradeLevel
(
Integer
gradeLevel
)
{
this
.
gradeLevel
=
gradeLevel
;
}
}
source/java/src/main/java/com/mindskip/xzs/viewmodel/task/TaskPageResponseVM.java
0 → 100644
View file @
64d4f18d
package
com.mindskip.xzs.viewmodel.task
;
public
class
TaskPageResponseVM
{
private
Integer
id
;
private
String
title
;
private
Integer
gradeLevel
;
private
String
createUserName
;
private
String
createTime
;
private
Boolean
deleted
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
Integer
getGradeLevel
()
{
return
gradeLevel
;
}
public
void
setGradeLevel
(
Integer
gradeLevel
)
{
this
.
gradeLevel
=
gradeLevel
;
}
public
String
getCreateUserName
()
{
return
createUserName
;
}
public
void
setCreateUserName
(
String
createUserName
)
{
this
.
createUserName
=
createUserName
;
}
public
String
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
String
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Boolean
getDeleted
()
{
return
deleted
;
}
public
void
setDeleted
(
Boolean
deleted
)
{
this
.
deleted
=
deleted
;
}
}
source/java/src/main/java/com/mindskip/xzs/viewmodel/task/TaskRequestVM.java
0 → 100644
View file @
64d4f18d
package
com.mindskip.xzs.viewmodel.task
;
import
com.mindskip.xzs.viewmodel.exam.ExamResponseVM
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.util.List
;
public
class
TaskRequestVM
{
private
Integer
id
;
@NotNull
private
Integer
gradeLevel
;
@NotNull
private
String
title
;
@Size
(
min
=
1
,
message
=
"请添加试卷"
)
@Valid
private
List
<
ExamResponseVM
>
paperItems
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getGradeLevel
()
{
return
gradeLevel
;
}
public
void
setGradeLevel
(
Integer
gradeLevel
)
{
this
.
gradeLevel
=
gradeLevel
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
List
<
ExamResponseVM
>
getPaperItems
()
{
return
paperItems
;
}
public
void
setPaperItems
(
List
<
ExamResponseVM
>
paperItems
)
{
this
.
paperItems
=
paperItems
;
}
}
source/java/src/main/java/com/mindskip/xzs/viewmodel/user/UserCreateVM.java
0 → 100644
View file @
64d4f18d
package
com.mindskip.xzs.viewmodel.user
;
import
javax.validation.constraints.NotBlank
;
public
class
UserCreateVM
{
private
Integer
id
;
@NotBlank
private
String
userName
;
private
String
password
;
@NotBlank
private
String
realName
;
private
String
age
;
private
Integer
status
;
private
Integer
sex
;
private
String
birthDay
;
private
String
phone
;
private
Integer
role
;
private
Integer
userLevel
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
String
getRealName
()
{
return
realName
;
}
public
void
setRealName
(
String
realName
)
{
this
.
realName
=
realName
;
}
public
String
getAge
()
{
return
age
;
}
public
void
setAge
(
String
age
)
{
this
.
age
=
age
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getSex
()
{
return
sex
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
String
getBirthDay
()
{
return
birthDay
;
}
public
void
setBirthDay
(
String
birthDay
)
{
this
.
birthDay
=
birthDay
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
Integer
getRole
()
{
return
role
;
}
public
void
setRole
(
Integer
role
)
{
this
.
role
=
role
;
}
public
Integer
getUserLevel
()
{
return
userLevel
;
}
public
void
setUserLevel
(
Integer
userLevel
)
{
this
.
userLevel
=
userLevel
;
}
}
source/java/src/main/java/com/mindskip/xzs/viewmodel/user/UserEventLogVM.java
0 → 100644
View file @
64d4f18d
package
com.mindskip.xzs.viewmodel.user
;
public
class
UserEventLogVM
{
private
Integer
id
;
private
Integer
userId
;
private
String
userName
;
private
String
realName
;
private
String
content
;
private
String
createTime
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getRealName
()
{
return
realName
;
}
public
void
setRealName
(
String
realName
)
{
this
.
realName
=
realName
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
String
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
String
createTime
)
{
this
.
createTime
=
createTime
;
}
}
source/java/src/main/java/com/mindskip/xzs/viewmodel/user/UserEventPageRequestVM.java
0 → 100644
View file @
64d4f18d
package
com.mindskip.xzs.viewmodel.user
;
import
com.mindskip.xzs.base.BasePage
;
public
class
UserEventPageRequestVM
extends
BasePage
{
private
Integer
userId
;
private
String
userName
;
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
}
source/java/src/main/java/com/mindskip/xzs/viewmodel/user/UserPageRequestVM.java
0 → 100644
View file @
64d4f18d
package
com.mindskip.xzs.viewmodel.user
;
import
com.mindskip.xzs.base.BasePage
;
public
class
UserPageRequestVM
extends
BasePage
{
private
String
userName
;
private
Integer
role
;
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
Integer
getRole
()
{
return
role
;
}
public
void
setRole
(
Integer
role
)
{
this
.
role
=
role
;
}
}
source/java/src/main/java/com/mindskip/xzs/viewmodel/user/UserResponseVM.java
0 → 100644
View file @
64d4f18d
package
com.mindskip.xzs.viewmodel.user
;
import
com.mindskip.xzs.domain.User
;
import
com.mindskip.xzs.utility.DateTimeUtil
;
import
com.mindskip.xzs.viewmodel.BaseVM
;
public
class
UserResponseVM
extends
BaseVM
{
private
Integer
id
;
private
String
userUuid
;
private
String
userName
;
private
String
realName
;
private
Integer
age
;
private
Integer
role
;
private
Integer
sex
;
private
String
birthDay
;
private
String
phone
;
private
String
lastActiveTime
;
private
String
createTime
;
private
String
modifyTime
;
private
Integer
status
;
private
Integer
userLevel
;
private
String
imagePath
;
public
static
UserResponseVM
from
(
User
user
)
{
UserResponseVM
vm
=
modelMapper
.
map
(
user
,
UserResponseVM
.
class
);
vm
.
setBirthDay
(
DateTimeUtil
.
dateFormat
(
user
.
getBirthDay
()));
vm
.
setLastActiveTime
(
DateTimeUtil
.
dateFormat
(
user
.
getLastActiveTime
()));
vm
.
setCreateTime
(
DateTimeUtil
.
dateFormat
(
user
.
getCreateTime
()));
vm
.
setModifyTime
(
DateTimeUtil
.
dateFormat
(
user
.
getModifyTime
()));
return
vm
;
}
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getUserUuid
()
{
return
userUuid
;
}
public
void
setUserUuid
(
String
userUuid
)
{
this
.
userUuid
=
userUuid
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getRealName
()
{
return
realName
;
}
public
void
setRealName
(
String
realName
)
{
this
.
realName
=
realName
;
}
public
Integer
getAge
()
{
return
age
;
}
public
void
setAge
(
Integer
age
)
{
this
.
age
=
age
;
}
public
Integer
getRole
()
{
return
role
;
}
public
void
setRole
(
Integer
role
)
{
this
.
role
=
role
;
}
public
Integer
getSex
()
{
return
sex
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
String
getBirthDay
()
{
return
birthDay
;
}
public
void
setBirthDay
(
String
birthDay
)
{
this
.
birthDay
=
birthDay
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getLastActiveTime
()
{
return
lastActiveTime
;
}
public
void
setLastActiveTime
(
String
lastActiveTime
)
{
this
.
lastActiveTime
=
lastActiveTime
;
}
public
String
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
String
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
String
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getUserLevel
()
{
return
userLevel
;
}
public
void
setUserLevel
(
Integer
userLevel
)
{
this
.
userLevel
=
userLevel
;
}
public
String
getImagePath
()
{
return
imagePath
;
}
public
void
setImagePath
(
String
imagePath
)
{
this
.
imagePath
=
imagePath
;
}
}
source/java/src/main/java/com/mindskip/xzs/viewmodel/user/UserUpdateVM.java
0 → 100644
View file @
64d4f18d
package
com.mindskip.xzs.viewmodel.user
;
import
javax.validation.constraints.NotBlank
;
public
class
UserUpdateVM
{
@NotBlank
private
String
realName
;
@NotBlank
private
String
phone
;
public
String
getRealName
()
{
return
realName
;
}
public
void
setRealName
(
String
realName
)
{
this
.
realName
=
realName
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
}
source/java/src/main/resources/application-dev.yml
0 → 100644
View file @
64d4f18d
logging
:
path
:
./log/
spring
:
datasource
:
url
:
jdbc:mysql://192.168.0.96:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
username
:
root
password
:
123456
driver-class-name
:
com.mysql.cj.jdbc.Driver
source/java/src/main/resources/application-pre.yml
0 → 100644
View file @
64d4f18d
logging
:
path
:
/usr/log/xzs/
spring
:
datasource
:
url
:
jdbc:mysql://101.132.110.182:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
username
:
root
password
:
123456
driver-class-name
:
com.mysql.cj.jdbc.Driver
source/java/src/main/resources/application-prod.yml
0 → 100644
View file @
64d4f18d
logging
:
path
:
/usr/log/xzs/
spring
:
datasource
:
url
:
jdbc:mysql://localhost:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
username
:
root
password
:
123456
driver-class-name
:
com.mysql.cj.jdbc.Driver
source/java/src/main/resources/application-test.yml
0 → 100644
View file @
64d4f18d
logging
:
path
:
/usr/log/xzs/
spring
:
datasource
:
url
:
jdbc:mysql://192.168.0.96:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
username
:
root
password
:
123456
driver-class-name
:
com.mysql.cj.jdbc.Driver
source/java/src/main/resources/application.properties
0 → 100644
View file @
64d4f18d
source/java/src/main/resources/application.yml
0 → 100644
View file @
64d4f18d
server
:
port
:
8000
undertow
:
io-threads
:
16
worker-threads
:
4000
buffer-size
:
1024
direct-buffers
:
true
compression
:
enabled
:
true
min-response-size
:
1
#logging logback
logging
:
config
:
classpath:logback-spring.xml
file
:
xzs
#mybatis
mybatis
:
mapper-locations
:
classpath:/mapper/*.xml
configuration
:
log-prefix
:
repository.
system
:
security-ignore-urls
:
-
/api/wx/**
-
/api/admin/upload/configAndUpload
-
/api/admin/upload/auth
-
/api/student/user/register
pwdKey
:
publicKey
:
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQClwwxhJKwStDnu7c0yCRkwTW2VKuLWwyVtFC6Zx9bYdF1qwqSP26CkDwaF6GHayIvv9b8BHlAaQH4SLIPzir062yzNukqspmthUw4gPJhbx1AQrWRoQJSv3/1Sk+tWyJRHXSiCZJZ3216LDhtx42LQ0HItDP8U9BLtsxA+5LEZzQIDAQAB
privateKey
:
MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAKXDDGEkrBK0Oe7tzTIJGTBNbZUq4tbDJW0ULpnH1th0XWrCpI/boKQPBoXoYdrIi+/1vwEeUBpAfhIsg/OKvTrbLM26Sqyma2FTDiA8mFvHUBCtZGhAlK/f/VKT61bIlEddKIJklnfbXosOG3HjYtDQci0M/xT0Eu2zED7ksRnNAgMBAAECgYEAlCuz5yn2volnt9HNuEo1v92WdN5vAnZSAB0oQsJFpBrwXjw7CXTTNZNQy2YcAot9uzO6Vu+Xvr+jce9ky9BasM7ehz0gnwJWAO79IqUnmu3RRq7HllDwp72qysXIypJZCF4HX5jAzUGlNzlTSUb1H4LtavKc6a//YqPfQ0jTLsECQQDZuGKGAYq6rBCX0+T8qlQpCPc41wsl4Gi9lLD21ks9PMx44JdhsUrqLWItZiGynDzq1LJ3M1hr3gbSsPQcI9HJAkEAwugDFCiRLOqOBRRGlYbzgGdmXbR4SrMNIpcFTFhU+MsEqaMueVPiNtRSIK6W8pS28ZN0aiZDTBAT84fOIENp5QJBAJaVgQ9OYbVa7N8WH3riE/ONz+/wTDWWUNtOzFbtQHzKYGH6dLmM9lOhsBXWXdg7V6bUFdt8F9wDZJS07yHHZIECQG4rHrJiS80Lt8L/NvaGFVVbHO2SePwgQShwHLqOo1kNyFDqv/YsiA1d7h4zEXeEv/PE2WS2xAtWezCIbualtFECQQDPUkYhs3vZoZgsltdeFnv/WoXaXNRIzunMTmksIlh8JP7C1xQHrwdCpUkffgSVphxGJGHkxooMpki7oTC1Mdjx
wx
:
appid
:
wxa0d64cf3de0cc0ce
secret
:
29b47c96adeb79d5c47db25f78830f6e
token-to-live
:
12h
#token 过期时间
security-ignore-urls
:
-
/api/wx/student/auth/bind
-
/api/wx/student/auth/checkBind
-
/api/wx/student/user/register
qn
:
url
:
http://xzs.file.mindskip.net
bucket
:
mindskip
access-key
:
KabOBTPGVll2sSV8d1OIlW8G4_n_cReE7RSsLafA
secret-key
:
mSltk9_9KtCdFetCmxvvCAgsBg8JZHiXMuQeqSJA
#mybatis page helper
pagehelper
:
autoDialect
:
true
closeConn
:
true
reasonable
:
true
#mybatis datasource default HikariPool
spring
:
datasource
:
hikari
:
idle-timeout
:
600000
#10 min
max-lifetime
:
1800000
#30 min
cache
:
type
:
simple
#runningtime environment
profiles
:
active
:
dev
source/java/src/main/resources/logback-spring.xml
0 → 100644
View file @
64d4f18d
<?xml version="1.0"?>
<configuration>
<conversionRule
conversionWord=
"clr"
converterClass=
"org.springframework.boot.logging.logback.ColorConverter"
/>
<conversionRule
conversionWord=
"wex"
converterClass=
"org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"
/>
<conversionRule
conversionWord=
"wEx"
converterClass=
"org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"
/>
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"
/>
<property
name=
"FILE_LOG_PATTERN"
value=
"${FILE_LOG_PATTERN:-%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"
/>
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
<charset>
utf8
</charset>
</encoder>
</appender>
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<encoder>
<pattern>
${FILE_LOG_PATTERN}
</pattern>
</encoder>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${LOG_PATH}/${LOG_FILE}.%d{yyyyMMdd}.log
</fileNamePattern>
<maxHistory>
30
</maxHistory>
</rollingPolicy>
</appender>
<springProfile
name=
"dev"
>
<root
level=
"INFO"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"FILE"
/>
</root>
<logger
name=
"repository"
level=
"DEBUG"
additivity=
"false"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"FILE"
/>
</logger>
</springProfile>
<springProfile
name=
"test"
>
<root
level=
"INFO"
>
<appender-ref
ref=
"FILE"
/>
</root>
<logger
name=
"repository"
level=
"DEBUG"
additivity=
"false"
>
<appender-ref
ref=
"FILE"
/>
</logger>
</springProfile>
<springProfile
name=
"pre"
>
<root
level=
"INFO"
>
<appender-ref
ref=
"FILE"
/>
</root>
<logger
name=
"repository"
level=
"DEBUG"
additivity=
"false"
>
<appender-ref
ref=
"FILE"
/>
</logger>
</springProfile>
<springProfile
name=
"prod"
>
<root
level=
"INFO"
>
<appender-ref
ref=
"FILE"
/>
</root>
</springProfile>
</configuration>
source/java/src/main/resources/mapper/ExamPaperAnswerMapper.xml
0 → 100644
View file @
64d4f18d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mindskip.xzs.repository.ExamPaperAnswerMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.mindskip.xzs.domain.ExamPaperAnswer"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"exam_paper_id"
jdbcType=
"INTEGER"
property=
"examPaperId"
/>
<result
column=
"paper_name"
jdbcType=
"VARCHAR"
property=
"paperName"
/>
<result
column=
"paper_type"
jdbcType=
"INTEGER"
property=
"paperType"
/>
<result
column=
"subject_id"
jdbcType=
"INTEGER"
property=
"subjectId"
/>
<result
column=
"system_score"
jdbcType=
"INTEGER"
property=
"systemScore"
/>
<result
column=
"user_score"
jdbcType=
"INTEGER"
property=
"userScore"
/>
<result
column=
"paper_score"
jdbcType=
"INTEGER"
property=
"paperScore"
/>
<result
column=
"question_correct"
jdbcType=
"INTEGER"
property=
"questionCorrect"
/>
<result
column=
"question_count"
jdbcType=
"INTEGER"
property=
"questionCount"
/>
<result
column=
"do_time"
jdbcType=
"INTEGER"
property=
"doTime"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"create_user"
jdbcType=
"INTEGER"
property=
"createUser"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"task_exam_id"
jdbcType=
"INTEGER"
property=
"taskExamId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, exam_paper_id, paper_name, paper_type, subject_id, system_score, user_score,
paper_score, question_correct, question_count, do_time, status, create_user, create_time,
task_exam_id
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_exam_paper_answer
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from t_exam_paper_answer
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.mindskip.xzs.domain.ExamPaperAnswer"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_exam_paper_answer (id, exam_paper_id, paper_name,
paper_type, subject_id, system_score,
user_score, paper_score, question_correct,
question_count, do_time, status,
create_user, create_time, task_exam_id
)
values (#{id,jdbcType=INTEGER}, #{examPaperId,jdbcType=INTEGER}, #{paperName,jdbcType=VARCHAR},
#{paperType,jdbcType=INTEGER}, #{subjectId,jdbcType=INTEGER}, #{systemScore,jdbcType=INTEGER},
#{userScore,jdbcType=INTEGER}, #{paperScore,jdbcType=INTEGER}, #{questionCorrect,jdbcType=INTEGER},
#{questionCount,jdbcType=INTEGER}, #{doTime,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{taskExamId,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.mindskip.xzs.domain.ExamPaperAnswer"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_exam_paper_answer
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"examPaperId != null"
>
exam_paper_id,
</if>
<if
test=
"paperName != null"
>
paper_name,
</if>
<if
test=
"paperType != null"
>
paper_type,
</if>
<if
test=
"subjectId != null"
>
subject_id,
</if>
<if
test=
"systemScore != null"
>
system_score,
</if>
<if
test=
"userScore != null"
>
user_score,
</if>
<if
test=
"paperScore != null"
>
paper_score,
</if>
<if
test=
"questionCorrect != null"
>
question_correct,
</if>
<if
test=
"questionCount != null"
>
question_count,
</if>
<if
test=
"doTime != null"
>
do_time,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"createUser != null"
>
create_user,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"taskExamId != null"
>
task_exam_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"examPaperId != null"
>
#{examPaperId,jdbcType=INTEGER},
</if>
<if
test=
"paperName != null"
>
#{paperName,jdbcType=VARCHAR},
</if>
<if
test=
"paperType != null"
>
#{paperType,jdbcType=INTEGER},
</if>
<if
test=
"subjectId != null"
>
#{subjectId,jdbcType=INTEGER},
</if>
<if
test=
"systemScore != null"
>
#{systemScore,jdbcType=INTEGER},
</if>
<if
test=
"userScore != null"
>
#{userScore,jdbcType=INTEGER},
</if>
<if
test=
"paperScore != null"
>
#{paperScore,jdbcType=INTEGER},
</if>
<if
test=
"questionCorrect != null"
>
#{questionCorrect,jdbcType=INTEGER},
</if>
<if
test=
"questionCount != null"
>
#{questionCount,jdbcType=INTEGER},
</if>
<if
test=
"doTime != null"
>
#{doTime,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
</if>
<if
test=
"createUser != null"
>
#{createUser,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"taskExamId != null"
>
#{taskExamId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.mindskip.xzs.domain.ExamPaperAnswer"
>
update t_exam_paper_answer
<set>
<if
test=
"examPaperId != null"
>
exam_paper_id = #{examPaperId,jdbcType=INTEGER},
</if>
<if
test=
"paperName != null"
>
paper_name = #{paperName,jdbcType=VARCHAR},
</if>
<if
test=
"paperType != null"
>
paper_type = #{paperType,jdbcType=INTEGER},
</if>
<if
test=
"subjectId != null"
>
subject_id = #{subjectId,jdbcType=INTEGER},
</if>
<if
test=
"systemScore != null"
>
system_score = #{systemScore,jdbcType=INTEGER},
</if>
<if
test=
"userScore != null"
>
user_score = #{userScore,jdbcType=INTEGER},
</if>
<if
test=
"paperScore != null"
>
paper_score = #{paperScore,jdbcType=INTEGER},
</if>
<if
test=
"questionCorrect != null"
>
question_correct = #{questionCorrect,jdbcType=INTEGER},
</if>
<if
test=
"questionCount != null"
>
question_count = #{questionCount,jdbcType=INTEGER},
</if>
<if
test=
"doTime != null"
>
do_time = #{doTime,jdbcType=INTEGER},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
<if
test=
"createUser != null"
>
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"taskExamId != null"
>
task_exam_id = #{taskExamId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.mindskip.xzs.domain.ExamPaperAnswer"
>
update t_exam_paper_answer
set exam_paper_id = #{examPaperId,jdbcType=INTEGER},
paper_name = #{paperName,jdbcType=VARCHAR},
paper_type = #{paperType,jdbcType=INTEGER},
subject_id = #{subjectId,jdbcType=INTEGER},
system_score = #{systemScore,jdbcType=INTEGER},
user_score = #{userScore,jdbcType=INTEGER},
paper_score = #{paperScore,jdbcType=INTEGER},
question_correct = #{questionCorrect,jdbcType=INTEGER},
question_count = #{questionCount,jdbcType=INTEGER},
do_time = #{doTime,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_user = #{createUser,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
task_exam_id = #{taskExamId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select
id=
"studentPage"
resultMap=
"BaseResultMap"
parameterType=
"com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_exam_paper_answer
<where>
and create_user = #{createUser}
<if
test=
"subjectId != null"
>
and subject_id = #{subjectId}
</if>
</where>
</select>
<select
id=
"selectAllCount"
resultType=
"java.lang.Integer"
>
SELECT count(*) from t_exam_paper_answer
</select>
<select
id=
"selectCountByDate"
resultType=
"com.mindskip.xzs.domain.other.KeyValue"
>
SELECT create_time as name,COUNT(create_time) as value from
(
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper_answer
WHERE create_time between #{startTime} and #{endTime}
) a
GROUP BY create_time
</select>
<select
id=
"getByPidUid"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_exam_paper_answer
where exam_paper_id = #{pid} and create_user=#{uid}
limit 1
</select>
<select
id=
"adminPage"
resultMap=
"BaseResultMap"
parameterType=
"com.mindskip.xzs.viewmodel.paper.ExamPaperAnswerPageRequestVM"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_exam_paper_answer
<where>
<if
test=
"subjectId != null"
>
and subject_id = #{subjectId}
</if>
</where>
</select>
</mapper>
source/java/src/main/resources/mapper/ExamPaperMapper.xml
0 → 100644
View file @
64d4f18d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mindskip.xzs.repository.ExamPaperMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.mindskip.xzs.domain.ExamPaper"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"subject_id"
jdbcType=
"INTEGER"
property=
"subjectId"
/>
<result
column=
"paper_type"
jdbcType=
"INTEGER"
property=
"paperType"
/>
<result
column=
"grade_level"
jdbcType=
"INTEGER"
property=
"gradeLevel"
/>
<result
column=
"score"
jdbcType=
"INTEGER"
property=
"score"
/>
<result
column=
"question_count"
jdbcType=
"INTEGER"
property=
"questionCount"
/>
<result
column=
"suggest_time"
jdbcType=
"INTEGER"
property=
"suggestTime"
/>
<result
column=
"limit_start_time"
jdbcType=
"TIMESTAMP"
property=
"limitStartTime"
/>
<result
column=
"limit_end_time"
jdbcType=
"TIMESTAMP"
property=
"limitEndTime"
/>
<result
column=
"frame_text_content_id"
jdbcType=
"INTEGER"
property=
"frameTextContentId"
/>
<result
column=
"create_user"
jdbcType=
"INTEGER"
property=
"createUser"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"deleted"
jdbcType=
"BIT"
property=
"deleted"
/>
<result
column=
"task_exam_id"
jdbcType=
"INTEGER"
property=
"taskExamId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, name, subject_id, paper_type, grade_level, score, question_count, suggest_time,
limit_start_time, limit_end_time, frame_text_content_id, create_user, create_time,
deleted, task_exam_id
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_exam_paper
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from t_exam_paper
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.mindskip.xzs.domain.ExamPaper"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_exam_paper (id, name, subject_id,
paper_type, grade_level, score,
question_count, suggest_time, limit_start_time,
limit_end_time, frame_text_content_id, create_user,
create_time, deleted, task_exam_id
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{subjectId,jdbcType=INTEGER},
#{paperType,jdbcType=INTEGER}, #{gradeLevel,jdbcType=INTEGER}, #{score,jdbcType=INTEGER},
#{questionCount,jdbcType=INTEGER}, #{suggestTime,jdbcType=INTEGER}, #{limitStartTime,jdbcType=TIMESTAMP},
#{limitEndTime,jdbcType=TIMESTAMP}, #{frameTextContentId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, #{taskExamId,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.mindskip.xzs.domain.ExamPaper"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_exam_paper
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"name != null"
>
name,
</if>
<if
test=
"subjectId != null"
>
subject_id,
</if>
<if
test=
"paperType != null"
>
paper_type,
</if>
<if
test=
"gradeLevel != null"
>
grade_level,
</if>
<if
test=
"score != null"
>
score,
</if>
<if
test=
"questionCount != null"
>
question_count,
</if>
<if
test=
"suggestTime != null"
>
suggest_time,
</if>
<if
test=
"limitStartTime != null"
>
limit_start_time,
</if>
<if
test=
"limitEndTime != null"
>
limit_end_time,
</if>
<if
test=
"frameTextContentId != null"
>
frame_text_content_id,
</if>
<if
test=
"createUser != null"
>
create_user,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"deleted != null"
>
deleted,
</if>
<if
test=
"taskExamId != null"
>
task_exam_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"subjectId != null"
>
#{subjectId,jdbcType=INTEGER},
</if>
<if
test=
"paperType != null"
>
#{paperType,jdbcType=INTEGER},
</if>
<if
test=
"gradeLevel != null"
>
#{gradeLevel,jdbcType=INTEGER},
</if>
<if
test=
"score != null"
>
#{score,jdbcType=INTEGER},
</if>
<if
test=
"questionCount != null"
>
#{questionCount,jdbcType=INTEGER},
</if>
<if
test=
"suggestTime != null"
>
#{suggestTime,jdbcType=INTEGER},
</if>
<if
test=
"limitStartTime != null"
>
#{limitStartTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"limitEndTime != null"
>
#{limitEndTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"frameTextContentId != null"
>
#{frameTextContentId,jdbcType=INTEGER},
</if>
<if
test=
"createUser != null"
>
#{createUser,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deleted != null"
>
#{deleted,jdbcType=BIT},
</if>
<if
test=
"taskExamId != null"
>
#{taskExamId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.mindskip.xzs.domain.ExamPaper"
>
update t_exam_paper
<set>
<if
test=
"name != null"
>
name = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"subjectId != null"
>
subject_id = #{subjectId,jdbcType=INTEGER},
</if>
<if
test=
"paperType != null"
>
paper_type = #{paperType,jdbcType=INTEGER},
</if>
<if
test=
"gradeLevel != null"
>
grade_level = #{gradeLevel,jdbcType=INTEGER},
</if>
<if
test=
"score != null"
>
score = #{score,jdbcType=INTEGER},
</if>
<if
test=
"questionCount != null"
>
question_count = #{questionCount,jdbcType=INTEGER},
</if>
<if
test=
"suggestTime != null"
>
suggest_time = #{suggestTime,jdbcType=INTEGER},
</if>
<if
test=
"limitStartTime != null"
>
limit_start_time = #{limitStartTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"limitEndTime != null"
>
limit_end_time = #{limitEndTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"frameTextContentId != null"
>
frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
</if>
<if
test=
"createUser != null"
>
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"deleted != null"
>
deleted = #{deleted,jdbcType=BIT},
</if>
<if
test=
"taskExamId != null"
>
task_exam_id = #{taskExamId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.mindskip.xzs.domain.ExamPaper"
>
update t_exam_paper
set name = #{name,jdbcType=VARCHAR},
subject_id = #{subjectId,jdbcType=INTEGER},
paper_type = #{paperType,jdbcType=INTEGER},
grade_level = #{gradeLevel,jdbcType=INTEGER},
score = #{score,jdbcType=INTEGER},
question_count = #{questionCount,jdbcType=INTEGER},
suggest_time = #{suggestTime,jdbcType=INTEGER},
limit_start_time = #{limitStartTime,jdbcType=TIMESTAMP},
limit_end_time = #{limitEndTime,jdbcType=TIMESTAMP},
frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
create_user = #{createUser,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=BIT},
task_exam_id = #{taskExamId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap
id=
"PaperInfoResultMap"
type=
"com.mindskip.xzs.viewmodel.student.dashboard.PaperInfo"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"limit_start_time"
jdbcType=
"TIMESTAMP"
property=
"limitStartTime"
/>
<result
column=
"limit_end_time"
jdbcType=
"TIMESTAMP"
property=
"limitEndTime"
/>
</resultMap>
<select
id=
"page"
resultMap=
"BaseResultMap"
parameterType=
"com.mindskip.xzs.viewmodel.exam.ExamPaperPageRequestVM"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_exam_paper
<where>
and deleted=0
<if
test=
"id != null "
>
and id= #{id}
</if>
<if
test=
"level != null "
>
and grade_level= #{level}
</if>
<if
test=
"subjectId != null "
>
and subject_id= #{subjectId}
</if>
<if
test=
"paperType != null "
>
and paper_type= #{paperType}
</if>
</where>
</select>
<select
id=
"taskExamPage"
resultMap=
"BaseResultMap"
parameterType=
"com.mindskip.xzs.viewmodel.exam.ExamPaperPageRequestVM"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_exam_paper
<where>
and deleted=0
and task_exam_id is null
and grade_level= #{level}
and paper_type=#{paperType}
</where>
</select>
<select
id=
"studentPage"
resultMap=
"BaseResultMap"
parameterType=
"com.mindskip.xzs.viewmodel.student.exam.ExamPaperPageVM"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_exam_paper
<where>
and deleted=0
<if
test=
"subjectId != null "
>
and subject_id=#{subjectId}
</if>
<if
test=
"levelId != null "
>
and grade_level=#{levelId}
</if>
and paper_type=#{paperType}
</where>
</select>
<select
id=
"indexPaper"
resultMap=
"PaperInfoResultMap"
parameterType=
"com.mindskip.xzs.viewmodel.student.dashboard.PaperFilter"
>
SELECT id,name,limit_start_time,limit_end_time
FROM t_exam_paper
<where>
and deleted=0
and paper_type= #{examPaperType}
and grade_level=#{gradeLevel}
<if
test=
"examPaperType == 3 "
>
</if>
<if
test=
"examPaperType == 4 "
>
and #{dateTime} between limit_start_time and limit_end_time
</if>
</where>
ORDER BY id desc limit 5
</select>
<select
id=
"selectAllCount"
resultType=
"java.lang.Integer"
>
SELECT count(*) from t_exam_paper where deleted=0
</select>
<select
id=
"selectCountByDate"
resultType=
"com.mindskip.xzs.domain.other.KeyValue"
>
SELECT create_time as name,COUNT(create_time) as value from
(
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper
WHERE deleted=0 and create_time between #{startTime} and #{endTime}
) a
GROUP BY create_time
</select>
<update
id=
"updateTaskPaper"
>
update t_exam_paper set task_exam_id = #{taskId} where id in
<foreach
item=
"id"
collection=
"paperIds"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</update>
<update
id=
"clearTaskPaper"
parameterType=
"java.util.List"
>
update t_exam_paper set task_exam_id = null where id in
<foreach
item=
"id"
collection=
"paperIds"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</update>
</mapper>
source/java/src/main/resources/mapper/ExamPaperQuestionCustomerAnswerMapper.xml
0 → 100644
View file @
64d4f18d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mindskip.xzs.repository.ExamPaperQuestionCustomerAnswerMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"question_id"
jdbcType=
"INTEGER"
property=
"questionId"
/>
<result
column=
"exam_paper_id"
jdbcType=
"INTEGER"
property=
"examPaperId"
/>
<result
column=
"exam_paper_answer_id"
jdbcType=
"INTEGER"
property=
"examPaperAnswerId"
/>
<result
column=
"question_type"
jdbcType=
"INTEGER"
property=
"questionType"
/>
<result
column=
"subject_id"
jdbcType=
"INTEGER"
property=
"subjectId"
/>
<result
column=
"customer_score"
jdbcType=
"INTEGER"
property=
"customerScore"
/>
<result
column=
"question_score"
jdbcType=
"INTEGER"
property=
"questionScore"
/>
<result
column=
"question_text_content_id"
jdbcType=
"INTEGER"
property=
"questionTextContentId"
/>
<result
column=
"answer"
jdbcType=
"VARCHAR"
property=
"answer"
/>
<result
column=
"text_content_id"
jdbcType=
"INTEGER"
property=
"textContentId"
/>
<result
column=
"do_right"
jdbcType=
"BIT"
property=
"doRight"
/>
<result
column=
"create_user"
jdbcType=
"INTEGER"
property=
"createUser"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"item_order"
jdbcType=
"INTEGER"
property=
"itemOrder"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, question_id, exam_paper_id, exam_paper_answer_id, question_type, subject_id,
customer_score, question_score, question_text_content_id, answer, text_content_id,
do_right, create_user, create_time, item_order
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_exam_paper_question_customer_answer
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from t_exam_paper_question_customer_answer
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_exam_paper_question_customer_answer (id, question_id, exam_paper_id,
exam_paper_answer_id, question_type, subject_id,
customer_score, question_score, question_text_content_id,
answer, text_content_id, do_right,
create_user, create_time, item_order
)
values (#{id,jdbcType=INTEGER}, #{questionId,jdbcType=INTEGER}, #{examPaperId,jdbcType=INTEGER},
#{examPaperAnswerId,jdbcType=INTEGER}, #{questionType,jdbcType=INTEGER}, #{subjectId,jdbcType=INTEGER},
#{customerScore,jdbcType=INTEGER}, #{questionScore,jdbcType=INTEGER}, #{questionTextContentId,jdbcType=INTEGER},
#{answer,jdbcType=VARCHAR}, #{textContentId,jdbcType=INTEGER}, #{doRight,jdbcType=BIT},
#{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{itemOrder,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_exam_paper_question_customer_answer
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"questionId != null"
>
question_id,
</if>
<if
test=
"examPaperId != null"
>
exam_paper_id,
</if>
<if
test=
"examPaperAnswerId != null"
>
exam_paper_answer_id,
</if>
<if
test=
"questionType != null"
>
question_type,
</if>
<if
test=
"subjectId != null"
>
subject_id,
</if>
<if
test=
"customerScore != null"
>
customer_score,
</if>
<if
test=
"questionScore != null"
>
question_score,
</if>
<if
test=
"questionTextContentId != null"
>
question_text_content_id,
</if>
<if
test=
"answer != null"
>
answer,
</if>
<if
test=
"textContentId != null"
>
text_content_id,
</if>
<if
test=
"doRight != null"
>
do_right,
</if>
<if
test=
"createUser != null"
>
create_user,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"itemOrder != null"
>
item_order,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"questionId != null"
>
#{questionId,jdbcType=INTEGER},
</if>
<if
test=
"examPaperId != null"
>
#{examPaperId,jdbcType=INTEGER},
</if>
<if
test=
"examPaperAnswerId != null"
>
#{examPaperAnswerId,jdbcType=INTEGER},
</if>
<if
test=
"questionType != null"
>
#{questionType,jdbcType=INTEGER},
</if>
<if
test=
"subjectId != null"
>
#{subjectId,jdbcType=INTEGER},
</if>
<if
test=
"customerScore != null"
>
#{customerScore,jdbcType=INTEGER},
</if>
<if
test=
"questionScore != null"
>
#{questionScore,jdbcType=INTEGER},
</if>
<if
test=
"questionTextContentId != null"
>
#{questionTextContentId,jdbcType=INTEGER},
</if>
<if
test=
"answer != null"
>
#{answer,jdbcType=VARCHAR},
</if>
<if
test=
"textContentId != null"
>
#{textContentId,jdbcType=INTEGER},
</if>
<if
test=
"doRight != null"
>
#{doRight,jdbcType=BIT},
</if>
<if
test=
"createUser != null"
>
#{createUser,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"itemOrder != null"
>
#{itemOrder,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer"
>
update t_exam_paper_question_customer_answer
<set>
<if
test=
"questionId != null"
>
question_id = #{questionId,jdbcType=INTEGER},
</if>
<if
test=
"examPaperId != null"
>
exam_paper_id = #{examPaperId,jdbcType=INTEGER},
</if>
<if
test=
"examPaperAnswerId != null"
>
exam_paper_answer_id = #{examPaperAnswerId,jdbcType=INTEGER},
</if>
<if
test=
"questionType != null"
>
question_type = #{questionType,jdbcType=INTEGER},
</if>
<if
test=
"subjectId != null"
>
subject_id = #{subjectId,jdbcType=INTEGER},
</if>
<if
test=
"customerScore != null"
>
customer_score = #{customerScore,jdbcType=INTEGER},
</if>
<if
test=
"questionScore != null"
>
question_score = #{questionScore,jdbcType=INTEGER},
</if>
<if
test=
"questionTextContentId != null"
>
question_text_content_id = #{questionTextContentId,jdbcType=INTEGER},
</if>
<if
test=
"answer != null"
>
answer = #{answer,jdbcType=VARCHAR},
</if>
<if
test=
"textContentId != null"
>
text_content_id = #{textContentId,jdbcType=INTEGER},
</if>
<if
test=
"doRight != null"
>
do_right = #{doRight,jdbcType=BIT},
</if>
<if
test=
"createUser != null"
>
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"itemOrder != null"
>
item_order = #{itemOrder,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer"
>
update t_exam_paper_question_customer_answer
set question_id = #{questionId,jdbcType=INTEGER},
exam_paper_id = #{examPaperId,jdbcType=INTEGER},
exam_paper_answer_id = #{examPaperAnswerId,jdbcType=INTEGER},
question_type = #{questionType,jdbcType=INTEGER},
subject_id = #{subjectId,jdbcType=INTEGER},
customer_score = #{customerScore,jdbcType=INTEGER},
question_score = #{questionScore,jdbcType=INTEGER},
question_text_content_id = #{questionTextContentId,jdbcType=INTEGER},
answer = #{answer,jdbcType=VARCHAR},
text_content_id = #{textContentId,jdbcType=INTEGER},
do_right = #{doRight,jdbcType=BIT},
create_user = #{createUser,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
item_order = #{itemOrder,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select
id=
"selectListByPaperAnswerId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_exam_paper_question_customer_answer
where exam_paper_answer_id = #{id,jdbcType=INTEGER}
order by item_order
</select>
<select
id=
"studentPage"
resultMap=
"BaseResultMap"
parameterType=
"com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentRequestVM"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_exam_paper_question_customer_answer
<where>
and do_right=FALSE
and create_user=#{createUser}
</where>
</select>
<insert
id=
"insertList"
parameterType=
"java.util.List"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_exam_paper_question_customer_answer ( question_id, question_score,
subject_id, create_time, create_user,
text_content_id, exam_paper_id, question_type,
answer, customer_score, exam_paper_answer_id ,
do_right,question_text_content_id,item_order)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
( #{item.questionId,jdbcType=INTEGER}, #{item.questionScore,jdbcType=INTEGER},
#{item.subjectId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.createUser,jdbcType=INTEGER},
#{item.textContentId,jdbcType=INTEGER}, #{item.examPaperId,jdbcType=INTEGER}, #{item.questionType,jdbcType=INTEGER},
#{item.answer,jdbcType=VARCHAR}, #{item.customerScore,jdbcType=INTEGER}, #{item.examPaperAnswerId,jdbcType=INTEGER},
#{item.doRight,jdbcType=BIT},#{item.questionTextContentId,jdbcType=INTEGER},#{item.itemOrder,jdbcType=INTEGER})
</foreach>
</insert>
<select
id=
"selectAllCount"
resultType=
"java.lang.Integer"
>
SELECT count(*) from t_exam_paper_question_customer_answer
</select>
<select
id=
"selectCountByDate"
resultType=
"com.mindskip.xzs.domain.other.KeyValue"
>
SELECT create_time as name,COUNT(create_time) as value from
(
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper_question_customer_answer
WHERE create_time between #{startTime} and #{endTime}
) a
GROUP BY create_time
</select>
<update
id=
"updateScore"
parameterType=
"java.util.List"
>
<foreach
collection=
"list"
item=
"item"
>
update t_exam_paper_question_customer_answer
set customer_score=#{item.customerScore} , do_right=#{item.doRight}
where id=#{item.id} ;
</foreach>
</update>
</mapper>
source/java/src/main/resources/mapper/MessageMapper.xml
0 → 100644
View file @
64d4f18d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mindskip.xzs.repository.MessageMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.mindskip.xzs.domain.Message"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"title"
jdbcType=
"VARCHAR"
property=
"title"
/>
<result
column=
"content"
jdbcType=
"VARCHAR"
property=
"content"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"send_user_id"
jdbcType=
"INTEGER"
property=
"sendUserId"
/>
<result
column=
"send_user_name"
jdbcType=
"VARCHAR"
property=
"sendUserName"
/>
<result
column=
"send_real_name"
jdbcType=
"VARCHAR"
property=
"sendRealName"
/>
<result
column=
"receive_user_count"
jdbcType=
"INTEGER"
property=
"receiveUserCount"
/>
<result
column=
"read_count"
jdbcType=
"INTEGER"
property=
"readCount"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, title, content, create_time, send_user_id, send_user_name, send_real_name, receive_user_count,
read_count
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_message
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from t_message
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.mindskip.xzs.domain.Message"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_message (id, title, content,
create_time, send_user_id, send_user_name,
send_real_name, receive_user_count, read_count
)
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{sendUserId,jdbcType=INTEGER}, #{sendUserName,jdbcType=VARCHAR},
#{sendRealName,jdbcType=VARCHAR}, #{receiveUserCount,jdbcType=INTEGER}, #{readCount,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.mindskip.xzs.domain.Message"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_message
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"title != null"
>
title,
</if>
<if
test=
"content != null"
>
content,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"sendUserId != null"
>
send_user_id,
</if>
<if
test=
"sendUserName != null"
>
send_user_name,
</if>
<if
test=
"sendRealName != null"
>
send_real_name,
</if>
<if
test=
"receiveUserCount != null"
>
receive_user_count,
</if>
<if
test=
"readCount != null"
>
read_count,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"title != null"
>
#{title,jdbcType=VARCHAR},
</if>
<if
test=
"content != null"
>
#{content,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"sendUserId != null"
>
#{sendUserId,jdbcType=INTEGER},
</if>
<if
test=
"sendUserName != null"
>
#{sendUserName,jdbcType=VARCHAR},
</if>
<if
test=
"sendRealName != null"
>
#{sendRealName,jdbcType=VARCHAR},
</if>
<if
test=
"receiveUserCount != null"
>
#{receiveUserCount,jdbcType=INTEGER},
</if>
<if
test=
"readCount != null"
>
#{readCount,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.mindskip.xzs.domain.Message"
>
update t_message
<set>
<if
test=
"title != null"
>
title = #{title,jdbcType=VARCHAR},
</if>
<if
test=
"content != null"
>
content = #{content,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"sendUserId != null"
>
send_user_id = #{sendUserId,jdbcType=INTEGER},
</if>
<if
test=
"sendUserName != null"
>
send_user_name = #{sendUserName,jdbcType=VARCHAR},
</if>
<if
test=
"sendRealName != null"
>
send_real_name = #{sendRealName,jdbcType=VARCHAR},
</if>
<if
test=
"receiveUserCount != null"
>
receive_user_count = #{receiveUserCount,jdbcType=INTEGER},
</if>
<if
test=
"readCount != null"
>
read_count = #{readCount,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.mindskip.xzs.domain.Message"
>
update t_message
set title = #{title,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
send_user_id = #{sendUserId,jdbcType=INTEGER},
send_user_name = #{sendUserName,jdbcType=VARCHAR},
send_real_name = #{sendRealName,jdbcType=VARCHAR},
receive_user_count = #{receiveUserCount,jdbcType=INTEGER},
read_count = #{readCount,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select
id=
"page"
resultMap=
"BaseResultMap"
parameterType=
"com.mindskip.xzs.viewmodel.message.MessagePageRequestVM"
>
select
<include
refid=
"Base_Column_List"
/>
from t_message
<where>
<if
test=
"sendUserName != null"
>
and send_user_name like concat('%',#{sendUserName},'%')
</if>
</where>
</select>
<select
id=
"selectByIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_message
where id in
<foreach
item=
"id"
collection=
"list"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</select>
<update
id=
"readAdd"
parameterType=
"java.lang.Integer"
>
UPDATE t_message SET read_count = read_count + 1
WHERE id= #{id} and read_count = (SELECT m.read_count from ( SELECT read_count FROM t_message WHERE id = #{id} ) m)
</update>
</mapper>
Prev
1
…
6
7
8
9
10
11
12
13
14
…
44
Next
Write
Preview
Supports
Markdown
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