serv-mapper和.xml 基本增删改
This commit is contained in:
@@ -2,12 +2,14 @@ package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.study.TbCourseChapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 课程章节数据访问层
|
||||
* @description CourseChapterMapper.java文件描述 课程章节数据访问层
|
||||
* @filename CourseChapterMapper.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
@@ -24,4 +26,132 @@ public interface CourseChapterMapper extends BaseMapper<TbCourseChapter> {
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseChapter> selectCourseChapters(TbCourseChapter filter);
|
||||
|
||||
/**
|
||||
* @description 根据章节ID查询章节信息
|
||||
* @param chapterId 章节ID
|
||||
* @return TbCourseChapter 章节信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbCourseChapter selectByChapterId(@Param("chapterId") String chapterId);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID查询章节列表
|
||||
* @param courseId 课程ID
|
||||
* @return List<TbCourseChapter> 章节列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseChapter> selectByCourseId(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 根据章节名称查询章节
|
||||
* @param name 章节名称
|
||||
* @return TbCourseChapter 章节信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbCourseChapter selectByName(@Param("name") String name);
|
||||
|
||||
/**
|
||||
* @description 根据状态查询章节列表
|
||||
* @param status 状态
|
||||
* @return List<TbCourseChapter> 章节列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseChapter> selectByStatus(@Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID和排序查询章节列表
|
||||
* @param courseId 课程ID
|
||||
* @return List<TbCourseChapter> 章节列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseChapter> selectByCourseIdOrderBySort(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 检查章节名称是否存在
|
||||
* @param name 章节名称
|
||||
* @param excludeId 排除的章节ID(用于更新时排除自身)
|
||||
* @return int 存在的数量
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int countByName(@Param("name") String name, @Param("excludeId") String excludeId);
|
||||
|
||||
/**
|
||||
* @description 插入课程章节
|
||||
* @param courseChapter 课程章节
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int insertCourseChapter(TbCourseChapter courseChapter);
|
||||
|
||||
/**
|
||||
* @description 更新课程章节
|
||||
* @param courseChapter 课程章节
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int updateCourseChapter(TbCourseChapter courseChapter);
|
||||
|
||||
/**
|
||||
* @description 删除课程章节
|
||||
* @param courseChapter 课程章节
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteCourseChapter(TbCourseChapter courseChapter);
|
||||
|
||||
/**
|
||||
* @description 批量插入课程章节
|
||||
* @param courseChapterList 课程章节列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchInsertCourseChapters(@Param("courseChapterList") List<TbCourseChapter> courseChapterList);
|
||||
|
||||
/**
|
||||
* @description 批量删除课程章节
|
||||
* @param ids 章节ID列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchDeleteCourseChapters(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID批量删除章节
|
||||
* @param courseId 课程ID
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteByCourseId(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 分页查询课程章节
|
||||
* @param filter 过滤条件
|
||||
* @param pageParam 分页参数
|
||||
* @return List<TbCourseChapter> 课程章节列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseChapter> selectCourseChaptersPage(@Param("filter") TbCourseChapter filter, @Param("pageParam") PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 统计课程章节总数
|
||||
* @param filter 过滤条件
|
||||
* @return long 总数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
long countCourseChapters(@Param("filter") TbCourseChapter filter);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.study.TbCourse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 课程数据访问层
|
||||
* @description CourseMapper.java文件描述 课程数据访问层
|
||||
* @filename CourseMapper.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
@@ -24,4 +26,150 @@ public interface CourseMapper extends BaseMapper<TbCourse> {
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectCourses(TbCourse filter);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID查询课程信息
|
||||
* @param courseId 课程ID
|
||||
* @return TbCourse 课程信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbCourse selectByCourseId(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 根据课程名称查询课程
|
||||
* @param name 课程名称
|
||||
* @return TbCourse 课程信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbCourse selectByName(@Param("name") String name);
|
||||
|
||||
/**
|
||||
* @description 根据状态查询课程列表
|
||||
* @param status 状态
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectByStatus(@Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* @description 根据类型查询课程列表
|
||||
* @param type 类型
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectByType(@Param("type") Integer type);
|
||||
|
||||
/**
|
||||
* @description 根据难度查询课程列表
|
||||
* @param difficulty 难度
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectByDifficulty(@Param("difficulty") Integer difficulty);
|
||||
|
||||
/**
|
||||
* @description 查询热门课程列表
|
||||
* @param limit 限制数量
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectHotCourses(@Param("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* @description 查询最新课程列表
|
||||
* @param limit 限制数量
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectLatestCourses(@Param("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* @description 根据关键词搜索课程
|
||||
* @param keyword 关键词
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> searchByKeyword(@Param("keyword") String keyword);
|
||||
|
||||
/**
|
||||
* @description 检查课程名称是否存在
|
||||
* @param name 课程名称
|
||||
* @param excludeId 排除的课程ID(用于更新时排除自身)
|
||||
* @return int 存在的数量
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int countByName(@Param("name") String name, @Param("excludeId") String excludeId);
|
||||
|
||||
/**
|
||||
* @description 插入课程
|
||||
* @param course 课程
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int insertCourse(TbCourse course);
|
||||
|
||||
/**
|
||||
* @description 更新课程
|
||||
* @param course 课程
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int updateCourse(TbCourse course);
|
||||
|
||||
/**
|
||||
* @description 删除课程
|
||||
* @param course 课程
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteCourse(TbCourse course);
|
||||
|
||||
/**
|
||||
* @description 批量插入课程
|
||||
* @param courseList 课程列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchInsertCourses(@Param("courseList") List<TbCourse> courseList);
|
||||
|
||||
/**
|
||||
* @description 批量删除课程
|
||||
* @param ids 课程ID列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchDeleteCourses(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* @description 分页查询课程
|
||||
* @param filter 过滤条件
|
||||
* @param pageParam 分页参数
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectCoursesPage(@Param("filter") TbCourse filter, @Param("pageParam") PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 统计课程总数
|
||||
* @param filter 过滤条件
|
||||
* @return long 总数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
long countCourses(@Param("filter") TbCourse filter);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.study.TbCourseTag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 课程标签关联数据访问层
|
||||
* @description CourseTagMapper.java文件描述 课程标签关联数据访问层
|
||||
* @filename CourseTagMapper.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
@@ -24,4 +26,134 @@ public interface CourseTagMapper extends BaseMapper<TbCourseTag> {
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseTag> selectCourseTags(TbCourseTag filter);
|
||||
|
||||
/**
|
||||
* @description 根据关联ID查询关联信息
|
||||
* @param relationId 关联ID
|
||||
* @return TbCourseTag 关联信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbCourseTag selectByRelationId(@Param("relationId") String relationId);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID查询标签关联列表
|
||||
* @param courseId 课程ID
|
||||
* @return List<TbCourseTag> 标签关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseTag> selectByCourseId(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 根据标签ID查询课程关联列表
|
||||
* @param tagId 标签ID
|
||||
* @return List<TbCourseTag> 课程关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseTag> selectByTagId(@Param("tagId") String tagId);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID和标签ID查询关联信息
|
||||
* @param courseId 课程ID
|
||||
* @param tagId 标签ID
|
||||
* @return TbCourseTag 关联信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbCourseTag selectByCourseIdAndTagId(@Param("courseId") String courseId, @Param("tagId") String tagId);
|
||||
|
||||
/**
|
||||
* @description 检查课程标签关联是否存在
|
||||
* @param courseId 课程ID
|
||||
* @param tagId 标签ID
|
||||
* @param excludeId 排除的关联ID(用于更新时排除自身)
|
||||
* @return int 存在的数量
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int countByCourseIdAndTagId(@Param("courseId") String courseId, @Param("tagId") String tagId, @Param("excludeId") String excludeId);
|
||||
|
||||
/**
|
||||
* @description 插入课程标签关联
|
||||
* @param courseTag 课程标签关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int insertCourseTag(TbCourseTag courseTag);
|
||||
|
||||
/**
|
||||
* @description 更新课程标签关联
|
||||
* @param courseTag 课程标签关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int updateCourseTag(TbCourseTag courseTag);
|
||||
|
||||
/**
|
||||
* @description 删除课程标签关联
|
||||
* @param courseTag 课程标签关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteCourseTag(TbCourseTag courseTag);
|
||||
|
||||
/**
|
||||
* @description 批量插入课程标签关联
|
||||
* @param courseTagList 课程标签关联列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchInsertCourseTags(@Param("courseTagList") List<TbCourseTag> courseTagList);
|
||||
|
||||
/**
|
||||
* @description 批量删除课程标签关联
|
||||
* @param ids 关联ID列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchDeleteCourseTags(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID批量删除标签关联
|
||||
* @param courseId 课程ID
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteByCourseId(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 根据标签ID批量删除课程关联
|
||||
* @param tagId 标签ID
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteByTagId(@Param("tagId") String tagId);
|
||||
|
||||
/**
|
||||
* @description 分页查询课程标签关联
|
||||
* @param filter 过滤条件
|
||||
* @param pageParam 分页参数
|
||||
* @return List<TbCourseTag> 课程标签关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseTag> selectCourseTagsPage(@Param("filter") TbCourseTag filter, @Param("pageParam") PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 统计课程标签关联总数
|
||||
* @param filter 过滤条件
|
||||
* @return long 总数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
long countCourseTags(@Param("filter") TbCourseTag filter);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.study.TbLearningRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 学习记录数据访问层
|
||||
* @description LearningRecordMapper.java文件描述 学习记录数据访问层
|
||||
* @filename LearningRecordMapper.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
@@ -24,4 +26,123 @@ public interface LearningRecordMapper extends BaseMapper<TbLearningRecord> {
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningRecord> selectLearningRecords(TbLearningRecord filter);
|
||||
|
||||
/**
|
||||
* @description 根据记录ID查询记录信息
|
||||
* @param recordId 记录ID
|
||||
* @return TbLearningRecord 记录信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbLearningRecord selectByRecordId(@Param("recordId") String recordId);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID查询学习记录列表
|
||||
* @param userId 用户ID
|
||||
* @return List<TbLearningRecord> 学习记录列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningRecord> selectByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID查询学习记录列表
|
||||
* @param courseId 课程ID
|
||||
* @return List<TbLearningRecord> 学习记录列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningRecord> selectByCourseId(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID和课程ID查询学习记录
|
||||
* @param userId 用户ID
|
||||
* @param courseId 课程ID
|
||||
* @return TbLearningRecord 学习记录
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbLearningRecord selectByUserIdAndCourseId(@Param("userId") String userId, @Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 根据状态查询学习记录列表
|
||||
* @param status 状态
|
||||
* @return List<TbLearningRecord> 学习记录列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningRecord> selectByStatus(@Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* @description 查询用户学习统计信息
|
||||
* @param userId 用户ID
|
||||
* @return TbLearningRecord 统计信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbLearningRecord selectLearningStatistics(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @description 插入学习记录
|
||||
* @param learningRecord 学习记录
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int insertLearningRecord(TbLearningRecord learningRecord);
|
||||
|
||||
/**
|
||||
* @description 更新学习记录
|
||||
* @param learningRecord 学习记录
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int updateLearningRecord(TbLearningRecord learningRecord);
|
||||
|
||||
/**
|
||||
* @description 删除学习记录
|
||||
* @param learningRecord 学习记录
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteLearningRecord(TbLearningRecord learningRecord);
|
||||
|
||||
/**
|
||||
* @description 批量插入学习记录
|
||||
* @param learningRecordList 学习记录列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchInsertLearningRecords(@Param("learningRecordList") List<TbLearningRecord> learningRecordList);
|
||||
|
||||
/**
|
||||
* @description 批量删除学习记录
|
||||
* @param ids 记录ID列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchDeleteLearningRecords(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* @description 分页查询学习记录
|
||||
* @param filter 过滤条件
|
||||
* @param pageParam 分页参数
|
||||
* @return List<TbLearningRecord> 学习记录列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningRecord> selectLearningRecordsPage(@Param("filter") TbLearningRecord filter, @Param("pageParam") PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 统计学习记录总数
|
||||
* @param filter 过滤条件
|
||||
* @return long 总数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
long countLearningRecords(@Param("filter") TbLearningRecord filter);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.study.TbLearningStatistics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 学习统计数据访问层
|
||||
* @description LearningStatisticsMapper.java文件描述 学习统计数据访问层
|
||||
* @filename LearningStatisticsMapper.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
@@ -24,4 +26,123 @@ public interface LearningStatisticsMapper extends BaseMapper<TbLearningStatistic
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningStatistics> selectLearningStatistics(TbLearningStatistics filter);
|
||||
|
||||
/**
|
||||
* @description 根据统计ID查询统计信息
|
||||
* @param statisticsId 统计ID
|
||||
* @return TbLearningStatistics 统计信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbLearningStatistics selectByStatisticsId(@Param("statisticsId") String statisticsId);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID查询学习统计
|
||||
* @param userId 用户ID
|
||||
* @return TbLearningStatistics 学习统计
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbLearningStatistics selectByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID查询学习统计列表
|
||||
* @param courseId 课程ID
|
||||
* @return List<TbLearningStatistics> 学习统计列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningStatistics> selectByCourseId(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID和课程ID查询学习统计
|
||||
* @param userId 用户ID
|
||||
* @param courseId 课程ID
|
||||
* @return TbLearningStatistics 学习统计
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbLearningStatistics selectByUserIdAndCourseId(@Param("userId") String userId, @Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 根据统计类型查询学习统计列表
|
||||
* @param type 统计类型
|
||||
* @return List<TbLearningStatistics> 学习统计列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningStatistics> selectByType(@Param("type") Integer type);
|
||||
|
||||
/**
|
||||
* @description 查询用户学习排行榜
|
||||
* @param limit 限制数量
|
||||
* @return List<TbLearningStatistics> 学习统计列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningStatistics> selectLearningRanking(@Param("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* @description 插入学习统计
|
||||
* @param learningStatistics 学习统计
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int insertLearningStatistics(TbLearningStatistics learningStatistics);
|
||||
|
||||
/**
|
||||
* @description 更新学习统计
|
||||
* @param learningStatistics 学习统计
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int updateLearningStatistics(TbLearningStatistics learningStatistics);
|
||||
|
||||
/**
|
||||
* @description 删除学习统计
|
||||
* @param learningStatistics 学习统计
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteLearningStatistics(TbLearningStatistics learningStatistics);
|
||||
|
||||
/**
|
||||
* @description 批量插入学习统计
|
||||
* @param learningStatisticsList 学习统计列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchInsertLearningStatistics(@Param("learningStatisticsList") List<TbLearningStatistics> learningStatisticsList);
|
||||
|
||||
/**
|
||||
* @description 批量删除学习统计
|
||||
* @param ids 统计ID列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchDeleteLearningStatistics(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* @description 分页查询学习统计
|
||||
* @param filter 过滤条件
|
||||
* @param pageParam 分页参数
|
||||
* @return List<TbLearningStatistics> 学习统计列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningStatistics> selectLearningStatisticsPage(@Param("filter") TbLearningStatistics filter, @Param("pageParam") PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 统计学习统计总数
|
||||
* @param filter 过滤条件
|
||||
* @return long 总数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
long countLearningStatistics(@Param("filter") TbLearningStatistics filter);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.study.TbLearningTask;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 学习任务数据访问层
|
||||
* @description LearningTaskMapper.java文件描述 学习任务数据访问层
|
||||
* @filename LearningTaskMapper.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
@@ -24,4 +26,141 @@ public interface LearningTaskMapper extends BaseMapper<TbLearningTask> {
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningTask> selectLearningTasks(TbLearningTask filter);
|
||||
|
||||
/**
|
||||
* @description 根据任务ID查询任务信息
|
||||
* @param taskId 任务ID
|
||||
* @return TbLearningTask 任务信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbLearningTask selectByTaskId(@Param("taskId") String taskId);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID查询学习任务列表
|
||||
* @param userId 用户ID
|
||||
* @return List<TbLearningTask> 学习任务列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningTask> selectByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @description 根据任务名称查询任务
|
||||
* @param name 任务名称
|
||||
* @return TbLearningTask 任务信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbLearningTask selectByName(@Param("name") String name);
|
||||
|
||||
/**
|
||||
* @description 根据状态查询学习任务列表
|
||||
* @param status 状态
|
||||
* @return List<TbLearningTask> 学习任务列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningTask> selectByStatus(@Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* @description 根据优先级查询学习任务列表
|
||||
* @param priority 优先级
|
||||
* @return List<TbLearningTask> 学习任务列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningTask> selectByPriority(@Param("priority") Integer priority);
|
||||
|
||||
/**
|
||||
* @description 查询用户待完成任务列表
|
||||
* @param userId 用户ID
|
||||
* @return List<TbLearningTask> 学习任务列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningTask> selectPendingTasksByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @description 查询用户已完成任务列表
|
||||
* @param userId 用户ID
|
||||
* @return List<TbLearningTask> 学习任务列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningTask> selectCompletedTasksByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @description 检查任务名称是否存在
|
||||
* @param name 任务名称
|
||||
* @param excludeId 排除的任务ID(用于更新时排除自身)
|
||||
* @return int 存在的数量
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int countByName(@Param("name") String name, @Param("excludeId") String excludeId);
|
||||
|
||||
/**
|
||||
* @description 插入学习任务
|
||||
* @param learningTask 学习任务
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int insertLearningTask(TbLearningTask learningTask);
|
||||
|
||||
/**
|
||||
* @description 更新学习任务
|
||||
* @param learningTask 学习任务
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int updateLearningTask(TbLearningTask learningTask);
|
||||
|
||||
/**
|
||||
* @description 删除学习任务
|
||||
* @param learningTask 学习任务
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteLearningTask(TbLearningTask learningTask);
|
||||
|
||||
/**
|
||||
* @description 批量插入学习任务
|
||||
* @param learningTaskList 学习任务列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchInsertLearningTasks(@Param("learningTaskList") List<TbLearningTask> learningTaskList);
|
||||
|
||||
/**
|
||||
* @description 批量删除学习任务
|
||||
* @param ids 任务ID列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchDeleteLearningTasks(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* @description 分页查询学习任务
|
||||
* @param filter 过滤条件
|
||||
* @param pageParam 分页参数
|
||||
* @return List<TbLearningTask> 学习任务列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningTask> selectLearningTasksPage(@Param("filter") TbLearningTask filter, @Param("pageParam") PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 统计学习任务总数
|
||||
* @param filter 过滤条件
|
||||
* @return long 总数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
long countLearningTasks(@Param("filter") TbLearningTask filter);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.study.TbTaskCourse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 任务课程关联数据访问层
|
||||
* @description TaskCourseMapper.java文件描述 任务课程关联数据访问层
|
||||
* @filename TaskCourseMapper.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
@@ -24,4 +26,134 @@ public interface TaskCourseMapper extends BaseMapper<TbTaskCourse> {
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskCourse> selectTaskCourses(TbTaskCourse filter);
|
||||
|
||||
/**
|
||||
* @description 根据关联ID查询关联信息
|
||||
* @param relationId 关联ID
|
||||
* @return TbTaskCourse 关联信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbTaskCourse selectByRelationId(@Param("relationId") String relationId);
|
||||
|
||||
/**
|
||||
* @description 根据任务ID查询课程关联列表
|
||||
* @param taskId 任务ID
|
||||
* @return List<TbTaskCourse> 课程关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskCourse> selectByTaskId(@Param("taskId") String taskId);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID查询任务关联列表
|
||||
* @param courseId 课程ID
|
||||
* @return List<TbTaskCourse> 任务关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskCourse> selectByCourseId(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 根据任务ID和课程ID查询关联信息
|
||||
* @param taskId 任务ID
|
||||
* @param courseId 课程ID
|
||||
* @return TbTaskCourse 关联信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbTaskCourse selectByTaskIdAndCourseId(@Param("taskId") String taskId, @Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 检查任务课程关联是否存在
|
||||
* @param taskId 任务ID
|
||||
* @param courseId 课程ID
|
||||
* @param excludeId 排除的关联ID(用于更新时排除自身)
|
||||
* @return int 存在的数量
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int countByTaskIdAndCourseId(@Param("taskId") String taskId, @Param("courseId") String courseId, @Param("excludeId") String excludeId);
|
||||
|
||||
/**
|
||||
* @description 插入任务课程关联
|
||||
* @param taskCourse 任务课程关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int insertTaskCourse(TbTaskCourse taskCourse);
|
||||
|
||||
/**
|
||||
* @description 更新任务课程关联
|
||||
* @param taskCourse 任务课程关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int updateTaskCourse(TbTaskCourse taskCourse);
|
||||
|
||||
/**
|
||||
* @description 删除任务课程关联
|
||||
* @param taskCourse 任务课程关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteTaskCourse(TbTaskCourse taskCourse);
|
||||
|
||||
/**
|
||||
* @description 批量插入任务课程关联
|
||||
* @param taskCourseList 任务课程关联列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchInsertTaskCourses(@Param("taskCourseList") List<TbTaskCourse> taskCourseList);
|
||||
|
||||
/**
|
||||
* @description 批量删除任务课程关联
|
||||
* @param ids 关联ID列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchDeleteTaskCourses(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* @description 根据任务ID批量删除课程关联
|
||||
* @param taskId 任务ID
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteByTaskId(@Param("taskId") String taskId);
|
||||
|
||||
/**
|
||||
* @description 根据课程ID批量删除任务关联
|
||||
* @param courseId 课程ID
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteByCourseId(@Param("courseId") String courseId);
|
||||
|
||||
/**
|
||||
* @description 分页查询任务课程关联
|
||||
* @param filter 过滤条件
|
||||
* @param pageParam 分页参数
|
||||
* @return List<TbTaskCourse> 任务课程关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskCourse> selectTaskCoursesPage(@Param("filter") TbTaskCourse filter, @Param("pageParam") PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 统计任务课程关联总数
|
||||
* @param filter 过滤条件
|
||||
* @return long 总数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
long countTaskCourses(@Param("filter") TbTaskCourse filter);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.study.TbTaskResource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 任务资源关联数据访问层
|
||||
* @description TaskResourceMapper.java文件描述 任务资源关联数据访问层
|
||||
* @filename TaskResourceMapper.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
@@ -24,4 +26,134 @@ public interface TaskResourceMapper extends BaseMapper<TbTaskResource> {
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskResource> selectTaskResources(TbTaskResource filter);
|
||||
|
||||
/**
|
||||
* @description 根据关联ID查询关联信息
|
||||
* @param relationId 关联ID
|
||||
* @return TbTaskResource 关联信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbTaskResource selectByRelationId(@Param("relationId") String relationId);
|
||||
|
||||
/**
|
||||
* @description 根据任务ID查询资源关联列表
|
||||
* @param taskId 任务ID
|
||||
* @return List<TbTaskResource> 资源关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskResource> selectByTaskId(@Param("taskId") String taskId);
|
||||
|
||||
/**
|
||||
* @description 根据资源ID查询任务关联列表
|
||||
* @param resourceId 资源ID
|
||||
* @return List<TbTaskResource> 任务关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskResource> selectByResourceId(@Param("resourceId") String resourceId);
|
||||
|
||||
/**
|
||||
* @description 根据任务ID和资源ID查询关联信息
|
||||
* @param taskId 任务ID
|
||||
* @param resourceId 资源ID
|
||||
* @return TbTaskResource 关联信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbTaskResource selectByTaskIdAndResourceId(@Param("taskId") String taskId, @Param("resourceId") String resourceId);
|
||||
|
||||
/**
|
||||
* @description 检查任务资源关联是否存在
|
||||
* @param taskId 任务ID
|
||||
* @param resourceId 资源ID
|
||||
* @param excludeId 排除的关联ID(用于更新时排除自身)
|
||||
* @return int 存在的数量
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int countByTaskIdAndResourceId(@Param("taskId") String taskId, @Param("resourceId") String resourceId, @Param("excludeId") String excludeId);
|
||||
|
||||
/**
|
||||
* @description 插入任务资源关联
|
||||
* @param taskResource 任务资源关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int insertTaskResource(TbTaskResource taskResource);
|
||||
|
||||
/**
|
||||
* @description 更新任务资源关联
|
||||
* @param taskResource 任务资源关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int updateTaskResource(TbTaskResource taskResource);
|
||||
|
||||
/**
|
||||
* @description 删除任务资源关联
|
||||
* @param taskResource 任务资源关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteTaskResource(TbTaskResource taskResource);
|
||||
|
||||
/**
|
||||
* @description 批量插入任务资源关联
|
||||
* @param taskResourceList 任务资源关联列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchInsertTaskResources(@Param("taskResourceList") List<TbTaskResource> taskResourceList);
|
||||
|
||||
/**
|
||||
* @description 批量删除任务资源关联
|
||||
* @param ids 关联ID列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchDeleteTaskResources(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* @description 根据任务ID批量删除资源关联
|
||||
* @param taskId 任务ID
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteByTaskId(@Param("taskId") String taskId);
|
||||
|
||||
/**
|
||||
* @description 根据资源ID批量删除任务关联
|
||||
* @param resourceId 资源ID
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteByResourceId(@Param("resourceId") String resourceId);
|
||||
|
||||
/**
|
||||
* @description 分页查询任务资源关联
|
||||
* @param filter 过滤条件
|
||||
* @param pageParam 分页参数
|
||||
* @return List<TbTaskResource> 任务资源关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskResource> selectTaskResourcesPage(@Param("filter") TbTaskResource filter, @Param("pageParam") PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 统计任务资源关联总数
|
||||
* @param filter 过滤条件
|
||||
* @return long 总数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
long countTaskResources(@Param("filter") TbTaskResource filter);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
import org.xyzh.common.dto.study.TbTaskUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 任务用户数据访问层
|
||||
* @description TaskUserMapper.java文件描述 任务用户数据访问层
|
||||
* @filename TaskUserMapper.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
@@ -24,4 +26,153 @@ public interface TaskUserMapper extends BaseMapper<TbTaskUser> {
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskUser> selectTaskUsers(TbTaskUser filter);
|
||||
|
||||
/**
|
||||
* @description 根据关联ID查询关联信息
|
||||
* @param relationId 关联ID
|
||||
* @return TbTaskUser 关联信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbTaskUser selectByRelationId(@Param("relationId") String relationId);
|
||||
|
||||
/**
|
||||
* @description 根据任务ID查询用户关联列表
|
||||
* @param taskId 任务ID
|
||||
* @return List<TbTaskUser> 用户关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskUser> selectByTaskId(@Param("taskId") String taskId);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID查询任务关联列表
|
||||
* @param userId 用户ID
|
||||
* @return List<TbTaskUser> 任务关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskUser> selectByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @description 根据任务ID和用户ID查询关联信息
|
||||
* @param taskId 任务ID
|
||||
* @param userId 用户ID
|
||||
* @return TbTaskUser 关联信息
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
TbTaskUser selectByTaskIdAndUserId(@Param("taskId") String taskId, @Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @description 根据状态查询任务用户关联列表
|
||||
* @param status 状态
|
||||
* @return List<TbTaskUser> 任务用户关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskUser> selectByStatus(@Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID和状态查询任务关联列表
|
||||
* @param userId 用户ID
|
||||
* @param status 状态
|
||||
* @return List<TbTaskUser> 任务关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskUser> selectByUserIdAndStatus(@Param("userId") String userId, @Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* @description 检查任务用户关联是否存在
|
||||
* @param taskId 任务ID
|
||||
* @param userId 用户ID
|
||||
* @param excludeId 排除的关联ID(用于更新时排除自身)
|
||||
* @return int 存在的数量
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int countByTaskIdAndUserId(@Param("taskId") String taskId, @Param("userId") String userId, @Param("excludeId") String excludeId);
|
||||
|
||||
/**
|
||||
* @description 插入任务用户关联
|
||||
* @param taskUser 任务用户关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int insertTaskUser(TbTaskUser taskUser);
|
||||
|
||||
/**
|
||||
* @description 更新任务用户关联
|
||||
* @param taskUser 任务用户关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int updateTaskUser(TbTaskUser taskUser);
|
||||
|
||||
/**
|
||||
* @description 删除任务用户关联
|
||||
* @param taskUser 任务用户关联
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteTaskUser(TbTaskUser taskUser);
|
||||
|
||||
/**
|
||||
* @description 批量插入任务用户关联
|
||||
* @param taskUserList 任务用户关联列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchInsertTaskUsers(@Param("taskUserList") List<TbTaskUser> taskUserList);
|
||||
|
||||
/**
|
||||
* @description 批量删除任务用户关联
|
||||
* @param ids 关联ID列表
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int batchDeleteTaskUsers(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* @description 根据任务ID批量删除用户关联
|
||||
* @param taskId 任务ID
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteByTaskId(@Param("taskId") String taskId);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID批量删除任务关联
|
||||
* @param userId 用户ID
|
||||
* @return int 影响行数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
int deleteByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @description 分页查询任务用户关联
|
||||
* @param filter 过滤条件
|
||||
* @param pageParam 分页参数
|
||||
* @return List<TbTaskUser> 任务用户关联列表
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskUser> selectTaskUsersPage(@Param("filter") TbTaskUser filter, @Param("pageParam") PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 统计任务用户关联总数
|
||||
* @param filter 过滤条件
|
||||
* @return long 总数
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
long countTaskUsers(@Param("filter") TbTaskUser filter);
|
||||
}
|
||||
|
||||
@@ -47,4 +47,159 @@
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 根据章节ID查询章节信息 -->
|
||||
<select id="selectByChapterId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_chapter
|
||||
WHERE id = #{chapterId} AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据课程ID查询章节列表 -->
|
||||
<select id="selectByCourseId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_chapter
|
||||
WHERE course_id = #{courseId} AND deleted = 0
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 根据章节名称查询章节 -->
|
||||
<select id="selectByName" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_chapter
|
||||
WHERE name = #{name} AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据状态查询章节列表 -->
|
||||
<select id="selectByStatus" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_chapter
|
||||
WHERE deleted = 0
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 根据课程ID和排序查询章节列表 -->
|
||||
<select id="selectByCourseIdOrderBySort" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_chapter
|
||||
WHERE course_id = #{courseId} AND deleted = 0
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 检查章节名称是否存在 -->
|
||||
<select id="countByName" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_course_chapter
|
||||
WHERE name = #{name} AND deleted = 0
|
||||
<if test="excludeId != null and excludeId != ''">
|
||||
AND id != #{excludeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 插入课程章节 -->
|
||||
<insert id="insertCourseChapter" parameterType="org.xyzh.common.dto.study.TbCourseChapter">
|
||||
INSERT INTO tb_course_chapter (
|
||||
id, course_id, name, content, video_url, duration, order_num,
|
||||
creator, updater, create_time, update_time, delete_time, deleted
|
||||
) VALUES (
|
||||
#{id}, #{courseID}, #{name}, #{content}, #{videoUrl}, #{duration}, #{orderNum},
|
||||
#{creator}, #{updater}, #{createTime}, #{updateTime}, #{deleteTime}, #{deleted}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新课程章节 -->
|
||||
<update id="updateCourseChapter" parameterType="org.xyzh.common.dto.study.TbCourseChapter">
|
||||
UPDATE tb_course_chapter
|
||||
<set>
|
||||
<if test="courseID != null and courseID != ''">
|
||||
course_id = #{courseID},
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="content != null and content != ''">
|
||||
content = #{content},
|
||||
</if>
|
||||
<if test="videoUrl != null and videoUrl != ''">
|
||||
video_url = #{videoUrl},
|
||||
</if>
|
||||
<if test="duration != null">
|
||||
duration = #{duration},
|
||||
</if>
|
||||
<if test="orderNum != null">
|
||||
order_num = #{orderNum},
|
||||
</if>
|
||||
<if test="updater != null and updater != ''">
|
||||
updater = #{updater},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="deleteTime != null">
|
||||
delete_time = #{deleteTime},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除课程章节 -->
|
||||
<delete id="deleteCourseChapter" parameterType="org.xyzh.common.dto.study.TbCourseChapter">
|
||||
DELETE FROM tb_course_chapter
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量插入课程章节 -->
|
||||
<insert id="batchInsertCourseChapters" parameterType="java.util.List">
|
||||
INSERT INTO tb_course_chapter (
|
||||
id, course_id, name, content, video_url, duration, order_num,
|
||||
creator, updater, create_time, update_time, delete_time, deleted
|
||||
) VALUES
|
||||
<foreach collection="courseChapterList" item="item" separator=",">
|
||||
(
|
||||
#{item.id}, #{item.courseID}, #{item.name}, #{item.content}, #{item.videoUrl},
|
||||
#{item.duration}, #{item.orderNum}, #{item.creator}, #{item.updater},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除课程章节 -->
|
||||
<delete id="batchDeleteCourseChapters">
|
||||
DELETE FROM tb_course_chapter
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 根据课程ID批量删除章节 -->
|
||||
<delete id="deleteByCourseId">
|
||||
DELETE FROM tb_course_chapter
|
||||
WHERE course_id = #{courseId}
|
||||
</delete>
|
||||
|
||||
<!-- 分页查询课程章节 -->
|
||||
<select id="selectCourseChaptersPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_chapter
|
||||
<include refid="Where_Clause" />
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.pageNumber}
|
||||
</select>
|
||||
|
||||
<!-- 统计课程章节总数 -->
|
||||
<select id="countCourseChapters" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_course_chapter
|
||||
<include refid="Where_Clause" />
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -59,4 +59,209 @@
|
||||
ORDER BY order_num ASC, create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据课程ID查询课程信息 -->
|
||||
<select id="selectByCourseId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course
|
||||
WHERE course_id = #{courseId} AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据课程名称查询课程 -->
|
||||
<select id="selectByName" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course
|
||||
WHERE name = #{name} AND 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>
|
||||
|
||||
<!-- 根据类型查询课程列表 -->
|
||||
<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>
|
||||
|
||||
<!-- 根据难度查询课程列表 -->
|
||||
<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>
|
||||
|
||||
<!-- 查询热门课程列表 -->
|
||||
<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
|
||||
<if test="limit != null and limit > 0">
|
||||
LIMIT #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询最新课程列表 -->
|
||||
<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
|
||||
<if test="limit != null and limit > 0">
|
||||
LIMIT #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 根据关键词搜索课程 -->
|
||||
<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>
|
||||
|
||||
<!-- 检查课程名称是否存在 -->
|
||||
<select id="countByName" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_course
|
||||
WHERE name = #{name} AND deleted = 0
|
||||
<if test="excludeId != null and excludeId != ''">
|
||||
AND id != #{excludeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 插入课程 -->
|
||||
<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, updater,
|
||||
create_time, update_time, delete_time, deleted
|
||||
) VALUES (
|
||||
#{id}, #{courseID}, #{name}, #{coverImage}, #{description}, #{content}, #{duration},
|
||||
#{teacher}, #{status}, #{viewCount}, #{learnCount}, #{orderNum}, #{creator}, #{updater},
|
||||
#{createTime}, #{updateTime}, #{deleteTime}, #{deleted}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新课程 -->
|
||||
<update id="updateCourse" parameterType="org.xyzh.common.dto.study.TbCourse">
|
||||
UPDATE tb_course
|
||||
<set>
|
||||
<if test="courseID != null and courseID != ''">
|
||||
course_id = #{courseID},
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="coverImage != null and coverImage != ''">
|
||||
cover_image = #{coverImage},
|
||||
</if>
|
||||
<if test="description != null and description != ''">
|
||||
description = #{description},
|
||||
</if>
|
||||
<if test="content != null and content != ''">
|
||||
content = #{content},
|
||||
</if>
|
||||
<if test="duration != null">
|
||||
duration = #{duration},
|
||||
</if>
|
||||
<if test="teacher != null and teacher != ''">
|
||||
teacher = #{teacher},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="viewCount != null">
|
||||
view_count = #{viewCount},
|
||||
</if>
|
||||
<if test="learnCount != null">
|
||||
learn_count = #{learnCount},
|
||||
</if>
|
||||
<if test="orderNum != null">
|
||||
order_num = #{orderNum},
|
||||
</if>
|
||||
<if test="updater != null and updater != ''">
|
||||
updater = #{updater},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="deleteTime != null">
|
||||
delete_time = #{deleteTime},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除课程 -->
|
||||
<delete id="deleteCourse" parameterType="org.xyzh.common.dto.study.TbCourse">
|
||||
DELETE FROM tb_course
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量插入课程 -->
|
||||
<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, updater,
|
||||
create_time, update_time, delete_time, deleted
|
||||
) 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}, #{item.viewCount},
|
||||
#{item.learnCount}, #{item.orderNum}, #{item.creator}, #{item.updater},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除课程 -->
|
||||
<delete id="batchDeleteCourses">
|
||||
DELETE FROM tb_course
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 分页查询课程 -->
|
||||
<select id="selectCoursesPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course
|
||||
<include refid="Where_Clause" />
|
||||
ORDER BY order_num ASC, create_time DESC
|
||||
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.pageNumber}
|
||||
</select>
|
||||
|
||||
<!-- 统计课程总数 -->
|
||||
<select id="countCourses" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_course
|
||||
<include refid="Where_Clause" />
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -37,4 +37,133 @@
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据关联ID查询关联信息 -->
|
||||
<select id="selectByRelationId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_tag
|
||||
WHERE id = #{relationId}
|
||||
</select>
|
||||
|
||||
<!-- 根据课程ID查询标签关联列表 -->
|
||||
<select id="selectByCourseId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_tag
|
||||
WHERE course_id = #{courseId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据标签ID查询课程关联列表 -->
|
||||
<select id="selectByTagId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_tag
|
||||
WHERE tag_id = #{tagId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据课程ID和标签ID查询关联信息 -->
|
||||
<select id="selectByCourseIdAndTagId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_tag
|
||||
WHERE course_id = #{courseId} AND tag_id = #{tagId}
|
||||
</select>
|
||||
|
||||
<!-- 检查课程标签关联是否存在 -->
|
||||
<select id="countByCourseIdAndTagId" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_course_tag
|
||||
WHERE course_id = #{courseId} AND tag_id = #{tagId}
|
||||
<if test="excludeId != null and excludeId != ''">
|
||||
AND id != #{excludeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 插入课程标签关联 -->
|
||||
<insert id="insertCourseTag" parameterType="org.xyzh.common.dto.study.TbCourseTag">
|
||||
INSERT INTO tb_course_tag (
|
||||
id, course_id, tag_id, creator, create_time
|
||||
) VALUES (
|
||||
#{id}, #{courseID}, #{tagID}, #{creator}, #{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新课程标签关联 -->
|
||||
<update id="updateCourseTag" parameterType="org.xyzh.common.dto.study.TbCourseTag">
|
||||
UPDATE tb_course_tag
|
||||
<set>
|
||||
<if test="courseID != null and courseID != ''">
|
||||
course_id = #{courseID},
|
||||
</if>
|
||||
<if test="tagID != null and tagID != ''">
|
||||
tag_id = #{tagID},
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
creator = #{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除课程标签关联 -->
|
||||
<delete id="deleteCourseTag" parameterType="org.xyzh.common.dto.study.TbCourseTag">
|
||||
DELETE FROM tb_course_tag
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量插入课程标签关联 -->
|
||||
<insert id="batchInsertCourseTags" parameterType="java.util.List">
|
||||
INSERT INTO tb_course_tag (
|
||||
id, course_id, tag_id, creator, create_time
|
||||
) VALUES
|
||||
<foreach collection="courseTagList" item="item" separator=",">
|
||||
(
|
||||
#{item.id}, #{item.courseID}, #{item.tagID}, #{item.creator}, #{item.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除课程标签关联 -->
|
||||
<delete id="batchDeleteCourseTags">
|
||||
DELETE FROM tb_course_tag
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 根据课程ID批量删除标签关联 -->
|
||||
<delete id="deleteByCourseId">
|
||||
DELETE FROM tb_course_tag
|
||||
WHERE course_id = #{courseId}
|
||||
</delete>
|
||||
|
||||
<!-- 根据标签ID批量删除课程关联 -->
|
||||
<delete id="deleteByTagId">
|
||||
DELETE FROM tb_course_tag
|
||||
WHERE tag_id = #{tagId}
|
||||
</delete>
|
||||
|
||||
<!-- 分页查询课程标签关联 -->
|
||||
<select id="selectCourseTagsPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_course_tag
|
||||
<include refid="Where_Clause" />
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.pageNumber}
|
||||
</select>
|
||||
|
||||
<!-- 统计课程标签关联总数 -->
|
||||
<select id="countCourseTags" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_course_tag
|
||||
<include refid="Where_Clause" />
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -54,4 +54,156 @@
|
||||
ORDER BY last_learn_time DESC, create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据记录ID查询记录信息 -->
|
||||
<select id="selectByRecordId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_record
|
||||
WHERE id = #{recordId}
|
||||
</select>
|
||||
|
||||
<!-- 根据用户ID查询学习记录列表 -->
|
||||
<select id="selectByUserId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_record
|
||||
WHERE user_id = #{userId}
|
||||
ORDER BY last_learn_time DESC, create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据课程ID查询学习记录列表 -->
|
||||
<select id="selectByCourseId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_record
|
||||
WHERE resource_id = #{courseId}
|
||||
ORDER BY last_learn_time DESC, create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据用户ID和课程ID查询学习记录 -->
|
||||
<select id="selectByUserIdAndCourseId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_record
|
||||
WHERE user_id = #{userId} AND resource_id = #{courseId}
|
||||
</select>
|
||||
|
||||
<!-- 根据状态查询学习记录列表 -->
|
||||
<select id="selectByStatus" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_record
|
||||
WHERE is_complete = #{status}
|
||||
ORDER BY last_learn_time DESC, create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询用户学习统计信息 -->
|
||||
<select id="selectLearningStatistics" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
user_id,
|
||||
COUNT(*) as total_records,
|
||||
SUM(duration) as total_duration,
|
||||
AVG(progress) as avg_progress,
|
||||
COUNT(CASE WHEN is_complete = 1 THEN 1 END) as completed_count
|
||||
FROM tb_learning_record
|
||||
WHERE user_id = #{userId}
|
||||
GROUP BY user_id
|
||||
</select>
|
||||
|
||||
<!-- 插入学习记录 -->
|
||||
<insert id="insertLearningRecord" parameterType="org.xyzh.common.dto.study.TbLearningRecord">
|
||||
INSERT INTO tb_learning_record (
|
||||
id, user_id, resource_type, resource_id, task_id, duration, progress,
|
||||
is_complete, complete_time, last_learn_time, create_time, update_time
|
||||
) VALUES (
|
||||
#{id}, #{userID}, #{resourceType}, #{resourceID}, #{taskID}, #{duration}, #{progress},
|
||||
#{isComplete}, #{completeTime}, #{lastLearnTime}, #{createTime}, #{updateTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新学习记录 -->
|
||||
<update id="updateLearningRecord" parameterType="org.xyzh.common.dto.study.TbLearningRecord">
|
||||
UPDATE tb_learning_record
|
||||
<set>
|
||||
<if test="userID != null and userID != ''">
|
||||
user_id = #{userID},
|
||||
</if>
|
||||
<if test="resourceType != null">
|
||||
resource_type = #{resourceType},
|
||||
</if>
|
||||
<if test="resourceID != null and resourceID != ''">
|
||||
resource_id = #{resourceID},
|
||||
</if>
|
||||
<if test="taskID != null and taskID != ''">
|
||||
task_id = #{taskID},
|
||||
</if>
|
||||
<if test="duration != null">
|
||||
duration = #{duration},
|
||||
</if>
|
||||
<if test="progress != null">
|
||||
progress = #{progress},
|
||||
</if>
|
||||
<if test="isComplete != null">
|
||||
is_complete = #{isComplete},
|
||||
</if>
|
||||
<if test="completeTime != null">
|
||||
complete_time = #{completeTime},
|
||||
</if>
|
||||
<if test="lastLearnTime != null">
|
||||
last_learn_time = #{lastLearnTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除学习记录 -->
|
||||
<delete id="deleteLearningRecord" parameterType="org.xyzh.common.dto.study.TbLearningRecord">
|
||||
DELETE FROM tb_learning_record
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量插入学习记录 -->
|
||||
<insert id="batchInsertLearningRecords" parameterType="java.util.List">
|
||||
INSERT INTO tb_learning_record (
|
||||
id, user_id, resource_type, resource_id, task_id, duration, progress,
|
||||
is_complete, complete_time, last_learn_time, create_time, update_time
|
||||
) VALUES
|
||||
<foreach collection="learningRecordList" item="item" separator=",">
|
||||
(
|
||||
#{item.id}, #{item.userID}, #{item.resourceType}, #{item.resourceID}, #{item.taskID},
|
||||
#{item.duration}, #{item.progress}, #{item.isComplete}, #{item.completeTime},
|
||||
#{item.lastLearnTime}, #{item.createTime}, #{item.updateTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除学习记录 -->
|
||||
<delete id="batchDeleteLearningRecords">
|
||||
DELETE FROM tb_learning_record
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 分页查询学习记录 -->
|
||||
<select id="selectLearningRecordsPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_record
|
||||
<include refid="Where_Clause" />
|
||||
ORDER BY last_learn_time DESC, create_time DESC
|
||||
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.pageNumber}
|
||||
</select>
|
||||
|
||||
<!-- 统计学习记录总数 -->
|
||||
<select id="countLearningRecords" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_learning_record
|
||||
<include refid="Where_Clause" />
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -42,4 +42,144 @@
|
||||
ORDER BY stat_date DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据统计ID查询统计信息 -->
|
||||
<select id="selectByStatisticsId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_statistics
|
||||
WHERE id = #{statisticsId}
|
||||
</select>
|
||||
|
||||
<!-- 根据用户ID查询学习统计 -->
|
||||
<select id="selectByUserId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_statistics
|
||||
WHERE user_id = #{userId}
|
||||
ORDER BY stat_date DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据课程ID查询学习统计列表 -->
|
||||
<select id="selectByCourseId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_statistics
|
||||
ORDER BY stat_date DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据用户ID和课程ID查询学习统计 -->
|
||||
<select id="selectByUserIdAndCourseId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_statistics
|
||||
WHERE user_id = #{userId}
|
||||
ORDER BY stat_date DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据统计类型查询学习统计列表 -->
|
||||
<select id="selectByType" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_statistics
|
||||
ORDER BY stat_date DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询用户学习排行榜 -->
|
||||
<select id="selectLearningRanking" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_statistics
|
||||
ORDER BY total_duration DESC, complete_count DESC, stat_date DESC
|
||||
<if test="limit != null and limit > 0">
|
||||
LIMIT #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 插入学习统计 -->
|
||||
<insert id="insertLearningStatistics" parameterType="org.xyzh.common.dto.study.TbLearningStatistics">
|
||||
INSERT INTO tb_learning_statistics (
|
||||
id, user_id, stat_date, total_duration, resource_count, course_count,
|
||||
complete_count, create_time, update_time
|
||||
) VALUES (
|
||||
#{id}, #{userID}, #{statDate}, #{totalDuration}, #{resourceCount}, #{courseCount},
|
||||
#{completeCount}, #{createTime}, #{updateTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新学习统计 -->
|
||||
<update id="updateLearningStatistics" parameterType="org.xyzh.common.dto.study.TbLearningStatistics">
|
||||
UPDATE tb_learning_statistics
|
||||
<set>
|
||||
<if test="userID != null and userID != ''">
|
||||
user_id = #{userID},
|
||||
</if>
|
||||
<if test="statDate != null">
|
||||
stat_date = #{statDate},
|
||||
</if>
|
||||
<if test="totalDuration != null">
|
||||
total_duration = #{totalDuration},
|
||||
</if>
|
||||
<if test="resourceCount != null">
|
||||
resource_count = #{resourceCount},
|
||||
</if>
|
||||
<if test="courseCount != null">
|
||||
course_count = #{courseCount},
|
||||
</if>
|
||||
<if test="completeCount != null">
|
||||
complete_count = #{completeCount},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除学习统计 -->
|
||||
<delete id="deleteLearningStatistics" parameterType="org.xyzh.common.dto.study.TbLearningStatistics">
|
||||
DELETE FROM tb_learning_statistics
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量插入学习统计 -->
|
||||
<insert id="batchInsertLearningStatistics" parameterType="java.util.List">
|
||||
INSERT INTO tb_learning_statistics (
|
||||
id, user_id, stat_date, total_duration, resource_count, course_count,
|
||||
complete_count, create_time, update_time
|
||||
) VALUES
|
||||
<foreach collection="learningStatisticsList" item="item" separator=",">
|
||||
(
|
||||
#{item.id}, #{item.userID}, #{item.statDate}, #{item.totalDuration},
|
||||
#{item.resourceCount}, #{item.courseCount}, #{item.completeCount},
|
||||
#{item.createTime}, #{item.updateTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除学习统计 -->
|
||||
<delete id="batchDeleteLearningStatistics">
|
||||
DELETE FROM tb_learning_statistics
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 分页查询学习统计 -->
|
||||
<select id="selectLearningStatisticsPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_statistics
|
||||
<include refid="Where_Clause" />
|
||||
ORDER BY stat_date DESC
|
||||
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.pageNumber}
|
||||
</select>
|
||||
|
||||
<!-- 统计学习统计总数 -->
|
||||
<select id="countLearningStatistics" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_learning_statistics
|
||||
<include refid="Where_Clause" />
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -50,4 +50,171 @@
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据任务ID查询任务信息 -->
|
||||
<select id="selectByTaskId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE task_id = #{taskId} AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据用户ID查询学习任务列表 -->
|
||||
<select id="selectByUserId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE deleted = 0
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据任务名称查询任务 -->
|
||||
<select id="selectByName" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE name = #{name} AND 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>
|
||||
|
||||
<!-- 根据优先级查询学习任务列表 -->
|
||||
<select id="selectByPriority" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE deleted = 0
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询用户待完成任务列表 -->
|
||||
<select id="selectPendingTasksByUserId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE status = 0 AND deleted = 0
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询用户已完成任务列表 -->
|
||||
<select id="selectCompletedTasksByUserId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
WHERE status = 1 AND deleted = 0
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 检查任务名称是否存在 -->
|
||||
<select id="countByName" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_learning_task
|
||||
WHERE name = #{name} AND deleted = 0
|
||||
<if test="excludeId != null and excludeId != ''">
|
||||
AND id != #{excludeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 插入学习任务 -->
|
||||
<insert id="insertLearningTask" parameterType="org.xyzh.common.dto.study.TbLearningTask">
|
||||
INSERT INTO tb_learning_task (
|
||||
id, task_id, name, description, start_time, end_time, status,
|
||||
creator, updater, create_time, update_time, delete_time, deleted
|
||||
) VALUES (
|
||||
#{id}, #{taskID}, #{name}, #{description}, #{startTime}, #{endTime}, #{status},
|
||||
#{creator}, #{updater}, #{createTime}, #{updateTime}, #{deleteTime}, #{deleted}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新学习任务 -->
|
||||
<update id="updateLearningTask" parameterType="org.xyzh.common.dto.study.TbLearningTask">
|
||||
UPDATE tb_learning_task
|
||||
<set>
|
||||
<if test="taskID != null and taskID != ''">
|
||||
task_id = #{taskID},
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="description != null and description != ''">
|
||||
description = #{description},
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
start_time = #{startTime},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time = #{endTime},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="updater != null and updater != ''">
|
||||
updater = #{updater},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="deleteTime != null">
|
||||
delete_time = #{deleteTime},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除学习任务 -->
|
||||
<delete id="deleteLearningTask" parameterType="org.xyzh.common.dto.study.TbLearningTask">
|
||||
DELETE FROM tb_learning_task
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量插入学习任务 -->
|
||||
<insert id="batchInsertLearningTasks" parameterType="java.util.List">
|
||||
INSERT INTO tb_learning_task (
|
||||
id, task_id, name, description, start_time, end_time, status,
|
||||
creator, updater, create_time, update_time, delete_time, deleted
|
||||
) VALUES
|
||||
<foreach collection="learningTaskList" item="item" separator=",">
|
||||
(
|
||||
#{item.id}, #{item.taskID}, #{item.name}, #{item.description}, #{item.startTime},
|
||||
#{item.endTime}, #{item.status}, #{item.creator}, #{item.updater},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.deleteTime}, #{item.deleted}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除学习任务 -->
|
||||
<delete id="batchDeleteLearningTasks">
|
||||
DELETE FROM tb_learning_task
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 分页查询学习任务 -->
|
||||
<select id="selectLearningTasksPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_learning_task
|
||||
<include refid="Where_Clause" />
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.pageNumber}
|
||||
</select>
|
||||
|
||||
<!-- 统计学习任务总数 -->
|
||||
<select id="countLearningTasks" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_learning_task
|
||||
<include refid="Where_Clause" />
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -42,4 +42,140 @@
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 根据关联ID查询关联信息 -->
|
||||
<select id="selectByRelationId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_course
|
||||
WHERE id = #{relationId}
|
||||
</select>
|
||||
|
||||
<!-- 根据任务ID查询课程关联列表 -->
|
||||
<select id="selectByTaskId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_course
|
||||
WHERE task_id = #{taskId}
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 根据课程ID查询任务关联列表 -->
|
||||
<select id="selectByCourseId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_course
|
||||
WHERE course_id = #{courseId}
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 根据任务ID和课程ID查询关联信息 -->
|
||||
<select id="selectByTaskIdAndCourseId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_course
|
||||
WHERE task_id = #{taskId} AND course_id = #{courseId}
|
||||
</select>
|
||||
|
||||
<!-- 检查任务课程关联是否存在 -->
|
||||
<select id="countByTaskIdAndCourseId" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_task_course
|
||||
WHERE task_id = #{taskId} AND course_id = #{courseId}
|
||||
<if test="excludeId != null and excludeId != ''">
|
||||
AND id != #{excludeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 插入任务课程关联 -->
|
||||
<insert id="insertTaskCourse" parameterType="org.xyzh.common.dto.study.TbTaskCourse">
|
||||
INSERT INTO tb_task_course (
|
||||
id, task_id, course_id, required, order_num, creator, create_time
|
||||
) VALUES (
|
||||
#{id}, #{taskID}, #{courseID}, #{required}, #{orderNum}, #{creator}, #{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新任务课程关联 -->
|
||||
<update id="updateTaskCourse" parameterType="org.xyzh.common.dto.study.TbTaskCourse">
|
||||
UPDATE tb_task_course
|
||||
<set>
|
||||
<if test="taskID != null and taskID != ''">
|
||||
task_id = #{taskID},
|
||||
</if>
|
||||
<if test="courseID != null and courseID != ''">
|
||||
course_id = #{courseID},
|
||||
</if>
|
||||
<if test="required != null">
|
||||
required = #{required},
|
||||
</if>
|
||||
<if test="orderNum != null">
|
||||
order_num = #{orderNum},
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
creator = #{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除任务课程关联 -->
|
||||
<delete id="deleteTaskCourse" parameterType="org.xyzh.common.dto.study.TbTaskCourse">
|
||||
DELETE FROM tb_task_course
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量插入任务课程关联 -->
|
||||
<insert id="batchInsertTaskCourses" parameterType="java.util.List">
|
||||
INSERT INTO tb_task_course (
|
||||
id, task_id, course_id, required, order_num, creator, create_time
|
||||
) VALUES
|
||||
<foreach collection="taskCourseList" item="item" separator=",">
|
||||
(
|
||||
#{item.id}, #{item.taskID}, #{item.courseID}, #{item.required},
|
||||
#{item.orderNum}, #{item.creator}, #{item.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除任务课程关联 -->
|
||||
<delete id="batchDeleteTaskCourses">
|
||||
DELETE FROM tb_task_course
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 根据任务ID批量删除课程关联 -->
|
||||
<delete id="deleteByTaskId">
|
||||
DELETE FROM tb_task_course
|
||||
WHERE task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<!-- 根据课程ID批量删除任务关联 -->
|
||||
<delete id="deleteByCourseId">
|
||||
DELETE FROM tb_task_course
|
||||
WHERE course_id = #{courseId}
|
||||
</delete>
|
||||
|
||||
<!-- 分页查询任务课程关联 -->
|
||||
<select id="selectTaskCoursesPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_course
|
||||
<include refid="Where_Clause" />
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.pageNumber}
|
||||
</select>
|
||||
|
||||
<!-- 统计任务课程关联总数 -->
|
||||
<select id="countTaskCourses" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_task_course
|
||||
<include refid="Where_Clause" />
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -42,4 +42,140 @@
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 根据关联ID查询关联信息 -->
|
||||
<select id="selectByRelationId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_resource
|
||||
WHERE id = #{relationId}
|
||||
</select>
|
||||
|
||||
<!-- 根据任务ID查询资源关联列表 -->
|
||||
<select id="selectByTaskId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_resource
|
||||
WHERE task_id = #{taskId}
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 根据资源ID查询任务关联列表 -->
|
||||
<select id="selectByResourceId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_resource
|
||||
WHERE resource_id = #{resourceId}
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<!-- 根据任务ID和资源ID查询关联信息 -->
|
||||
<select id="selectByTaskIdAndResourceId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_resource
|
||||
WHERE task_id = #{taskId} AND resource_id = #{resourceId}
|
||||
</select>
|
||||
|
||||
<!-- 检查任务资源关联是否存在 -->
|
||||
<select id="countByTaskIdAndResourceId" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_task_resource
|
||||
WHERE task_id = #{taskId} AND resource_id = #{resourceId}
|
||||
<if test="excludeId != null and excludeId != ''">
|
||||
AND id != #{excludeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 插入任务资源关联 -->
|
||||
<insert id="insertTaskResource" parameterType="org.xyzh.common.dto.study.TbTaskResource">
|
||||
INSERT INTO tb_task_resource (
|
||||
id, task_id, resource_id, required, order_num, creator, create_time
|
||||
) VALUES (
|
||||
#{id}, #{taskID}, #{resourceID}, #{required}, #{orderNum}, #{creator}, #{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新任务资源关联 -->
|
||||
<update id="updateTaskResource" parameterType="org.xyzh.common.dto.study.TbTaskResource">
|
||||
UPDATE tb_task_resource
|
||||
<set>
|
||||
<if test="taskID != null and taskID != ''">
|
||||
task_id = #{taskID},
|
||||
</if>
|
||||
<if test="resourceID != null and resourceID != ''">
|
||||
resource_id = #{resourceID},
|
||||
</if>
|
||||
<if test="required != null">
|
||||
required = #{required},
|
||||
</if>
|
||||
<if test="orderNum != null">
|
||||
order_num = #{orderNum},
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
creator = #{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除任务资源关联 -->
|
||||
<delete id="deleteTaskResource" parameterType="org.xyzh.common.dto.study.TbTaskResource">
|
||||
DELETE FROM tb_task_resource
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量插入任务资源关联 -->
|
||||
<insert id="batchInsertTaskResources" parameterType="java.util.List">
|
||||
INSERT INTO tb_task_resource (
|
||||
id, task_id, resource_id, required, order_num, creator, create_time
|
||||
) VALUES
|
||||
<foreach collection="taskResourceList" item="item" separator=",">
|
||||
(
|
||||
#{item.id}, #{item.taskID}, #{item.resourceID}, #{item.required},
|
||||
#{item.orderNum}, #{item.creator}, #{item.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除任务资源关联 -->
|
||||
<delete id="batchDeleteTaskResources">
|
||||
DELETE FROM tb_task_resource
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 根据任务ID批量删除资源关联 -->
|
||||
<delete id="deleteByTaskId">
|
||||
DELETE FROM tb_task_resource
|
||||
WHERE task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<!-- 根据资源ID批量删除任务关联 -->
|
||||
<delete id="deleteByResourceId">
|
||||
DELETE FROM tb_task_resource
|
||||
WHERE resource_id = #{resourceId}
|
||||
</delete>
|
||||
|
||||
<!-- 分页查询任务资源关联 -->
|
||||
<select id="selectTaskResourcesPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_resource
|
||||
<include refid="Where_Clause" />
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.pageNumber}
|
||||
</select>
|
||||
|
||||
<!-- 统计任务资源关联总数 -->
|
||||
<select id="countTaskResources" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_task_resource
|
||||
<include refid="Where_Clause" />
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -49,4 +49,170 @@
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据关联ID查询关联信息 -->
|
||||
<select id="selectByRelationId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_user
|
||||
WHERE id = #{relationId}
|
||||
</select>
|
||||
|
||||
<!-- 根据任务ID查询用户关联列表 -->
|
||||
<select id="selectByTaskId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_user
|
||||
WHERE task_id = #{taskId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据用户ID查询任务关联列表 -->
|
||||
<select id="selectByUserId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_user
|
||||
WHERE user_id = #{userId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据任务ID和用户ID查询关联信息 -->
|
||||
<select id="selectByTaskIdAndUserId" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_user
|
||||
WHERE task_id = #{taskId} AND user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<!-- 根据状态查询任务用户关联列表 -->
|
||||
<select id="selectByStatus" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_user
|
||||
WHERE status = #{status}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 根据用户ID和状态查询任务关联列表 -->
|
||||
<select id="selectByUserIdAndStatus" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_user
|
||||
WHERE user_id = #{userId} AND status = #{status}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 检查任务用户关联是否存在 -->
|
||||
<select id="countByTaskIdAndUserId" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_task_user
|
||||
WHERE task_id = #{taskId} AND user_id = #{userId}
|
||||
<if test="excludeId != null and excludeId != ''">
|
||||
AND id != #{excludeId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 插入任务用户关联 -->
|
||||
<insert id="insertTaskUser" parameterType="org.xyzh.common.dto.study.TbTaskUser">
|
||||
INSERT INTO tb_task_user (
|
||||
id, task_id, user_id, dept_id, status, progress, complete_time,
|
||||
creator, create_time, update_time
|
||||
) VALUES (
|
||||
#{id}, #{taskID}, #{userID}, #{deptID}, #{status}, #{progress}, #{completeTime},
|
||||
#{creator}, #{createTime}, #{updateTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新任务用户关联 -->
|
||||
<update id="updateTaskUser" parameterType="org.xyzh.common.dto.study.TbTaskUser">
|
||||
UPDATE tb_task_user
|
||||
<set>
|
||||
<if test="taskID != null and taskID != ''">
|
||||
task_id = #{taskID},
|
||||
</if>
|
||||
<if test="userID != null and userID != ''">
|
||||
user_id = #{userID},
|
||||
</if>
|
||||
<if test="deptID != null and deptID != ''">
|
||||
dept_id = #{deptID},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="progress != null">
|
||||
progress = #{progress},
|
||||
</if>
|
||||
<if test="completeTime != null">
|
||||
complete_time = #{completeTime},
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
creator = #{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除任务用户关联 -->
|
||||
<delete id="deleteTaskUser" parameterType="org.xyzh.common.dto.study.TbTaskUser">
|
||||
DELETE FROM tb_task_user
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量插入任务用户关联 -->
|
||||
<insert id="batchInsertTaskUsers" parameterType="java.util.List">
|
||||
INSERT INTO tb_task_user (
|
||||
id, task_id, user_id, dept_id, status, progress, complete_time,
|
||||
creator, create_time, update_time
|
||||
) VALUES
|
||||
<foreach collection="taskUserList" item="item" separator=",">
|
||||
(
|
||||
#{item.id}, #{item.taskID}, #{item.userID}, #{item.deptID}, #{item.status},
|
||||
#{item.progress}, #{item.completeTime}, #{item.creator}, #{item.createTime}, #{item.updateTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除任务用户关联 -->
|
||||
<delete id="batchDeleteTaskUsers">
|
||||
DELETE FROM tb_task_user
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 根据任务ID批量删除用户关联 -->
|
||||
<delete id="deleteByTaskId">
|
||||
DELETE FROM tb_task_user
|
||||
WHERE task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<!-- 根据用户ID批量删除任务关联 -->
|
||||
<delete id="deleteByUserId">
|
||||
DELETE FROM tb_task_user
|
||||
WHERE user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
<!-- 分页查询任务用户关联 -->
|
||||
<select id="selectTaskUsersPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM tb_task_user
|
||||
<include refid="Where_Clause" />
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.pageNumber}
|
||||
</select>
|
||||
|
||||
<!-- 统计任务用户关联总数 -->
|
||||
<select id="countTaskUsers" resultType="long">
|
||||
SELECT COUNT(1)
|
||||
FROM tb_task_user
|
||||
<include refid="Where_Clause" />
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user