加入题目模板,修改页面页脚

This commit is contained in:
Himit_ZH 2021-04-24 20:01:28 +08:00
parent e7a70c1449
commit c6391fb9e0
315 changed files with 0 additions and 908 deletions

View File

@ -1,99 +0,0 @@
spring:
profiles:
active: prod
---
# 消费者将要去访问的微服务名称注册成功进入nacos的微服务提供者
service-url:
hoj-judge-server: http://hoj-judge-server # 服务访问base_url
name: hoj-judge-server # 服务名
spring:
profiles: prod
# 配置文件上传限制
servlet:
multipart:
max-file-size: 50MB
max-request-size: 50MB
mail:
properties.mail.smtp.ssl.enable: ${hoj.mail.ssl}
properties.mail.smtp.starttls.enable: true
properties.mail.smtp.starttls.required: true
username: ${hoj.mail.username}
password: ${hoj.mail.password}
host: ${hoj.mail.host}
port: ${hoj.mail.port}
redis:
host: ${hoj.redis.host}
port: ${hoj.redis.port}
timeout: 60000
jedis:
pool:
min-idle: 50 #连接池中的最小空闲连接
max-idle: 200 #连接池中的最大空闲连接
max-active: 500 #连接池最大连接数(使用负值表示没有限制)
max-wait: -1 #连接池最大阻塞等待时间(使用负值表示没有限制)
password: ${hoj.redis.password}
datasource:
username: ${hoj.db.username}
password: ${hoj.db.password}
url: jdbc:mysql://${hoj.db.host}:${hoj.db.port}/${hoj.db.name}?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
initial-size: 20 # 初始化时建立物理连接的个数。初始化发生在显示调用init方法或者第一次getConnection时
min-idle: 50 # 最小连接池数量
maxActive: 400 # 最大连接池数量
maxWait: 60000 # 获取连接时最大等待时间单位毫秒。配置了maxWait之后缺省启用公平锁并发效率会有所下降如果需要可以通过配置
timeBetweenEvictionRunsMillis: 60000 # 关闭空闲连接的检测时间间隔.Destroy线程会检测连接的间隔时间如果连接空闲时间大于等于minEvictableIdleTimeMillis则关闭物理连接。
minEvictableIdleTimeMillis: 300000 # 连接的最小生存时间.连接保持空闲而不被驱逐的最小时间
validationQuery: SELECT 1 FROM DUAL # 验证数据库服务可用性的sql.用来检测连接是否有效的sql 因数据库方言而差, 例如 oracle 应该写成 SELECT 1 FROM DUAL
testWhileIdle: true # 申请连接时检测空闲时间,根据空闲时间再检测连接是否有效.建议配置为true不影响性能并且保证安全性。申请连接的时候检测如果空闲时间大于timeBetweenEvictionRun
testOnBorrow: false # 申请连接时直接检测连接是否有效.申请连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。
testOnReturn: false # 归还连接时检测连接是否有效.归还连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。
poolPreparedStatements: true # 开启PSCache
maxPoolPreparedStatementPerConnectionSize: 20 #设置PSCache值
connectionErrorRetryAttempts: 3 # 连接出错后再尝试连接三次
breakAfterAcquireFailure: true # 数据库服务宕机自动重连机制
timeBetweenConnectErrorMillis: 300000 # 连接出错后重试时间间隔
asyncInit: true # 异步初始化策略
remove-abandoned: true # 是否自动回收超时连接
remove-abandoned-timeout: 1800 # 超时时间(以秒数为单位)
transaction-query-timeout: 6000 # 事务超时时间
filters: stat,wall,log4j #数据库日志
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
mybatis-plus:
mapper-locations: classpath*:top/hcode/hoj/dao/xml/**Mapper.xml
type-aliases-package: top.hcode.hoj.pojo.entity
shiro-redis:
enabled: true
redis-manager:
host: ${hoj.redis.host}:${hoj.redis.port}
password: ${hoj.redis.password}
ribbon:
# 指的是建立连接所用的时间,适用于网络状况正常的情况下,俩端连接所用的时间 单位是秒
ReadTimeout: 10000
# 指的是建立连接后从服务器读取到可用资源的时间
ConnectTimeout: 30000
logging:
level:
com:
alibaba:
nacos:
client:
naming: error
root: error
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 60000

View File

@ -1,27 +0,0 @@
hoj-backstage:
port: 6688 # 本服务器启动的端口号
nacos-url: 172.18.0.2:8848 # nacos的地址
server:
port: ${hoj-backstage.port}
spring:
profiles:
active: prod
application:
name: hoj-data-backup
cloud:
nacos:
discovery:
server-addr: ${hoj-backstage.nacos-url} # Nacos 作为服务注册中心 nacos的地址
config:
server-addr: ${hoj-backstage.nacos-url} #Nacos 作为配置中心地址 nacos的地址
file-extension: yml #指定yaml格式的配置
group: DEFAULT_GROUP # 指定分组
data-id: hoj-data-backup-prod.yml
type: yaml
#namespace:命名空间ID 默认为public
url: http://${hoj-backstage.nacos-url}
# ${spring.application.name}-${spring.profile.active}.${spring.cloud.naces.config.file-extension}
# hoj-data-backup-prod.yml

View File

@ -1,74 +0,0 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th=http://www.thymeleaf.org>
<head>
<meta charset=UTF-8>
<title>用户注册验证码</title>
</head>
<body>
<div style="background: white;
width: 100%;
max-width: 800px;
margin: auto auto;
border-radius: 5px;
border:#1bc3fb 1px solid;
overflow: hidden;
-webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.12);
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.18);">
<header style="overflow: hidden;">
<center>
<img style="width:100%;z-index: 666;"
th:src="${EMAIL_BACKGROUND_IMG}">
</center>
</header>
<div style="padding: 5px 20px; ">
<p style=" position: relative;
color: white;
float: left;
z-index: 999;
background: #1bc3fb;
padding: 5px 30px;
margin: -25px auto 0 ;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.30) ">
Dear New HOJer
</p>
<br>
<center>
<h3>
来自 <span style=" text-decoration: none;color: #FF779A;" th:text="${OJ_SHORT_NAME}"></span> 邮件提醒
</h3>
<p style="text-indent:2em;">
您收到这封电子邮件是因为您 (也可能是某人冒充您的名义) 在<a style=" text-decoration: none;color: #1bc3fb "
target="_blank" th:href="${OJ_URL}" rel="noopener">&nbsp;HOJ&nbsp;</a>上进行注册。假如这不是您本人所申请,
请不用理会这封电子邮件, 但是如果您持续收到这类的信件骚扰, 请您尽快联络管理员。
</p>
<div style="background: #fafafa repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);margin:20px 0px;padding:15px;border-radius:5px;font-size:14px;color:#555555;text-align: center; ">
请使用以下验证码完成后续注册流程:<br>
<span style=" color: #FF779A;font-weight: bolder;font-size: 25px;" th:text="${CODE}"></span><br>
注意:请您在收到邮件10分钟内([[${EXPIRE_TIME}]]前)使用,否则该验证码将会失效。
</div>
&nbsp; &nbsp;
<br>
<div style=" text-align: center; ">
<a style="text-transform: uppercase;
text-decoration: none;
font-size: 14px;
background: #FF779A;
color: #FFFFFF;
padding: 10px;
display: inline-block;
border-radius: 5px;
margin: 10px auto 0;"
target="_blank" th:href="${OJ_URL}" rel="noopener" th:text="${OJ_SHORT_NAME}+'|传送门🚪'"></a>
</div>
<p style="font-size: 12px;text-align: center;color: #999; ">
欢迎常来访问!<br>
© 2021 <a style="text-decoration:none; color:#1bc3fb " th:href="${OJ_URL}" rel="noopener"
target="_blank" th:text="${OJ_NAME}"></a>
</p>
<p></p>
</center>
</div>
</div>
</body>
</html>

View File

@ -1,72 +0,0 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th=http://www.thymeleaf.org>
<head>
<meta charset="UTF-8">
<title>HOJ的重置密码邮件</title>
</head>
<body>
<div style="background: white;
width: 100%;
max-width: 800px;
margin: auto auto;
border-radius: 5px;
border:#1bc3fb 1px solid;
overflow: hidden;
-webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.12);
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.18);">
<header style="overflow: hidden;">
<center>
<img style="width:100%;z-index: 666;"
th:src="${EMAIL_BACKGROUND_IMG}">
</center>
</header>
<div style="padding: 5px 20px; ">
<p style=" position: relative;
color: white;
float: left;
z-index: 999;
background: #1bc3fb;
padding: 5px 30px;
margin: -25px auto 0 ;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.30) " th:text="'Dear '+${USERNAME}">
</p>
<br>
<center>
<h3>
来自 <span style=" text-decoration: none;color: #FF779A;" th:text="${OJ_SHORT_NAME}"></span> 邮件提醒
</h3>
<p style="text-indent:2em;">
您收到这封电子邮件是因为您 (也可能是某人冒充您的名义) 在<a style=" text-decoration: none;color: #1bc3fb "
target="_blank" th:href="${OJ_URL}" rel="noopener">&nbsp;HOJ&nbsp;</a>上进行密码重置操作。假如这不是您本人所申请, 请不用理会这封电子邮件, 但是如果您持续收到这类的信件骚扰, 请您尽快联络管理员。
</p>
<div style="background: #fafafa repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);margin:20px 0px;padding:15px;border-radius:5px;font-size:14px;color:#555555;text-align: center; ">
请点击下面的链接完成后续重置密码的流程:<br>
<a th:href="${RESET_URL}" style="color: #FF779A;font-weight: bolder;font-size: 25px;text-decoration: none;">CLICK HERE</a><br>
注意:请您在收到邮件10分钟内([[${EXPIRE_TIME}]]前)使用,否则该重置密码链接将会失效。
</div>
&nbsp; &nbsp;
<br>
<div style=" text-align: center; ">
<a style="text-transform: uppercase;
text-decoration: none;
font-size: 14px;
background: #FF779A;
color: #FFFFFF;
padding: 10px;
display: inline-block;
border-radius: 5px;
margin: 10px auto 0;"
target="_blank" th:href="${OJ_URL}" rel="noopener" th:text="${OJ_SHORT_NAME}+'|传送门🚪'"></a>
</div>
<p style="font-size: 12px;text-align: center;color: #999; ">
欢迎常来访问!<br>
© 2021 <a style="text-decoration:none; color:#1bc3fb " th:href="${OJ_URL}" rel="noopener"
target="_blank" th:text="${OJ_NAME}"></a>
</p>
<p></p>
</center>
</div>
</div>
</body>
</html>

View File

@ -1,72 +0,0 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th=http://www.thymeleaf.org>
<head>
<meta charset="UTF-8">
<title>超级管理员测试邮箱可用性邮件</title>
</head>
<body>
<div style="background: white;
width: 100%;
max-width: 800px;
margin: auto auto;
border-radius: 5px;
border:#1bc3fb 1px solid;
overflow: hidden;
-webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.12);
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.18);">
<header style="overflow: hidden;">
<center>
<img style="width:100%;z-index: 666;"
th:src="${EMAIL_BACKGROUND_IMG}">
</center>
</header>
<div style="padding: 5px 20px; ">
<p style=" position: relative;
color: white;
float: left;
z-index: 999;
background: #1bc3fb;
padding: 5px 30px;
margin: -25px auto 0 ;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.30) ">
Dear Super Admin
</p>
<br>
<center>
<h3>
来自 <span style=" text-decoration: none;color: #FF779A;" th:text="${OJ_SHORT_NAME}"></span> 邮件提醒
</h3>
<p style="text-indent:2em;">
您收到这封电子邮件是因为您在<a style=" text-decoration: none;color: #1bc3fb "
target="_blank" th:href="${OJ_URL}" rel="noopener">&nbsp;HOJ&nbsp;</a>上进行邮箱配置更新,然后进行邮箱可行性的测试。
</p>
<div style="background: #fafafa repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);margin:20px 0px;padding:15px;border-radius:5px;font-size:14px;color:#555555;text-align: center; ">
经过本邮件的接收,可证实:<br>
<a style="color: #FF779A;font-weight: bolder;font-size: 25px;text-decoration: none;">Test Success</a><br>
</div>
&nbsp; &nbsp;
<br>
<div style=" text-align: center; ">
<a style="text-transform: uppercase;
text-decoration: none;
font-size: 14px;
background: #FF779A;
color: #FFFFFF;
padding: 10px;
display: inline-block;
border-radius: 5px;
margin: 10px auto 0;"
target="_blank" th:href="${OJ_URL}" rel="noopener" th:text="${OJ_SHORT_NAME}+'|传送门🚪'"></a>
</div>
<p style="font-size: 12px;text-align: center;color: #999; ">
欢迎常来访问!<br>
© 2021 <a style="text-decoration:none; color:#1bc3fb " th:href="${OJ_URL}" rel="noopener"
target="_blank" th:text="${OJ_NAME}"></a>
</p>
<p></p>
</center>
</div>
</div>
</body>
</html>

View File

@ -1,35 +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="top.hcode.hoj.dao.AnnouncementMapper">
<select id="getAnnouncementList" resultMap="map_AnnouncementVo">
SELECT a.*,u.username FROM user_info u,announcement a where a.uid = u.uuid
<if test="notAdmin">
and a.status = 0
</if>
order by a.gmt_create desc
</select>
<select id="getContestAnnouncement" resultMap="map_AnnouncementVo">
SELECT a.*,u.username FROM user_info u,announcement a,contest_announcement ca
where a.uid = u.uuid and ca.cid =#{cid} and ca.aid = a.id
<if test="notAdmin">
and a.status = 0
</if>
order by a.gmt_create desc
</select>
<resultMap id="map_AnnouncementVo" type="top.hcode.hoj.pojo.vo.AnnouncementVo">
<id column="id" property="id"></id>
<result column="title" property="title"></result>
<result column="content" property="content"></result>
<result column="uid" property="uid"></result>
<result column="username" property="username"></result>
<result column="status" property="status"></result>
<result column="gmt_create" property="gmtCreate"></result>
<result column="gmt_modified" property="gmtModified"></result>
</resultMap>
</mapper>

View File

@ -1,5 +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="top.hcode.hoj.dao.AuthMapper">
</mapper>

View File

@ -1,5 +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="top.hcode.hoj.dao.CommentMapper">
</mapper>

View File

@ -1,5 +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="top.hcode.hoj.dao.ContestExplanationMapper">
</mapper>

View File

@ -1,29 +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="top.hcode.hoj.dao.ContestMapper">
<select id="getContestList" resultType="top.hcode.hoj.pojo.vo.ContestVo" useCache="true">
select c.id,c.author,c.title,c.description,c.type,c.status,c.source,c.auth,c.start_time,c.end_time,c.duration
from contest c
<where>
<if test="keyword!=null and keyword!=''">
c.title like concat('%',#{keyword},'%')
</if>
<if test="status!=null">
and c.status = #{status}
</if>
<if test="type!=null">
and c.type = #{type}
</if>
</where>
order by c.start_time DESC,c.id DESC
</select>
<select id="getContestInfoById" resultType="top.hcode.hoj.pojo.vo.ContestVo" useCache="true">
select c.id,c.author,c.title,c.type,c.status,c.description,c.seal_rank,c.seal_rank_time,c.source,c.auth,c.start_time,c.end_time,c.duration
from contest c where c.id = #{cid}
</select>
<select id="getWithinNext14DaysContests" resultType="top.hcode.hoj.pojo.vo.ContestVo">
SELECT c.id,c.author,c.title,c.type,c.source,c.auth,c.status,c.description,c.start_time,c.end_time,c.duration
FROM contest c WHERE DATE_ADD(CURDATE(), INTERVAL 14 DAY) >= DATE(start_time) AND c.status != 1
order by c.start_time ASC
</select>
</mapper>

View File

@ -1,13 +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="top.hcode.hoj.dao.ContestProblemMapper">
<select id="getContestProblemList" resultType="top.hcode.hoj.pojo.vo.ContestProblemVo">
select cp.id,cp.display_id,cp.cid,cp.pid,cp.display_title,
(select count(*) from judge where cpid=cp.id and cid=cp.cid and pid =cp.pid and
submit_time >= #{startTime}) as total,
(select count(*) from judge where cpid=cp.id and cid=cp.cid and pid =cp.pid and
status=0 and submit_time >= #{startTime}) as ac
from contest_problem cp
where cp.cid = #{cid} order by cp.display_id asc
</select>
</mapper>

View File

@ -1,36 +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="top.hcode.hoj.dao.ContestRecordMapper">
<select id="getACInfo" resultType="top.hcode.hoj.pojo.entity.ContestRecord">
SELECT id,uid,username,display_id,cid,realname,pid,time,status,checked,
MIN(submit_id) AS submit_id,
MIN(submit_time) AS submit_time,
MAX(first_blood) AS first_blood
FROM contest_record
<where>
<if test="status!=null">
status=#{status}
</if>
<if test="cid!=null">
and cid = #{cid}
</if>
</where>
GROUP BY status,uid,pid,cpid
ORDER BY checked ASC,submit_time DESC
</select>
<select id="getOIContestRecord" resultType="top.hcode.hoj.pojo.entity.ContestRecord">
SELECT cr.* FROM
(SELECT uid,pid,cpid,MAX(time) AS time FROM contest_record
<where>
cid=#{cid} AND status IS NOT NULL
<if test="isOpenSealRank">
AND submit_time NOT BETWEEN #{sealTime} AND #{endTime}
</if>
</where>
GROUP BY uid,pid,cpid) t
LEFT JOIN contest_record cr ON t.uid = cr.uid AND t.pid =cr.pid
AND t.cpid = cr.cpid AND t.time = cr.time
</select>
</mapper>

View File

@ -1,5 +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="top.hcode.hoj.dao.ContestRegisterMapper">
</mapper>

View File

@ -1,5 +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="top.hcode.hoj.dao.ContestScoreMapper">
</mapper>

View File

@ -1,5 +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="top.hcode.hoj.dao.JudgeCaseMapper">
</mapper>

View File

@ -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="top.hcode.hoj.dao.JudgeMapper">
<select id="getCommonJudgeList" resultType="top.hcode.hoj.pojo.vo.JudgeVo" useCache="false">
select j.uid,j.submit_id,j.submit_time,j.uid,j.username,j.uid,j.pid,j.display_pid,j.status,j.share,
j.time,j.memory,j.length,j.language,j.cid,j.cpid,j.judger
from judge j
<where>
j.cid = 0 AND j.cpid = 0
<if test="searchPid!=null">
AND j.display_pid like concat('%',#{searchPid},'%')
</if>
<if test="username!='' and username!=null">
AND j.username like concat('%',#{username},'%')
</if>
<if test="status!=null">
AND (j.status = #{status}
<if test="status==1">
OR j.status = 2
</if>
)
</if>
<if test="uid!=null and uid!=''">
AND j.uid = #{uid}
</if>
</where>
order by j.submit_time DESC,j.submit_id DESC
</select>
<select id="getContestJudgeList" resultType="top.hcode.hoj.pojo.vo.JudgeVo" useCache="false">
select j.uid,j.submit_id,j.submit_time,j.uid,j.username,j.uid,cp.display_id,
j.status,j.share,j.time,j.memory,j.length,j.language,j.cid,j.cpid,j.judger
from judge j,contest_problem cp
<where>
j.pid=cp.pid AND j.cid = cp.cid
<if test="cid!=null">
AND j.cid = #{cid}
</if>
<if test="displayId!=null and displayId!=''">
AND cp.display_id like concat('%',#{displayId},'%')
</if>
<if test="username!='' and username!=null">
AND j.username like concat('%',#{username},'%')
</if>
<if test="status!=null">
AND j.status = #{status}
</if>
<if test="uid!=null and uid!=''">
AND j.uid = #{uid}
</if>
<if test="beforeContestSubmit!=null and beforeContestSubmit==true">
AND (select start_time from contest where id = #{cid}) > j.submit_time
</if>
<if test="beforeContestSubmit!=null and beforeContestSubmit==false">
AND j.submit_time >= (select start_time from contest where id = #{cid})
</if>
</where>
order by j.submit_time DESC,j.submit_id DESC
</select>
<select id="getTodayJudgeNum" resultType="int">
SELECT count(*) FROM judge WHERE DATE(gmt_create) = CURDATE();
</select>
</mapper>

View File

@ -1,6 +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="top.hcode.hoj.dao.LanguageMapper">
</mapper>

View File

@ -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="top.hcode.hoj.dao.ProblemCountMapper">
<select id="getContestProblemCount" resultType="top.hcode.hoj.pojo.entity.ProblemCount">
SELECT COUNT(IF(status=-3,status,NULL)) AS pe,
COUNT(IF(status=-2,status,NULL)) AS ce,
COUNT(IF(status=-1,status,NULL)) AS wa,
COUNT(IF(status=0,status,NULL)) AS ac,
COUNT(IF(status=1,status,NULL)) AS tle,
COUNT(IF(status=2,status,NULL)) AS mle,
COUNT(IF(status=3,status,NULL)) AS re,
COUNT(IF(status=4,status,NULL)) AS se,
COUNT(IF(status=8,status,NULL)) AS pa,
COUNT(*) AS total
FROM judge where pid=#{pid} and cpid = #{cpid} and cid = #{cid}
</select>
</mapper>

View File

@ -1,60 +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="top.hcode.hoj.dao.ProblemMapper">
<resultMap id="map_ProblemList" type="top.hcode.hoj.pojo.vo.ProblemVo">
<id column="pid" property="pid"></id>
<result column="problem_id" property="problemId"></result>
<result column="title" property="title"></result>
<result column="difficulty" property="difficulty"></result>
<result column="type" property="type"></result>
<result column="total" property="total"></result>
<result column="ac" property="ac"></result>
<result column="mle" property="mle"></result>
<result column="tle" property="tle"></result>
<result column="re" property="re"></result>
<result column="pe" property="pe"></result>
<result column="ce" property="ce"></result>
<result column="wa" property="wa"></result>
<result column="se" property="se"></result>
<result column="pa" property="pa"></result>
<collection property="tags" ofType="top.hcode.hoj.pojo.entity.Tag" select="getProblemTag" column="pid">
</collection>
</resultMap>
<!-- 主查询 -->
<select id="getProblemList" resultMap="map_ProblemList">
SELECT distinct p.id as pid,p.problem_id,p.title,p.difficulty,p.type,pc.total,pc.ac,pc.mle,pc.tle,pc.re,
pc.pe,pc.ce,pc.wa,pc.se,pc.pa FROM problem p
LEFT JOIN problem_count pc ON p.id = pc.pid
LEFT JOIN problem_tag pt ON p.id = pt.pid
<where>
p.auth = 1
<if test="keyword != null and keyword != ''">
and (
p.title like concat('%',#{keyword},'%') or p.problem_id like concat('%',#{keyword},'%')
<if test="pid != null and pid != ''">
or p.id = #{pid}
</if>
)
</if>
<if test="difficulty != null">
and p.difficulty = #{difficulty}
</if>
<if test="tid != null">
and pt.tid = #{tid}
</if>
<if test="oj != null">
and p.problem_id like concat(#{oj},'%')
</if>
</where>
order by length(p.problem_id) asc,p.problem_id asc
</select>
<!-- 子查询 :为了防止分页总数据数出错-->
<select id="getProblemTag" resultType="top.hcode.hoj.pojo.entity.Tag">
select t.* from tag t,problem_tag pt where t.id = pt.tid and pt.pid = #{pid}
</select>
</mapper>

View File

@ -1,24 +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="top.hcode.hoj.dao.RoleAuthMapper">
<resultMap id="map_RoleAuths" type="top.hcode.hoj.pojo.vo.RoleAuthsVo">
<id column="id" property="id"></id>
<result column="role" property="role"></result>
<result column="description" property="description"></result>
<result column="status" property="status"></result>
<result column="gmt_create" property="gmtCreate"></result>
<result column="gmt_modified" property="gmtModified"></result>
<collection property="auths" ofType="top.hcode.hoj.pojo.entity.Auth">
<id column="auth_id" property="id"></id>
<result column="name" property="name"></result>
<result column="permission" property="permission"></result>
<result column="auth_status" property="status"></result>
<result column="gmt_create" property="gmtCreate"></result>
<result column="gmt_modified" property="gmtModified"></result>
</collection>
</resultMap>
<select id="getRoleAuths" resultMap="map_RoleAuths">
SELECT r.*,a.id as auth_id,a.name,a.permission,a.status as auth_status FROM role r
LEFT OUTER JOIN role_auth ra ON r.id=ra.role_id LEFT JOIN auth a ON ra.auth_id = a.id WHERE r.id= #{rid}
</select>
</mapper>

View File

@ -1,5 +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="top.hcode.hoj.dao.RoleMapper">
</mapper>

View File

@ -1,5 +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="top.hcode.hoj.dao.SessionMapper">
</mapper>

View File

@ -1,5 +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="top.hcode.hoj.dao.TagMapper">
</mapper>

View File

@ -1,5 +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="top.hcode.hoj.dao.UserAcproblemMapper">
</mapper>

View File

@ -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="top.hcode.hoj.dao.UserInfoMapper">
<insert id="addUser" parameterType="top.hcode.hoj.pojo.dto.RegisterDto">
insert into user_info(uuid,username,password,email) values (
#{uuid}, #{username},#{password},#{email}
)
</insert>
</mapper>

View File

@ -1,39 +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="top.hcode.hoj.dao.UserRecordMapper">
<select id="getACMRankList" resultType="top.hcode.hoj.pojo.vo.ACMRankVo" useCache="true">
SELECT u.uuid as uid,u.nickname,u.username,u.signature,u.avatar,ur.submissions as total,ur.rating,
(SELECT COUNT( DISTINCT pid ) FROM user_acproblem WHERE uid =u.uuid) AS solved,
(SELECT COUNT(pid) FROM user_acproblem WHERE uid =u.uuid) AS ac
FROM user_info u,user_record ur WHERE u.uuid = ur.uid AND u.status = 0
ORDER BY ac DESC,solved DESC
</select>
<select id="getRecent7ACRank" resultType="top.hcode.hoj.pojo.vo.ACMRankVo">
SELECT u.uuid as uid,u.nickname,u.username,u.signature,u.avatar,ur.submissions as total,ur.rating,
(SELECT COUNT( DISTINCT pid ) FROM user_acproblem WHERE uid =u.uuid
and DATE(gmt_create) >= DATE_SUB(CURDATE(),INTERVAL 7 DAY) ) AS solved,
(SELECT COUNT(pid) FROM user_acproblem WHERE uid =u.uuid
and DATE(gmt_create) >= DATE_SUB(CURDATE(),INTERVAL 7 DAY)) AS ac
FROM user_info u,user_record ur WHERE u.uuid = ur.uid AND u.status = 0
ORDER BY ac DESC,solved DESC LIMIT 10
</select>
<select id="getOIRankList" resultType="top.hcode.hoj.pojo.vo.OIRankVo" useCache="true">
SELECT u.uuid as uid,u.nickname,u.username,u.signature,u.avatar,ur.submissions as total,ur.rating,
ur.total_score as score,
(SELECT COUNT(pid) FROM user_acproblem WHERE uid =u.uuid) AS ac
FROM user_info u,user_record ur WHERE u.uuid = ur.uid AND u.status = 0
ORDER BY score DESC,ac DESC
</select>
<select id="getUserHomeInfo" resultType="top.hcode.hoj.pojo.vo.UserHomeVo">
SELECT u.username,u.signature,u.school,u.github,u.blog,u.avatar,ur.submissions as total,ur.rating,
ur.total_score as score
FROM user_info u,user_record ur WHERE u.uuid = ur.uid AND u.status = 0 AND u.uuid = #{uid}
</select>
</mapper>

View File

@ -1,91 +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="top.hcode.hoj.dao.UserRoleMapper">
<resultMap id="map_UserRoles" type="top.hcode.hoj.pojo.vo.UserRolesVo">
<id column="uuid" property="uid"></id>
<result column="username" property="username"></result>
<result column="password" property="password"></result>
<result column="nickname" property="nickname"></result>
<result column="school" property="school"></result>
<result column="course" property="course"></result>
<result column="number" property="number"></result>
<result column="realname" property="realname"></result>
<result column="cf_username" property="cfUsername"></result>
<result column="github" property="github"></result>
<result column="blog" property="blog"></result>
<result column="email" property="email"></result>
<result column="signature" property="signature"></result>
<result column="status" property="status"></result>
<result column="avatar" property="avatar"></result>
<result column="gmt_create" property="gmtCreate"></result>
<result column="gmt_modified" property="gmtModified"></result>
<collection property="roles" ofType="top.hcode.hoj.pojo.entity.Role">
<id column="role_id" property="id"></id>
<result column="role" property="role"></result>
<result column="description" property="description"></result>
<result column="role_status" property="status"></result>
<result column="role_gmt_create" property="gmtCreate"></result>
<result column="role_gmt_modified" property="gmtModified"></result>
</collection>
</resultMap>
<select id="getUserRoles" resultMap="map_UserRoles">
SELECT r.id as role_id,r.role as role,r.description as description,r.status as role_status, r.gmt_create as
role_gmt_create,
r.gmt_modified as role_gmt_modified,
u.* FROM user_info u
LEFT OUTER JOIN user_role ur ON u.uuid=ur.uid LEFT JOIN role r ON ur.role_id = r.id
<where>
<if test="uid != null and uid != ''">
u.uuid = #{uid}
</if>
<if test="username != null and username != ''">
and u.username = #{username}
</if>
</where>
</select>
<resultMap id="map_UserRolesList" type="top.hcode.hoj.pojo.vo.UserRolesVo">
<id column="uuid" property="uid"></id>
<result column="username" property="username"></result>
<result column="password" property="password"></result>
<result column="nickname" property="nickname"></result>
<result column="school" property="school"></result>
<result column="course" property="course"></result>
<result column="number" property="number"></result>
<result column="realname" property="realname"></result>
<result column="cf_username" property="cfUsername"></result>
<result column="github" property="github"></result>
<result column="blog" property="blog"></result>
<result column="email" property="email"></result>
<result column="signature" property="signature"></result>
<result column="status" property="status"></result>
<result column="avatar" property="avatar"></result>
<result column="gmt_create" property="gmtCreate"></result>
<result column="gmt_modified" property="gmtModified"></result>
<collection property="roles" ofType="top.hcode.hoj.pojo.entity.Role" select="getUserListRoles" column="uuid">
</collection>
</resultMap>
<!-- 主查询 -->
<select id="getUserList" resultMap="map_UserRolesList" resultType="list">
SELECT u.* FROM user_info u
<where>
<if test="keyword!=null and keyword!=''">
u.username like CONCAT("%",#{keyword},"%")
or u.email like CONCAT("%",#{keyword},"%")
or u.realname like CONCAT("%",#{keyword},"%")
</if>
</where>
order by u.gmt_create desc
</select>
<!-- 子查询 -->
<select id="getUserListRoles" resultType="top.hcode.hoj.pojo.entity.Role">
select r.* from role r,user_role ur where ur.uid=#{uuid} and ur.role_id = r.id
</select>
</mapper>

Some files were not shown because too many files have changed in this diff Show More