删除无用文件
This commit is contained in:
parent
a76f9b3f48
commit
9bac380c26
@ -1,85 +0,0 @@
|
||||
# 开发环境配置文件
|
||||
spring:
|
||||
# 数据库配置
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://8.131.93.145:54081/yf_exam_lite?useSSL=false&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: 1qaz!@#$
|
||||
# druid相关配置
|
||||
druid:
|
||||
max-active: 5000
|
||||
initial-size: 20
|
||||
min-idle: 5
|
||||
async-init: true
|
||||
# 监控统计
|
||||
filters: stat,wall
|
||||
filter:
|
||||
stat:
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 5000
|
||||
wall:
|
||||
config:
|
||||
create-table-allow: false
|
||||
alter-table-allow: false
|
||||
drop-table-allow: false
|
||||
truncate-allow: false
|
||||
|
||||
# 定时任务配置
|
||||
quartz:
|
||||
# 数据库方式
|
||||
job-store-type: jdbc
|
||||
# quartz 相关属性配置
|
||||
properties:
|
||||
org:
|
||||
quartz:
|
||||
scheduler:
|
||||
instanceName: eamScheduler
|
||||
instanceId: AUTO
|
||||
jobStore:
|
||||
class: org.quartz.impl.jdbcjobstore.JobStoreTX
|
||||
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
tablePrefix: QRTZ_
|
||||
isClustered: true
|
||||
clusterCheckinInterval: 10000
|
||||
useProperties: false
|
||||
threadPool:
|
||||
class: org.quartz.simpl.SimpleThreadPool
|
||||
threadCount: 10
|
||||
threadPriority: 5
|
||||
threadsInheritContextClassLoaderOfInitializingThread: true
|
||||
|
||||
# 文件上传配置
|
||||
conf:
|
||||
upload:
|
||||
# 物理文件存储位置,以/结束,windows已正斜杠,如:d:/exam-upload/
|
||||
dir: D:/exam-upload/
|
||||
# 访问地址,注意不要去除/upload/file/,此节点为虚拟标识符
|
||||
# 如:http://localhost:8101/upload/file/exam.jpg,对应物理文件为:/data/upload/exam.jpg
|
||||
url: http://8.131.93.145:54012/upload/file/
|
||||
# 允许上传的文件后缀
|
||||
allow-extensions: jpg,jpeg,png
|
||||
folder:
|
||||
# 身份证正面存储文件夹名称
|
||||
card_front_url: cardfront/
|
||||
# 身份证背面存储文件夹名称
|
||||
card_back_url: cardback/
|
||||
# 身份证正反面复印件
|
||||
card_copy_url: cardcopy/
|
||||
# 证件照
|
||||
photo_url: photo/
|
||||
# 学历证明
|
||||
certificate_url: certificate/
|
||||
# 体检报告
|
||||
physical_report_url: physicalreport/
|
||||
# 签名图片
|
||||
sign_picture_url: signpicture/
|
||||
# 开启文档
|
||||
swagger:
|
||||
enable: true
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: debug
|
||||
path: logs/${spring.application.name}/
|
||||
@ -1,117 +0,0 @@
|
||||
# 独立配置文件,可以拿到jar外面跑
|
||||
spring:
|
||||
application:
|
||||
name: yf-exam-lite
|
||||
profiles:
|
||||
active: dev
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
default-property-inclusion: non_null
|
||||
deserialization:
|
||||
fail_on_unknown_properties: false
|
||||
parser:
|
||||
# 允许出现特殊字符和转义符
|
||||
allow_unquoted_control_chars: true
|
||||
#允许出现单引号
|
||||
allow_single_quotes: true
|
||||
serialization:
|
||||
fail-on-empty-beans: false
|
||||
mapper:
|
||||
# 支持类型转换
|
||||
allow-coercion-of-scalars: true
|
||||
|
||||
# 数据库配置
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/yf_exam_lite?useSSL=false&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: root
|
||||
# druid相关配置
|
||||
druid:
|
||||
max-active: 5000
|
||||
initial-size: 20
|
||||
min-idle: 5
|
||||
async-init: true
|
||||
# 监控统计
|
||||
filters: stat,wall
|
||||
filter:
|
||||
stat:
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 5000
|
||||
wall:
|
||||
config:
|
||||
create-table-allow: false
|
||||
alter-table-allow: false
|
||||
drop-table-allow: false
|
||||
truncate-allow: false
|
||||
|
||||
# 定时任务配置
|
||||
quartz:
|
||||
# 数据库方式
|
||||
job-store-type: jdbc
|
||||
# quartz 相关属性配置
|
||||
properties:
|
||||
org:
|
||||
quartz:
|
||||
scheduler:
|
||||
instanceName: examScheduler
|
||||
instanceId: AUTO
|
||||
jobStore:
|
||||
class: org.quartz.impl.jdbcjobstore.JobStoreTX
|
||||
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
tablePrefix: QRTZ_
|
||||
isClustered: true
|
||||
clusterCheckinInterval: 10000
|
||||
useProperties: false
|
||||
threadPool:
|
||||
class: org.quartz.simpl.SimpleThreadPool
|
||||
threadCount: 10
|
||||
threadPriority: 5
|
||||
threadsInheritContextClassLoaderOfInitializingThread: true
|
||||
|
||||
server:
|
||||
port: 8101
|
||||
# 启用服务端压缩
|
||||
compression:
|
||||
enabled: true
|
||||
min-response-size: 10
|
||||
mime-types: application/json,application/xml,text/html,text/xml,text/plain,application/javascript,text/css
|
||||
|
||||
# 文件上传配置
|
||||
conf:
|
||||
upload:
|
||||
# 物理文件存储位置,以/结束,windows已正斜杠,如:d:/exam-upload/
|
||||
dir: /data/upload/
|
||||
# 访问地址,注意不要去除/upload/file/,此节点为虚拟标识符
|
||||
# 如:http://localhost:8101/upload/file/exam.jpg,对应物理文件为:/data/upload/exam.jpg
|
||||
url: http://8.131.93.145:54012/upload/file/
|
||||
# 允许上传的文件后缀
|
||||
allow-extensions: jpg,jpeg,png
|
||||
folder:
|
||||
# 身份证正面存储文件夹名称
|
||||
card_front_url: cardfront/
|
||||
# 身份证背面存储文件夹名称
|
||||
card_back_url: cardback/
|
||||
# 身份证正反面复印件
|
||||
card_copy_url: cardcopy/
|
||||
# 证件照
|
||||
photo_url: photo/
|
||||
# 学历证明
|
||||
certificate_url: certificate/
|
||||
# 体检报告
|
||||
physical_report_url: physicalreport/
|
||||
# 签名图片
|
||||
sign_picture_url: signpicture/
|
||||
|
||||
# 开启文档
|
||||
swagger:
|
||||
enable: true
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: debug
|
||||
path: logs/${spring.application.name}/
|
||||
@ -1,31 +0,0 @@
|
||||
spring:
|
||||
application:
|
||||
name: yf-exam-lite
|
||||
profiles:
|
||||
active: dev
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
default-property-inclusion: non_null
|
||||
deserialization:
|
||||
fail_on_unknown_properties: false
|
||||
parser:
|
||||
# 允许出现特殊字符和转义符
|
||||
allow_unquoted_control_chars: true
|
||||
#允许出现单引号
|
||||
allow_single_quotes: true
|
||||
serialization:
|
||||
fail-on-empty-beans: false
|
||||
mapper:
|
||||
# 支持类型转换
|
||||
allow-coercion-of-scalars: true
|
||||
server:
|
||||
port: 8101
|
||||
# 启用服务端压缩
|
||||
compression:
|
||||
enabled: true
|
||||
min-response-size: 10
|
||||
mime-types: application/json,application/xml,text/html,text/xml,text/plain,application/javascript,text/css
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
<?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.yf.exam.modules.exam.mapper.ExamDepartMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.exam.entity.ExamDepart">
|
||||
<id column="id" property="id" />
|
||||
<result column="exam_id" property="examId" />
|
||||
<result column="depart_id" property="departId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`exam_id`,`depart_id`
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@ -1,119 +0,0 @@
|
||||
<?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.yf.exam.modules.exam.mapper.ExamMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.exam.entity.Exam">
|
||||
<id column="id" property="id" />
|
||||
<result column="title" property="title" />
|
||||
<result column="content" property="content" />
|
||||
<result column="open_type" property="openType" />
|
||||
<result column="state" property="state" />
|
||||
<result column="time_limit" property="timeLimit" />
|
||||
<result column="start_date" property="startDate" />
|
||||
<result column="end_date" property="endDate" />
|
||||
<result column="start_time" property="startTime" />
|
||||
<result column="end_time" property="endTime" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="total_score" property="totalScore" />
|
||||
<result column="total_time" property="totalTime" />
|
||||
<result column="qualify_score" property="qualifyScore" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`title`,`content`,`open_type`,`join_type`,`level`,`state`,`time_limit`,`start_date`,`end_date`,`start_time`,`end_time`,`create_time`,`update_time`,`total_score`,`total_time`,`qualify_score`
|
||||
</sql>
|
||||
|
||||
|
||||
<resultMap id="ReviewResultMap"
|
||||
type="com.yf.exam.modules.exam.dto.response.ExamReviewRespDTO"
|
||||
extends="BaseResultMap">
|
||||
<result column="examUser" property="examUser" />
|
||||
<result column="unreadPaper" property="unreadPaper" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap id="ListResultMap"
|
||||
type="com.yf.exam.modules.exam.dto.ExamDTO"
|
||||
extends="BaseResultMap">
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="paging" resultMap="ListResultMap">
|
||||
SELECT * FROM el_exam
|
||||
<where>
|
||||
<if test="query!=null">
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
AND title LIKE CONCAT('%',#{query.title},'%')
|
||||
</if>
|
||||
<if test="query.openType!=null">
|
||||
AND open_type = #{query.openType}
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
AND exam_type = #{query.examType}
|
||||
</if>
|
||||
<if test="query.startDate!=null">
|
||||
AND start_date >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endDate!=null">
|
||||
AND end_date <= #{query.endDate}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="reviewPaging" resultMap="ReviewResultMap">
|
||||
SELECT ex.*,
|
||||
(SELECT COUNT(DISTINCT user_id) FROM el_paper WHERE exam_id=ex.id) as examUser,
|
||||
(SELECT COUNT(0) FROM el_paper WHERE exam_id=ex.id AND state=1) as unreadPaper
|
||||
FROM el_exam ex
|
||||
WHERE ex.has_saq=1
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap id="OnlineResultMap"
|
||||
type="com.yf.exam.modules.exam.dto.response.ExamOnlineRespDTO"
|
||||
extends="BaseResultMap">
|
||||
</resultMap>
|
||||
|
||||
<select id="online" resultMap="OnlineResultMap">
|
||||
SELECT ex.*
|
||||
FROM el_exam ex
|
||||
LEFT JOIN el_exam_depart dept ON ex.id=dept.exam_id AND ex.open_type=2
|
||||
LEFT JOIN sys_user uc ON uc.depart_id=dept.depart_id
|
||||
WHERE ex.state=0 AND (ex.open_type=1 OR ex.open_type=3 OR uc.id='{{userId}}')
|
||||
|
||||
<if test="query!=null">
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
AND ex.title LIKE CONCAT('%',#{query.title},'%')
|
||||
</if>
|
||||
<if test="query.openType!=null">
|
||||
AND ex.open_type=#{query.openType}
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
AND ex.exam_type=#{query.examType}
|
||||
</if>
|
||||
</if>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getExamList" resultMap="OnlineResultMap">
|
||||
SELECT * FROM el_exam
|
||||
where state = 0 and id not in (select exam_id from el_exam_registration where user_id = #{query.userId})
|
||||
<if test="query!=null">
|
||||
<if test="query.openType!=null">
|
||||
AND open_type = #{query.openType}
|
||||
</if>
|
||||
<if test="query.startDate!=null">
|
||||
AND start_date >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endDate!=null">
|
||||
AND end_date <= #{query.endDate}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,38 +0,0 @@
|
||||
<?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.yf.exam.modules.exam.mapper.ExamRepoMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.exam.entity.ExamRepo">
|
||||
<id column="id" property="id" />
|
||||
<result column="exam_id" property="examId" />
|
||||
<result column="repo_id" property="repoId" />
|
||||
<result column="radio_count" property="radioCount" />
|
||||
<result column="radio_score" property="radioScore" />
|
||||
<result column="multi_count" property="multiCount" />
|
||||
<result column="multi_score" property="multiScore" />
|
||||
<result column="judge_count" property="judgeCount" />
|
||||
<result column="judge_score" property="judgeScore" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`exam_id`,`repo_id`,`radio_count`,`radio_score`,`multi_count`,`multi_score`,`judge_count`,`judge_score`
|
||||
</sql>
|
||||
|
||||
<resultMap id="ExtResultMap" type="com.yf.exam.modules.exam.dto.ext.ExamRepoExtDTO" extends="BaseResultMap">
|
||||
<result column="totalRadio" property="totalRadio" />
|
||||
<result column="totalMulti" property="totalMulti" />
|
||||
<result column="totalJudge" property="totalJudge" />
|
||||
</resultMap>
|
||||
|
||||
<select id="listByExam" resultMap="ExtResultMap">
|
||||
SELECT ep.*,
|
||||
(SELECT COUNT(0) FROM el_qu_repo WHERE repo_id=ep.repo_id AND qu_type=1) AS totalRadio,
|
||||
(SELECT COUNT(0) FROM el_qu_repo WHERE repo_id=ep.repo_id AND qu_type=2) AS totalMulti,
|
||||
(SELECT COUNT(0) FROM el_qu_repo WHERE repo_id=ep.repo_id AND qu_type=3) AS totalJudge
|
||||
FROM el_exam_repo ep
|
||||
WHERE ep.exam_id=#{examId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,65 +0,0 @@
|
||||
<?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.yf.exam.modules.paper.mapper.PaperMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.paper.entity.Paper">
|
||||
<id column="id" property="id" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="depart_id" property="departId" />
|
||||
<result column="exam_id" property="examId" />
|
||||
<result column="title" property="title" />
|
||||
<result column="total_time" property="totalTime" />
|
||||
<result column="user_time" property="userTime" />
|
||||
<result column="total_score" property="totalScore" />
|
||||
<result column="qualify_score" property="qualifyScore" />
|
||||
<result column="obj_score" property="objScore" />
|
||||
<result column="subj_score" property="subjScore" />
|
||||
<result column="user_score" property="userScore" />
|
||||
<result column="has_saq" property="hasSaq" />
|
||||
<result column="state" property="state" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="limit_time" property="limitTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`user_id`,`depart_id`,`exam_id`,`title`,`total_time`,`user_time`,`total_score`,`qualify_score`,`obj_score`,`subj_score`,`user_score`,`has_saq`,`state`,`create_time`,`update_time`,`limit_time`
|
||||
</sql>
|
||||
|
||||
|
||||
<resultMap id="ListResultMap"
|
||||
extends="BaseResultMap"
|
||||
type="com.yf.exam.modules.paper.dto.response.PaperListRespDTO">
|
||||
<result column="real_name" property="realName" />
|
||||
</resultMap>
|
||||
|
||||
<select id="paging" resultMap="ListResultMap">
|
||||
SELECT pp.*,uc.real_name FROM el_paper pp
|
||||
LEFT JOIN sys_user uc ON pp.user_id=uc.id
|
||||
<where>
|
||||
<if test="query!=null">
|
||||
<if test="query.examId!=null and query.examId!=''">
|
||||
AND pp.exam_id=#{query.examId}
|
||||
</if>
|
||||
|
||||
<if test="query.userId!=null and query.userId!=''">
|
||||
AND pp.user_id=#{query.userId}
|
||||
</if>
|
||||
<if test="query.departId!=null and query.departId!=''">
|
||||
AND pp.depart_id=#{query.departId}
|
||||
</if>
|
||||
<if test="query.state!=null">
|
||||
AND pp.state=#{query.state}
|
||||
</if>
|
||||
<if test="query.realName!=null and query.realName!=''">
|
||||
AND uc.real_name LIKE CONCAT('%',#{query.realName},'%')
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,46 +0,0 @@
|
||||
<?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.yf.exam.modules.paper.mapper.PaperQuAnswerMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.paper.entity.PaperQuAnswer">
|
||||
<id column="id" property="id" />
|
||||
<result column="paper_id" property="paperId" />
|
||||
<result column="answer_id" property="answerId" />
|
||||
<result column="qu_id" property="quId" />
|
||||
<result column="is_right" property="isRight" />
|
||||
<result column="checked" property="checked" />
|
||||
<result column="sort" property="sort" />
|
||||
<result column="abc" property="abc" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`paper_id`,`answer_id`,`qu_id`,`is_right`,`checked`,`sort`,`abc`
|
||||
</sql>
|
||||
|
||||
<resultMap id="ListResultMap"
|
||||
type="com.yf.exam.modules.paper.dto.ext.PaperQuAnswerExtDTO"
|
||||
extends="BaseResultMap">
|
||||
<result column="image" property="image" />
|
||||
<result column="content" property="content" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="list" resultMap="ListResultMap">
|
||||
SELECT pa.`id`,pa.`paper_id`,pa.`answer_id`,pa.`qu_id`,pa.`checked`,pa.`sort`,pa.`abc`,qa.content,qa.image
|
||||
FROM el_paper_qu_answer pa
|
||||
LEFT JOIN el_qu_answer qa ON pa.answer_id=qa.id
|
||||
WHERE pa.paper_id=#{paperId} AND pa.qu_id=#{quId}
|
||||
ORDER BY pa.sort ASC
|
||||
</select>
|
||||
|
||||
<select id="listForShow" resultMap="ListResultMap">
|
||||
SELECT pa.`id`,pa.`paper_id`,pa.`answer_id`,pa.`qu_id`,pa.`checked`,pa.`sort`,pa.`abc`,qa.content,qa.is_right,qa.image
|
||||
FROM el_paper_qu_answer pa
|
||||
LEFT JOIN el_qu_answer qa ON pa.answer_id=qa.id
|
||||
WHERE pa.paper_id=#{paperId} AND pa.qu_id=#{quId}
|
||||
ORDER BY pa.sort ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,58 +0,0 @@
|
||||
<?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.yf.exam.modules.paper.mapper.PaperQuMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.paper.entity.PaperQu">
|
||||
<id column="id" property="id" />
|
||||
<result column="paper_id" property="paperId" />
|
||||
<result column="qu_id" property="quId" />
|
||||
<result column="qu_type" property="quType" />
|
||||
<result column="answered" property="answered" />
|
||||
<result column="answer" property="answer" />
|
||||
<result column="sort" property="sort" />
|
||||
<result column="score" property="score" />
|
||||
<result column="actual_score" property="actualScore" />
|
||||
<result column="is_right" property="isRight" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`paper_id`,`qu_id`,`qu_type`,`answered`,`answer`,`sort`,`score`,`actual_score`,`is_right`
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 计算总分 -->
|
||||
<select id="sumObjective" resultType="int">
|
||||
SELECT IFNULL(SUM(actual_score),0) as total
|
||||
FROM el_paper_qu
|
||||
WHERE paper_id=#{paperId}
|
||||
AND is_right=true
|
||||
AND qu_type < 4
|
||||
</select>
|
||||
|
||||
<select id="sumSubjective" resultType="int">
|
||||
SELECT IFNULL(SUM(actual_score),0) as total
|
||||
FROM el_paper_qu
|
||||
WHERE paper_id=#{paperId}
|
||||
AND qu_type=4
|
||||
</select>
|
||||
|
||||
<resultMap id="ListResultMap" extends="BaseResultMap" type="com.yf.exam.modules.paper.dto.ext.PaperQuDetailDTO">
|
||||
|
||||
<result column="image" property="image" />
|
||||
<result column="content" property="content" />
|
||||
<collection property="answerList" column="{paperId=paper_id,quId=qu_id}"
|
||||
select="com.yf.exam.modules.paper.mapper.PaperQuAnswerMapper.listForShow" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="listByPaper" resultMap="ListResultMap">
|
||||
SELECT pq.*,eq.content,eq.image
|
||||
FROM el_paper_qu pq
|
||||
LEFT JOIN el_qu eq ON pq.qu_id = eq.id
|
||||
WHERE pq.paper_id=#{paperId}
|
||||
ORDER BY pq.sort ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,20 +0,0 @@
|
||||
<?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.yf.exam.modules.qu.mapper.QuAnswerMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.qu.entity.QuAnswer">
|
||||
<id column="id" property="id" />
|
||||
<result column="qu_id" property="quId" />
|
||||
<result column="is_right" property="isRight" />
|
||||
<result column="image" property="image" />
|
||||
<result column="content" property="content" />
|
||||
<result column="analysis" property="analysis" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`qu_id`,`is_right`,`image`,`content`,`analysis`
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@ -1,104 +0,0 @@
|
||||
<?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.yf.exam.modules.qu.mapper.QuMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.qu.entity.Qu">
|
||||
<id column="id" property="id" />
|
||||
<result column="qu_type" property="quType" />
|
||||
<result column="level" property="level" />
|
||||
<result column="image" property="image" />
|
||||
<result column="content" property="content" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="remark" property="remark" />
|
||||
<result column="analysis" property="analysis" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`qu_type`,`level`,`image`,`content`,`create_time`,`update_time`,`remark`,`analysis`
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 随机取数据 -->
|
||||
<select id="listByRandom" resultMap="BaseResultMap">
|
||||
SELECT a.*
|
||||
FROM el_qu a
|
||||
LEFT JOIN el_qu_repo b ON a.id=b.qu_id
|
||||
WHERE b.repo_id=#{repoId} AND a.qu_type=#{quType}
|
||||
<if test="excludes!=null">
|
||||
AND a.id NOT IN
|
||||
<foreach item="item" collection="excludes" separator="," open="(" close=")" index="">'${item}'</foreach>
|
||||
</if>
|
||||
ORDER BY RAND()
|
||||
LIMIT ${size}
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap id="ExportResultMap" type="com.yf.exam.modules.qu.dto.export.QuExportDTO">
|
||||
<id column="q_id" property="qId" />
|
||||
<result column="qu_type" property="quType" />
|
||||
<result column="q_content" property="qContent" />
|
||||
<result column="q_analysis" property="qAnalysis" />
|
||||
<result column="a_is_right" property="aIsRight" />
|
||||
<result column="a_content" property="aContent" />
|
||||
<result column="a_analysis" property="aAnalysis" />
|
||||
<collection property="repoList" column="q_id" select="selectRepos"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectRepos" resultType="String">
|
||||
SELECT repo_id FROM el_qu_repo po WHERE po.qu_id=#{qId}
|
||||
</select>
|
||||
|
||||
|
||||
<sql id="query">
|
||||
<where>
|
||||
<if test="query!=null">
|
||||
<if test="query.quType!=null">
|
||||
AND q.qu_type = #{query.quType}
|
||||
</if>
|
||||
<if test="query.repoIds!=null and query.repoIds.size()>0">
|
||||
AND po.repo_id IN
|
||||
<foreach collection="query.repoIds" open="(" close=")" separator="," item="repoId">#{repoId}</foreach>
|
||||
</if>
|
||||
<if test="query.content!=null and query.content!=''">
|
||||
AND q.content LIKE CONCAT('%',#{query.content},'%')
|
||||
</if>
|
||||
<if test="query.excludes!=null and query.excludes.size()>0">
|
||||
AND q.id NOT IN
|
||||
<foreach collection="query.excludes" open="(" close=")" separator="," item="quId">
|
||||
#{quId}
|
||||
</foreach>
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="paging" resultMap="BaseResultMap">
|
||||
SELECT q.*
|
||||
FROM el_qu q
|
||||
LEFT JOIN el_qu_repo po ON q.id=po.qu_id
|
||||
<include refid="query" />
|
||||
GROUP BY q.id ORDER BY q.update_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listForExport" resultMap="ExportResultMap">
|
||||
SELECT
|
||||
q.id as q_id,
|
||||
q.qu_type,
|
||||
q.content AS q_content,
|
||||
q.analysis as q_analysis,
|
||||
a.content as a_content,
|
||||
a.is_right as a_is_right,
|
||||
a.analysis as a_analysis
|
||||
FROM el_qu q
|
||||
LEFT JOIN el_qu_answer a ON q.id=a.qu_id
|
||||
LEFT JOIN el_qu_repo po ON q.id=po.qu_id
|
||||
<include refid="query" />
|
||||
GROUP BY a.id ORDER BY q.id
|
||||
LIMIT 10000
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,20 +0,0 @@
|
||||
<?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.yf.exam.modules.qu.mapper.QuRepoMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.qu.entity.QuRepo">
|
||||
<id column="id" property="id" />
|
||||
<result column="qu_id" property="quId" />
|
||||
<result column="repo_id" property="repoId" />
|
||||
<result column="qu_type" property="quType" />
|
||||
<result column="sort" property="sort" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`qu_id`,`repo_id`,`qu_type`,`sort`
|
||||
</sql>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -1,51 +0,0 @@
|
||||
<?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.yf.exam.modules.repo.mapper.RepoMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.repo.entity.Repo">
|
||||
<id column="id" property="id" />
|
||||
<result column="code" property="code" />
|
||||
<result column="title" property="title" />
|
||||
<result column="remark" property="remark" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`code`,`title`,`radio_count`,`multi_count`,`judge_count`,`remark`,`create_time`,`update_time`
|
||||
</sql>
|
||||
|
||||
|
||||
<resultMap id="ListResultMap"
|
||||
type="com.yf.exam.modules.repo.dto.response.RepoRespDTO"
|
||||
extends="BaseResultMap">
|
||||
<result column="radio_count" property="radioCount" />
|
||||
<result column="multi_count" property="multiCount" />
|
||||
<result column="judge_count" property="judgeCount" />
|
||||
</resultMap>
|
||||
|
||||
<select id="paging" resultMap="ListResultMap">
|
||||
SELECT `id`, `code`, `title`, `remark`, `create_time`, `update_time`,
|
||||
(SELECT COUNT(0) FROM el_qu_repo WHERE repo_id=repo.id AND qu_type=1) AS radio_count,
|
||||
(SELECT COUNT(0) FROM el_qu_repo WHERE repo_id=repo.id AND qu_type=2) AS multi_count,
|
||||
(SELECT COUNT(0) FROM el_qu_repo WHERE repo_id=repo.id AND qu_type=3) AS judge_count
|
||||
FROM el_repo repo
|
||||
<where>
|
||||
<if test="query!=null">
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
AND repo.title LIKE CONCAT('%',#{query.title}, '%')
|
||||
</if>
|
||||
<if test="query.excludes!=null and query.excludes.size()>0">
|
||||
AND repo.id NOT IN
|
||||
<foreach collection="query.excludes" open="(" close=")" separator="," item="id">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -1,40 +0,0 @@
|
||||
<?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.yf.exam.modules.sys.depart.mapper.SysDepartMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.sys.depart.entity.SysDepart">
|
||||
<id column="id" property="id" />
|
||||
<result column="dept_type" property="deptType" />
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="dept_name" property="deptName" />
|
||||
<result column="dept_code" property="deptCode" />
|
||||
<result column="sort" property="sort" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`dept_type`,`parent_id`,`dept_name`,`dept_code`,`sort`
|
||||
</sql>
|
||||
|
||||
|
||||
<resultMap id="TreeResultMap"
|
||||
type="com.yf.exam.modules.sys.depart.dto.response.SysDepartTreeDTO"
|
||||
extends="BaseResultMap">
|
||||
<collection property="children" column="id" select="findChildren"></collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="findChildren" resultMap="TreeResultMap">
|
||||
SELECT * FROM sys_depart WHERE parent_id=#{id}
|
||||
</select>
|
||||
|
||||
<select id="paging" resultMap="TreeResultMap">
|
||||
SELECT * FROM sys_depart WHERE parent_id='0'
|
||||
<if test="query!=null">
|
||||
<if test="query.deptName!=null and query.deptName!=''">
|
||||
AND dept_name LIKE CONCAT('%',#{query.deptName},'%')
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,9 +0,0 @@
|
||||
<?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.yf.exam.modules.sys.system.mapper.SysDictMapper">
|
||||
|
||||
<select id="findDict" resultType="String">
|
||||
SELECT ${text} FROM ${table} WHERE ${key}=${value} LIMIT 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,16 +0,0 @@
|
||||
<?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.yf.exam.modules.sys.user.mapper.SysRoleMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.sys.user.entity.SysRole">
|
||||
<id column="id" property="id" />
|
||||
<result column="role_name" property="roleName" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`role_name`
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@ -1,25 +0,0 @@
|
||||
<?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.yf.exam.modules.sys.user.mapper.SysUserMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.sys.user.entity.SysUser">
|
||||
<id column="id" property="id" />
|
||||
<result column="user_name" property="userName" />
|
||||
<result column="real_name" property="realName" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="password" property="password" />
|
||||
<result column="salt" property="salt" />
|
||||
<result column="role_ids" property="roleIds" />
|
||||
<result column="depart_id" property="departId" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="state" property="state" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`user_name`,`real_name`,phone,`password`,`salt`,`role_ids`,`depart_id`,`create_time`,`update_time`,`state`
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@ -1,17 +0,0 @@
|
||||
<?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.yf.exam.modules.sys.user.mapper.SysUserRoleMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.sys.user.entity.SysUserRole">
|
||||
<id column="id" property="id" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="role_id" property="roleId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`user_id`,`role_id`
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@ -1,23 +0,0 @@
|
||||
<?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.yf.exam.modules.user.book.mapper.UserBookMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.user.book.entity.UserBook">
|
||||
<id column="id" property="id" />
|
||||
<result column="exam_id" property="examId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="qu_id" property="quId" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="wrong_count" property="wrongCount" />
|
||||
<result column="title" property="title" />
|
||||
<result column="sort" property="sort" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`exam_id`,`user_id`,`qu_id`,`create_time`,`update_time`,`wrong_count`,`title`,`sort`
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@ -1,54 +0,0 @@
|
||||
<?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.yf.exam.modules.user.exam.mapper.UserExamMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.user.exam.entity.UserExam">
|
||||
<id column="id" property="id" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="exam_id" property="examId" />
|
||||
<result column="try_count" property="tryCount" />
|
||||
<result column="max_score" property="maxScore" />
|
||||
<result column="passed" property="passed" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`user_id`,`exam_id`,`try_count`,`max_score`,`passed`,`create_time`,`update_time`
|
||||
</sql>
|
||||
|
||||
|
||||
<resultMap id="ListResultMap"
|
||||
type="com.yf.exam.modules.user.exam.dto.response.UserExamRespDTO"
|
||||
extends="BaseResultMap">
|
||||
<result column="title" property="title" />
|
||||
<result column="real_name" property="realName" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="paging" resultMap="ListResultMap">
|
||||
SELECT ue.*,ee.title,uc.real_name FROM el_user_exam ue
|
||||
LEFT JOIN el_exam ee ON ue.exam_id=ee.id
|
||||
LEFT JOIN sys_user uc ON ue.user_id=uc.id
|
||||
WHERE ee.id IS NOT NULL AND uc.id IS NOT NULL
|
||||
|
||||
<if test="query!=null">
|
||||
|
||||
<if test="query.userId!=null and query.userId!=''">
|
||||
AND ue.user_id='{{userId}}'
|
||||
</if>
|
||||
<if test="query.examId!=null and query.examId!=''">
|
||||
AND ue.exam_id = #{query.examId}
|
||||
</if>
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
AND ee.title LIKE CONCAT('%',#{query.title},'%')
|
||||
</if>
|
||||
<if test="query.realName!=null and query.realName!=''">
|
||||
AND uc.real_name LIKE CONCAT('%',#{query.realName},'%')
|
||||
</if>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user