serv-初始mapper
This commit is contained in:
86
schoolNewsServ/study/pom.xml
Normal file
86
schoolNewsServ/study/pom.xml
Normal file
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.xyzh</groupId>
|
||||
<artifactId>school-news</artifactId>
|
||||
<version>${school-news.version}</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.xyzh</groupId>
|
||||
<artifactId>study</artifactId>
|
||||
<version>${school-news.version}</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>study</name>
|
||||
<description>学习管理模块</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.xyzh</groupId>
|
||||
<artifactId>api-study</artifactId>
|
||||
<version>${school-news.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.xyzh</groupId>
|
||||
<artifactId>common-all</artifactId>
|
||||
<version>${school-news.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 禁用 Spring Boot 插件,因为 study 是 admin 的一部分 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.study.TbCourseChapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 课程章节数据访问层
|
||||
* @filename CourseChapterMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface CourseChapterMapper extends BaseMapper<TbCourseChapter> {
|
||||
|
||||
/**
|
||||
* @description 查询课程章节列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbCourseChapter> 课程章节列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseChapter> selectCourseChapters(TbCourseChapter filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.study.TbCourse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 课程数据访问层
|
||||
* @filename CourseMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface CourseMapper extends BaseMapper<TbCourse> {
|
||||
|
||||
/**
|
||||
* @description 查询课程列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbCourse> 课程列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourse> selectCourses(TbCourse filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.study.TbCourseTag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 课程标签关联数据访问层
|
||||
* @filename CourseTagMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface CourseTagMapper extends BaseMapper<TbCourseTag> {
|
||||
|
||||
/**
|
||||
* @description 查询课程标签关联列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbCourseTag> 课程标签关联列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbCourseTag> selectCourseTags(TbCourseTag filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.study.TbLearningRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 学习记录数据访问层
|
||||
* @filename LearningRecordMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface LearningRecordMapper extends BaseMapper<TbLearningRecord> {
|
||||
|
||||
/**
|
||||
* @description 查询学习记录列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbLearningRecord> 学习记录列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningRecord> selectLearningRecords(TbLearningRecord filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.study.TbLearningStatistics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 学习统计数据访问层
|
||||
* @filename LearningStatisticsMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface LearningStatisticsMapper extends BaseMapper<TbLearningStatistics> {
|
||||
|
||||
/**
|
||||
* @description 查询学习统计列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbLearningStatistics> 学习统计列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningStatistics> selectLearningStatistics(TbLearningStatistics filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.study.TbLearningTask;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 学习任务数据访问层
|
||||
* @filename LearningTaskMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface LearningTaskMapper extends BaseMapper<TbLearningTask> {
|
||||
|
||||
/**
|
||||
* @description 查询学习任务列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbLearningTask> 学习任务列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbLearningTask> selectLearningTasks(TbLearningTask filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.study.TbTaskCourse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 任务课程关联数据访问层
|
||||
* @filename TaskCourseMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface TaskCourseMapper extends BaseMapper<TbTaskCourse> {
|
||||
|
||||
/**
|
||||
* @description 查询任务课程关联列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbTaskCourse> 任务课程关联列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskCourse> selectTaskCourses(TbTaskCourse filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.study.TbTaskResource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 任务资源关联数据访问层
|
||||
* @filename TaskResourceMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface TaskResourceMapper extends BaseMapper<TbTaskResource> {
|
||||
|
||||
/**
|
||||
* @description 查询任务资源关联列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbTaskResource> 任务资源关联列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskResource> selectTaskResources(TbTaskResource filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.study.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.study.TbTaskUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 任务用户数据访问层
|
||||
* @filename TaskUserMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface TaskUserMapper extends BaseMapper<TbTaskUser> {
|
||||
|
||||
/**
|
||||
* @description 查询任务用户列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbTaskUser> 任务用户列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbTaskUser> selectTaskUsers(TbTaskUser filter);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.study.mapper.CourseChapterMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.study.TbCourseChapter">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="course_id" property="courseID" jdbcType="VARCHAR"/>
|
||||
<result column="name" property="name" jdbcType="VARCHAR"/>
|
||||
<result column="content" property="content" jdbcType="LONGVARCHAR"/>
|
||||
<result column="video_url" property="videoUrl" jdbcType="VARCHAR"/>
|
||||
<result column="duration" property="duration" jdbcType="INTEGER"/>
|
||||
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="updater" property="updater" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, course_id, name, content, video_url, duration, order_num,
|
||||
creator, updater, create_time, update_time, delete_time, deleted
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="courseID != null and courseID != ''">
|
||||
AND course_id = #{courseID}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectCourseChapters -->
|
||||
<select id="selectCourseChapters" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_course_chapter
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.study.mapper.CourseMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.study.TbCourse">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="course_id" property="courseID" jdbcType="VARCHAR"/>
|
||||
<result column="name" property="name" jdbcType="VARCHAR"/>
|
||||
<result column="cover_image" property="coverImage" jdbcType="VARCHAR"/>
|
||||
<result column="description" property="description" jdbcType="LONGVARCHAR"/>
|
||||
<result column="content" property="content" jdbcType="LONGVARCHAR"/>
|
||||
<result column="duration" property="duration" jdbcType="INTEGER"/>
|
||||
<result column="teacher" property="teacher" jdbcType="VARCHAR"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="view_count" property="viewCount" jdbcType="INTEGER"/>
|
||||
<result column="learn_count" property="learnCount" jdbcType="INTEGER"/>
|
||||
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="updater" property="updater" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
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
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="courseID != null and courseID != ''">
|
||||
AND course_id = #{courseID}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="teacher != null and teacher != ''">
|
||||
AND teacher LIKE CONCAT('%', #{teacher}, '%')
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectCourses -->
|
||||
<select id="selectCourses" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_course
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY order_num ASC, create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.study.mapper.CourseTagMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.study.TbCourseTag">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="course_id" property="courseID" jdbcType="VARCHAR"/>
|
||||
<result column="tag_id" property="tagID" jdbcType="VARCHAR"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, course_id, tag_id, creator, create_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="courseID != null and courseID != ''">
|
||||
AND course_id = #{courseID}
|
||||
</if>
|
||||
<if test="tagID != null and tagID != ''">
|
||||
AND tag_id = #{tagID}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectCourseTags -->
|
||||
<select id="selectCourseTags" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_course_tag
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.study.mapper.LearningRecordMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.study.TbLearningRecord">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="resource_type" property="resourceType" jdbcType="INTEGER"/>
|
||||
<result column="resource_id" property="resourceID" jdbcType="VARCHAR"/>
|
||||
<result column="task_id" property="taskID" jdbcType="VARCHAR"/>
|
||||
<result column="duration" property="duration" jdbcType="INTEGER"/>
|
||||
<result column="progress" property="progress" jdbcType="DECIMAL"/>
|
||||
<result column="is_complete" property="isComplete" jdbcType="BOOLEAN"/>
|
||||
<result column="complete_time" property="completeTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="last_learn_time" property="lastLearnTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, resource_type, resource_id, task_id, duration, progress,
|
||||
is_complete, complete_time, last_learn_time, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="userID != null and userID != ''">
|
||||
AND user_id = #{userID}
|
||||
</if>
|
||||
<if test="resourceType != null">
|
||||
AND resource_type = #{resourceType}
|
||||
</if>
|
||||
<if test="resourceID != null and resourceID != ''">
|
||||
AND resource_id = #{resourceID}
|
||||
</if>
|
||||
<if test="taskID != null and taskID != ''">
|
||||
AND task_id = #{taskID}
|
||||
</if>
|
||||
<if test="isComplete != null">
|
||||
AND is_complete = #{isComplete}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectLearningRecords -->
|
||||
<select id="selectLearningRecords" 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
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.study.mapper.LearningStatisticsMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.study.TbLearningStatistics">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="stat_date" property="statDate" jdbcType="DATE"/>
|
||||
<result column="total_duration" property="totalDuration" jdbcType="INTEGER"/>
|
||||
<result column="resource_count" property="resourceCount" jdbcType="INTEGER"/>
|
||||
<result column="course_count" property="courseCount" jdbcType="INTEGER"/>
|
||||
<result column="complete_count" property="completeCount" jdbcType="INTEGER"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, stat_date, total_duration, resource_count, course_count,
|
||||
complete_count, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="userID != null and userID != ''">
|
||||
AND user_id = #{userID}
|
||||
</if>
|
||||
<if test="statDate != null">
|
||||
AND stat_date = #{statDate}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectLearningStatistics -->
|
||||
<select id="selectLearningStatistics" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_learning_statistics
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY stat_date DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.study.mapper.LearningTaskMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.study.TbLearningTask">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="task_id" property="taskID" jdbcType="VARCHAR"/>
|
||||
<result column="name" property="name" jdbcType="VARCHAR"/>
|
||||
<result column="description" property="description" jdbcType="LONGVARCHAR"/>
|
||||
<result column="start_time" property="startTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="end_time" property="endTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="updater" property="updater" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, task_id, name, description, start_time, end_time, status,
|
||||
creator, updater, create_time, update_time, delete_time, deleted
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="taskID != null and taskID != ''">
|
||||
AND task_id = #{taskID}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectLearningTasks -->
|
||||
<select id="selectLearningTasks" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_learning_task
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.study.mapper.TaskCourseMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.study.TbTaskCourse">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="task_id" property="taskID" jdbcType="VARCHAR"/>
|
||||
<result column="course_id" property="courseID" jdbcType="VARCHAR"/>
|
||||
<result column="required" property="required" jdbcType="BOOLEAN"/>
|
||||
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, task_id, course_id, required, order_num, creator, create_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="taskID != null and taskID != ''">
|
||||
AND task_id = #{taskID}
|
||||
</if>
|
||||
<if test="courseID != null and courseID != ''">
|
||||
AND course_id = #{courseID}
|
||||
</if>
|
||||
<if test="required != null">
|
||||
AND required = #{required}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectTaskCourses -->
|
||||
<select id="selectTaskCourses" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_task_course
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.study.mapper.TaskResourceMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.study.TbTaskResource">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="task_id" property="taskID" jdbcType="VARCHAR"/>
|
||||
<result column="resource_id" property="resourceID" jdbcType="VARCHAR"/>
|
||||
<result column="required" property="required" jdbcType="BOOLEAN"/>
|
||||
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, task_id, resource_id, required, order_num, creator, create_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="taskID != null and taskID != ''">
|
||||
AND task_id = #{taskID}
|
||||
</if>
|
||||
<if test="resourceID != null and resourceID != ''">
|
||||
AND resource_id = #{resourceID}
|
||||
</if>
|
||||
<if test="required != null">
|
||||
AND required = #{required}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectTaskResources -->
|
||||
<select id="selectTaskResources" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_task_resource
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.study.mapper.TaskUserMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.study.TbTaskUser">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="task_id" property="taskID" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="dept_id" property="deptID" jdbcType="VARCHAR"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="progress" property="progress" jdbcType="DECIMAL"/>
|
||||
<result column="complete_time" property="completeTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, task_id, user_id, dept_id, status, progress, complete_time,
|
||||
creator, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="taskID != null and taskID != ''">
|
||||
AND task_id = #{taskID}
|
||||
</if>
|
||||
<if test="userID != null and userID != ''">
|
||||
AND user_id = #{userID}
|
||||
</if>
|
||||
<if test="deptID != null and deptID != ''">
|
||||
AND dept_id = #{deptID}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectTaskUsers -->
|
||||
<select id="selectTaskUsers" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_task_user
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user