serv\web- 日志
This commit is contained in:
@@ -39,77 +39,85 @@ public interface CourseMapper extends BaseMapper<TbCourse> {
|
||||
TbCourse selectByCourseId(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 根据课程名称查询课程
|
||||
* @description 根据课程名称查询课程(包含权限过滤)
|
||||
* @param name 课程名称
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return TbCourse 课程信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbCourse selectByName(@Param("name") String name);
|
||||
TbCourse selectByName(@Param("name") String name, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 根据状态查询课程列表
|
||||
* @description 根据状态查询课程列表(包含权限过滤)
|
||||
* @param status 状态
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectByStatus(@Param("status") Integer status);
|
||||
List<TbCourse> selectByStatus(@Param("status") Integer status, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 根据类型查询课程列表
|
||||
* @description 根据类型查询课程列表(包含权限过滤)
|
||||
* @param type 类型
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectByType(@Param("type") Integer type);
|
||||
List<TbCourse> selectByType(@Param("type") Integer type, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 根据难度查询课程列表
|
||||
* @description 根据难度查询课程列表(包含权限过滤)
|
||||
* @param difficulty 难度
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectByDifficulty(@Param("difficulty") Integer difficulty);
|
||||
List<TbCourse> selectByDifficulty(@Param("difficulty") Integer difficulty, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 查询热门课程列表
|
||||
* @description 查询热门课程列表(包含权限过滤)
|
||||
* @param limit 限制数量
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectHotCourses(@Param("limit") Integer limit);
|
||||
List<TbCourse> selectHotCourses(@Param("limit") Integer limit, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 查询最新课程列表
|
||||
* @description 查询最新课程列表(包含权限过滤)
|
||||
* @param limit 限制数量
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectLatestCourses(@Param("limit") Integer limit);
|
||||
List<TbCourse> selectLatestCourses(@Param("limit") Integer limit, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 根据关键词搜索课程
|
||||
* @description 根据关键词搜索课程(包含权限过滤)
|
||||
* @param keyword 关键词
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> searchByKeyword(@Param("keyword") String keyword);
|
||||
List<TbCourse> searchByKeyword(@Param("keyword") String keyword, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 检查课程名称是否存在
|
||||
* @description 检查课程名称是否存在(包含权限过滤)
|
||||
* @param name 课程名称
|
||||
* @param excludeId 排除的课程ID(用于更新时排除自身)
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return int 存在的数量
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int countByName(@Param("name") String name, @Param("excludeId") String excludeId);
|
||||
int countByName(@Param("name") String name, @Param("excludeId") String excludeId, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 插入课程
|
||||
|
||||
@@ -58,22 +58,24 @@ public interface LearningTaskMapper extends BaseMapper<TbLearningTask> {
|
||||
TbLearningTask selectByName(@Param("name") String name);
|
||||
|
||||
/**
|
||||
* @description 根据状态查询学习任务列表
|
||||
* @description 根据状态查询学习任务列表(包含权限过滤)
|
||||
* @param status 状态
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return List<TbLearningTask> 学习任务列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningTask> selectByStatus(@Param("status") Integer status);
|
||||
List<TbLearningTask> selectByStatus(@Param("status") Integer status, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 根据优先级查询学习任务列表
|
||||
* @description 根据优先级查询学习任务列表(包含权限过滤)
|
||||
* @param priority 优先级
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return List<TbLearningTask> 学习任务列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningTask> selectByPriority(@Param("priority") Integer priority);
|
||||
List<TbLearningTask> selectByPriority(@Param("priority") Integer priority, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 查询用户待完成任务列表
|
||||
@@ -94,14 +96,15 @@ public interface LearningTaskMapper extends BaseMapper<TbLearningTask> {
|
||||
List<TbLearningTask> selectCompletedTasksByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @description 检查任务名称是否存在
|
||||
* @description 检查任务名称是否存在(包含权限过滤)
|
||||
* @param name 任务名称
|
||||
* @param excludeId 排除的任务ID(用于更新时排除自身)
|
||||
* @param userDeptRoles 用户部门角色列表
|
||||
* @return int 存在的数量
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int countByName(@Param("name") String name, @Param("excludeId") String excludeId);
|
||||
int countByName(@Param("name") String name, @Param("excludeId") String excludeId, @Param("userDeptRoles") List<UserDeptRoleVO> userDeptRoles);
|
||||
|
||||
/**
|
||||
* @description 插入学习任务
|
||||
|
||||
@@ -140,46 +140,46 @@
|
||||
|
||||
<!-- 根据课程名称查询课程 -->
|
||||
<select id="selectByName" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course
|
||||
WHERE name = #{name} AND deleted = 0
|
||||
SELECT DISTINCT c.*
|
||||
FROM tb_course c
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE c.name = #{name} AND c.deleted = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据状态查询课程列表 -->
|
||||
<select id="selectByStatus" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course
|
||||
WHERE status = #{status} AND deleted = 0
|
||||
ORDER BY order_num ASC, create_time DESC
|
||||
SELECT DISTINCT c.*
|
||||
FROM tb_course c
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE c.status = #{status} AND c.deleted = 0
|
||||
ORDER BY c.order_num ASC, c.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据类型查询课程列表 -->
|
||||
<select id="selectByType" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course
|
||||
WHERE deleted = 0
|
||||
ORDER BY order_num ASC, create_time DESC
|
||||
SELECT DISTINCT c.*
|
||||
FROM tb_course c
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE c.deleted = 0
|
||||
ORDER BY c.order_num ASC, c.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据难度查询课程列表 -->
|
||||
<select id="selectByDifficulty" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course
|
||||
WHERE deleted = 0
|
||||
ORDER BY order_num ASC, create_time DESC
|
||||
SELECT DISTINCT c.*
|
||||
FROM tb_course c
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE c.deleted = 0
|
||||
ORDER BY c.order_num ASC, c.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询热门课程列表 -->
|
||||
<select id="selectHotCourses" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course
|
||||
WHERE status = 1 AND deleted = 0
|
||||
ORDER BY view_count DESC, learn_count DESC, create_time DESC
|
||||
SELECT DISTINCT c.*
|
||||
FROM tb_course c
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE c.status = 1 AND c.deleted = 0
|
||||
ORDER BY c.view_count DESC, c.learn_count DESC, c.create_time DESC
|
||||
<if test="limit != null and limit > 0">
|
||||
LIMIT #{limit}
|
||||
</if>
|
||||
@@ -187,11 +187,11 @@
|
||||
|
||||
<!-- 查询最新课程列表 -->
|
||||
<select id="selectLatestCourses" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course
|
||||
WHERE status = 1 AND deleted = 0
|
||||
ORDER BY create_time DESC
|
||||
SELECT DISTINCT c.*
|
||||
FROM tb_course c
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE c.status = 1 AND c.deleted = 0
|
||||
ORDER BY c.create_time DESC
|
||||
<if test="limit != null and limit > 0">
|
||||
LIMIT #{limit}
|
||||
</if>
|
||||
@@ -199,24 +199,25 @@
|
||||
|
||||
<!-- 根据关键词搜索课程 -->
|
||||
<select id="searchByKeyword" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course
|
||||
WHERE (name LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR description LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR content LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR teacher LIKE CONCAT('%', #{keyword}, '%'))
|
||||
AND status = 1 AND deleted = 0
|
||||
ORDER BY order_num ASC, create_time DESC
|
||||
SELECT DISTINCT c.*
|
||||
FROM tb_course c
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE (c.name LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR c.description LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR c.content LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR c.teacher LIKE CONCAT('%', #{keyword}, '%'))
|
||||
AND c.status = 1 AND c.deleted = 0
|
||||
ORDER BY c.order_num ASC, c.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 检查课程名称是否存在 -->
|
||||
<!-- 检查课程名称是否存在 - 添加权限过滤 -->
|
||||
<select id="countByName" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_course
|
||||
WHERE name = #{name} AND deleted = 0
|
||||
SELECT COUNT(DISTINCT c.id)
|
||||
FROM tb_course c
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE c.name = #{name} AND c.deleted = 0
|
||||
<if test="excludeId != null and excludeId != ''">
|
||||
AND id != #{excludeId}
|
||||
AND c.id != #{excludeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -224,10 +225,10 @@
|
||||
<insert id="insertCourse" parameterType="org.xyzh.common.dto.study.TbCourse">
|
||||
INSERT INTO tb_course (
|
||||
id, course_id, name, cover_image, description, content, duration,
|
||||
teacher, status, view_count, learn_count, order_num, creator, create_time
|
||||
teacher, status, order_num, creator, create_time
|
||||
) VALUES (
|
||||
#{id}, #{courseID}, #{name}, #{coverImage}, #{description}, #{content}, #{duration},
|
||||
#{teacher}, #{status}, 0, 0, #{orderNum}, #{creator},#{createTime}
|
||||
#{teacher}, #{status}, #{orderNum}, #{creator},#{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -291,14 +292,14 @@
|
||||
<insert id="batchInsertCourses" parameterType="java.util.List">
|
||||
INSERT INTO tb_course (
|
||||
id, course_id, name, cover_image, description, content, duration,
|
||||
teacher, status, view_count, learn_count, order_num, creator,
|
||||
create_time, delete_time, deleted
|
||||
teacher, status, order_num, creator,
|
||||
create_time
|
||||
) VALUES
|
||||
<foreach collection="courseList" item="item" separator=",">
|
||||
(
|
||||
#{item.id}, #{item.courseID}, #{item.name}, #{item.coverImage}, #{item.description},
|
||||
#{item.content}, #{item.duration}, #{item.teacher}, #{item.status}, 0,
|
||||
0, #{item.orderNum}, #{item.creator}, #{item.createTime}, #{item.deleteTime}, #{item.deleted}
|
||||
#{item.content}, #{item.duration}, #{item.teacher}, #{item.status},
|
||||
#{item.orderNum}, #{item.creator}, #{item.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@@ -124,28 +124,28 @@
|
||||
|
||||
<!-- 根据任务名称查询任务 -->
|
||||
<select id="selectByName" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE name = #{name} AND deleted = 0
|
||||
SELECT DISTINCT t.*
|
||||
FROM tb_learning_task t
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE t.name = #{name} AND t.deleted = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据状态查询学习任务列表 -->
|
||||
<select id="selectByStatus" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE status = #{status} AND deleted = 0
|
||||
ORDER BY create_time DESC
|
||||
SELECT DISTINCT t.*
|
||||
FROM tb_learning_task t
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE t.status = #{status} AND t.deleted = 0
|
||||
ORDER BY t.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据优先级查询学习任务列表 -->
|
||||
<select id="selectByPriority" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE deleted = 0
|
||||
ORDER BY create_time DESC
|
||||
SELECT DISTINCT t.*
|
||||
FROM tb_learning_task t
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE t.deleted = 0
|
||||
ORDER BY t.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询用户待完成任务列表 -->
|
||||
@@ -153,7 +153,9 @@
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE status = 0 AND deleted = 0
|
||||
LEFT JOIN tb_task_user tu ON t.task_id = tu.task_id
|
||||
WHERE t.status = 0 AND t.deleted = 0
|
||||
AND tu.user_id = #{userId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -162,17 +164,20 @@
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE status = 1 AND deleted = 0
|
||||
ORDER BY create_time DESC
|
||||
LEFT JOIN tb_task_user tu ON t.task_id = tu.task_id
|
||||
WHERE t.status = 1 AND t.deleted = 0
|
||||
AND tu.user_id = #{userId}
|
||||
ORDER BY t.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 检查任务名称是否存在 -->
|
||||
<select id="countByName" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_learning_task
|
||||
WHERE name = #{name} AND deleted = 0
|
||||
SELECT COUNT(DISTINCT t.id)
|
||||
FROM tb_learning_task t
|
||||
<include refid="Permission_Filter"/>
|
||||
WHERE t.name = #{name} AND t.deleted = 0
|
||||
<if test="excludeId != null and excludeId != ''">
|
||||
AND id != #{excludeId}
|
||||
AND t.id != #{excludeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
<result column="resource_name" property="resourceName" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="username" property="username" jdbcType="VARCHAR"/>
|
||||
<result column="dept_id" property="deptID" jdbcType="VARCHAR"/>
|
||||
<result column="dept_name" property="deptName" jdbcType="VARCHAR"/>
|
||||
<result column="parent_id" property="parentID" jdbcType="VARCHAR"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="progress" property="progress" jdbcType="DECIMAL"/>
|
||||
<result column="complete_time" property="completeTime" jdbcType="TIMESTAMP"/>
|
||||
@@ -86,21 +89,44 @@
|
||||
|
||||
<select id="selectTaskItemByTaskId" resultMap="TaskItemResultMap">
|
||||
SELECT
|
||||
ttu.*,
|
||||
tu.username
|
||||
ttu.id,
|
||||
ttu.task_id,
|
||||
ttu.user_id,
|
||||
ttu.status,
|
||||
ttu.progress,
|
||||
ttu.complete_time,
|
||||
ttu.creator,
|
||||
ttu.create_time,
|
||||
tu.username,
|
||||
ttu.dept_id,
|
||||
d.name as dept_name,
|
||||
d.parent_id
|
||||
FROM tb_task_user ttu
|
||||
INNER JOIN tb_sys_user tu ON ttu.user_id = tu.id
|
||||
WHERE ttu.task_id = #{taskId} and ttu.deleted = 0 and tu.deleted = 0
|
||||
INNER JOIN tb_sys_user tu ON ttu.user_id = tu.id AND tu.deleted = 0
|
||||
LEFT JOIN tb_sys_user_dept_role udr ON tu.id = udr.user_id AND udr.deleted = 0
|
||||
LEFT JOIN tb_sys_dept d ON udr.dept_id = d.dept_id AND d.deleted = 0
|
||||
WHERE ttu.task_id = #{taskId} AND ttu.deleted = 0
|
||||
ORDER BY ttu.create_time ASC
|
||||
</select>
|
||||
|
||||
<select id="selectUserTaskItem" resultMap="TaskItemResultMap">
|
||||
SELECT
|
||||
ttu.*,
|
||||
tu.username
|
||||
ttu.id,
|
||||
ttu.task_id,
|
||||
ttu.user_id,
|
||||
ttu.status,
|
||||
ttu.progress,
|
||||
ttu.complete_time,
|
||||
ttu.creator,
|
||||
ttu.create_time,
|
||||
tu.username,
|
||||
ttu.dept_id,
|
||||
d.name as dept_name,
|
||||
d.parent_id
|
||||
FROM tb_task_user ttu
|
||||
INNER JOIN tb_sys_user tu ON ttu.user_id = tu.id
|
||||
WHERE ttu.task_id = #{taskId} and ttu.user_id = #{userId} and ttu.deleted = 0 and tu.deleted = 0
|
||||
INNER JOIN tb_sys_user tu ON ttu.user_id = tu.id AND tu.deleted = 0
|
||||
LEFT JOIN tb_sys_dept d ON ttu.dept_id = d.dept_id AND d.deleted = 0
|
||||
WHERE ttu.task_id = #{taskId} AND ttu.user_id = #{userId} AND ttu.deleted = 0
|
||||
ORDER BY ttu.create_time ASC
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user