Compare commits
2 Commits
develop
...
zhouting_b
| Author | SHA1 | Date |
|---|---|---|
|
|
ea716687c5 | 4 months ago |
|
|
c2cbf4543d | 4 months ago |
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-present PanJiaChen
|
||||
Copyright (c) 2021 孤傲的小笼包
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -0,0 +1 @@
|
||||
java -jar exam-api.jar --spring.config.location=application-local.yml
|
||||
@ -0,0 +1 @@
|
||||
java -jar exam-api.jar --spring.config.location=application-local.yml
|
||||
|
After Width: | Height: | Size: 6.1 MiB |
@ -0,0 +1,10 @@
|
||||
<?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>
|
||||
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- SysRole实体类的基础字段映射 -->
|
||||
<!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">
|
||||
|
||||
<!-- 实体类SysRole与数据库表的字段通过BaseResultMap进行映射 -->
|
||||
<!-- 通用查询映射结果 -->
|
||||
<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>
|
||||
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- 数据库表sys_user的基础操作映射 -->
|
||||
<!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">
|
||||
|
||||
<!-- 实体类SysUser与数据库表的字段通过BaseResultMap进行映射 -->
|
||||
<!-- 通用查询映射结果 -->
|
||||
<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="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`,`password`,`salt`,`role_ids`,`depart_id`,`create_time`,`update_time`,`state`
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,19 @@
|
||||
<?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">
|
||||
|
||||
<!-- 实体类SysUserRole与数据库表的字段通过BaseResultMap进行映射 -->
|
||||
<!-- 通用查询映射结果 -->
|
||||
<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>
|
||||
@ -0,0 +1,58 @@
|
||||
<?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">
|
||||
|
||||
<!-- 实体类UserExam与数据库表的字段通过BaseResultMap进行映射 -->
|
||||
<!-- 通用查询映射结果 -->
|
||||
<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>
|
||||
|
||||
|
||||
<!-- 分页查询扩展映射,为分页查询结果增加关联表字段,用于前端展示,扩展自BaseResultMap -->
|
||||
<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>
|
||||
@ -0,0 +1,10 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# 依赖于环境的 Maven 主目录路径
|
||||
/mavenHomeManager.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |