feat: add class scoped training task storage
parent
ee1086ae0f
commit
d2672d6849
@ -0,0 +1,23 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS training_task_class_config (
|
||||||
|
id varchar(64) NOT NULL,
|
||||||
|
teaching_class_id varchar(64) NOT NULL,
|
||||||
|
task_key varchar(128) NOT NULL,
|
||||||
|
project_name varchar(128) NOT NULL,
|
||||||
|
task_name varchar(128) NOT NULL,
|
||||||
|
knowledge text NULL,
|
||||||
|
background text NULL,
|
||||||
|
objectives text NULL,
|
||||||
|
requirements text NULL,
|
||||||
|
steps text NULL,
|
||||||
|
material_name varchar(255) NULL,
|
||||||
|
material_url varchar(500) NULL,
|
||||||
|
sort int DEFAULT 0,
|
||||||
|
enabled bit(1) DEFAULT b'1',
|
||||||
|
created_by varchar(64) NULL,
|
||||||
|
create_time datetime NULL,
|
||||||
|
update_time datetime NULL,
|
||||||
|
PRIMARY KEY (id),
|
||||||
|
UNIQUE KEY uk_training_task_class_key (teaching_class_id, task_key),
|
||||||
|
KEY idx_training_task_class_enabled_sort (teaching_class_id, enabled, sort),
|
||||||
|
KEY idx_training_task_class_created_by (created_by)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Class scoped training task config';
|
||||||
@ -0,0 +1,194 @@
|
|||||||
|
package com.sztzjy.linkCommerce.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class TrainingTaskClassConfig {
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty("Teaching class ID")
|
||||||
|
private String teachingClassId;
|
||||||
|
|
||||||
|
@ApiModelProperty("Task key")
|
||||||
|
private String taskKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("Project name")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("Task name")
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
@ApiModelProperty("Knowledge")
|
||||||
|
private String knowledge;
|
||||||
|
|
||||||
|
@ApiModelProperty("Training background")
|
||||||
|
private String background;
|
||||||
|
|
||||||
|
@ApiModelProperty("Training objectives JSON array")
|
||||||
|
private String objectives;
|
||||||
|
|
||||||
|
@ApiModelProperty("Training requirements")
|
||||||
|
private String requirements;
|
||||||
|
|
||||||
|
@ApiModelProperty("Step names JSON array")
|
||||||
|
private String steps;
|
||||||
|
|
||||||
|
@ApiModelProperty("Material name")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@ApiModelProperty("Material URL")
|
||||||
|
private String materialUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty("Sort order")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@ApiModelProperty("Enabled")
|
||||||
|
private Boolean enabled;
|
||||||
|
|
||||||
|
@ApiModelProperty("Created by")
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("Create time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("Update time")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id == null ? null : id.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTeachingClassId() {
|
||||||
|
return teachingClassId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTeachingClassId(String teachingClassId) {
|
||||||
|
this.teachingClassId = teachingClassId == null ? null : teachingClassId.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskKey() {
|
||||||
|
return taskKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskKey(String taskKey) {
|
||||||
|
this.taskKey = taskKey == null ? null : taskKey.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProjectName() {
|
||||||
|
return projectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectName(String projectName) {
|
||||||
|
this.projectName = projectName == null ? null : projectName.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskName() {
|
||||||
|
return taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskName(String taskName) {
|
||||||
|
this.taskName = taskName == null ? null : taskName.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKnowledge() {
|
||||||
|
return knowledge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKnowledge(String knowledge) {
|
||||||
|
this.knowledge = knowledge == null ? null : knowledge.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBackground() {
|
||||||
|
return background;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackground(String background) {
|
||||||
|
this.background = background == null ? null : background.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getObjectives() {
|
||||||
|
return objectives;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setObjectives(String objectives) {
|
||||||
|
this.objectives = objectives == null ? null : objectives.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRequirements() {
|
||||||
|
return requirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequirements(String requirements) {
|
||||||
|
this.requirements = requirements == null ? null : requirements.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSteps() {
|
||||||
|
return steps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSteps(String steps) {
|
||||||
|
this.steps = steps == null ? null : steps.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialName() {
|
||||||
|
return materialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialName(String materialName) {
|
||||||
|
this.materialName = materialName == null ? null : materialName.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialUrl() {
|
||||||
|
return materialUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialUrl(String materialUrl) {
|
||||||
|
this.materialUrl = materialUrl == null ? null : materialUrl.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSort(Integer sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnabled(Boolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedBy() {
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(String createdBy) {
|
||||||
|
this.createdBy = createdBy == null ? null : createdBy.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
package com.sztzjy.linkCommerce.mapper;
|
||||||
|
|
||||||
|
import com.sztzjy.linkCommerce.entity.TrainingTaskClassConfig;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TrainingTaskClassConfigMapper {
|
||||||
|
int insertSelective(TrainingTaskClassConfig record);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(TrainingTaskClassConfig record);
|
||||||
|
|
||||||
|
TrainingTaskClassConfig selectByPrimaryKey(String id);
|
||||||
|
|
||||||
|
TrainingTaskClassConfig selectByTeachingClassAndTaskKey(@Param("teachingClassId") String teachingClassId,
|
||||||
|
@Param("taskKey") String taskKey);
|
||||||
|
|
||||||
|
List<TrainingTaskClassConfig> selectListByTeachingClass(@Param("teachingClassId") String teachingClassId,
|
||||||
|
@Param("enabled") Boolean enabled);
|
||||||
|
}
|
||||||
@ -0,0 +1,113 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.sztzjy.linkCommerce.mapper.TrainingTaskClassConfigMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.sztzjy.linkCommerce.entity.TrainingTaskClassConfig">
|
||||||
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
|
<result column="teaching_class_id" jdbcType="VARCHAR" property="teachingClassId" />
|
||||||
|
<result column="task_key" jdbcType="VARCHAR" property="taskKey" />
|
||||||
|
<result column="project_name" jdbcType="VARCHAR" property="projectName" />
|
||||||
|
<result column="task_name" jdbcType="VARCHAR" property="taskName" />
|
||||||
|
<result column="knowledge" jdbcType="LONGVARCHAR" property="knowledge" />
|
||||||
|
<result column="background" jdbcType="LONGVARCHAR" property="background" />
|
||||||
|
<result column="objectives" jdbcType="LONGVARCHAR" property="objectives" />
|
||||||
|
<result column="requirements" jdbcType="LONGVARCHAR" property="requirements" />
|
||||||
|
<result column="steps" jdbcType="LONGVARCHAR" property="steps" />
|
||||||
|
<result column="material_name" jdbcType="VARCHAR" property="materialName" />
|
||||||
|
<result column="material_url" jdbcType="VARCHAR" property="materialUrl" />
|
||||||
|
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||||
|
<result column="enabled" jdbcType="BIT" property="enabled" />
|
||||||
|
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, teaching_class_id, task_key, project_name, task_name, knowledge, background, objectives, requirements,
|
||||||
|
steps, material_name, material_url, sort, enabled, created_by, create_time, update_time
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||||
|
select <include refid="Base_Column_List" />
|
||||||
|
from training_task_class_config
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByTeachingClassAndTaskKey" resultMap="BaseResultMap">
|
||||||
|
select <include refid="Base_Column_List" />
|
||||||
|
from training_task_class_config
|
||||||
|
where teaching_class_id = #{teachingClassId,jdbcType=VARCHAR}
|
||||||
|
and task_key = #{taskKey,jdbcType=VARCHAR}
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectListByTeachingClass" resultMap="BaseResultMap">
|
||||||
|
select <include refid="Base_Column_List" />
|
||||||
|
from training_task_class_config
|
||||||
|
where teaching_class_id = #{teachingClassId,jdbcType=VARCHAR}
|
||||||
|
<if test="enabled != null">
|
||||||
|
and enabled = #{enabled,jdbcType=BIT}
|
||||||
|
</if>
|
||||||
|
order by sort asc, create_time asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertSelective" parameterType="com.sztzjy.linkCommerce.entity.TrainingTaskClassConfig">
|
||||||
|
insert into training_task_class_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="teachingClassId != null">teaching_class_id,</if>
|
||||||
|
<if test="taskKey != null">task_key,</if>
|
||||||
|
<if test="projectName != null">project_name,</if>
|
||||||
|
<if test="taskName != null">task_name,</if>
|
||||||
|
<if test="knowledge != null">knowledge,</if>
|
||||||
|
<if test="background != null">background,</if>
|
||||||
|
<if test="objectives != null">objectives,</if>
|
||||||
|
<if test="requirements != null">requirements,</if>
|
||||||
|
<if test="steps != null">steps,</if>
|
||||||
|
<if test="materialName != null">material_name,</if>
|
||||||
|
<if test="materialUrl != null">material_url,</if>
|
||||||
|
<if test="sort != null">sort,</if>
|
||||||
|
<if test="enabled != null">enabled,</if>
|
||||||
|
<if test="createdBy != null">created_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="teachingClassId != null">#{teachingClassId,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="taskKey != null">#{taskKey,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="projectName != null">#{projectName,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="taskName != null">#{taskName,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="knowledge != null">#{knowledge},</if>
|
||||||
|
<if test="background != null">#{background},</if>
|
||||||
|
<if test="objectives != null">#{objectives},</if>
|
||||||
|
<if test="requirements != null">#{requirements},</if>
|
||||||
|
<if test="steps != null">#{steps},</if>
|
||||||
|
<if test="materialName != null">#{materialName,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="materialUrl != null">#{materialUrl,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="sort != null">#{sort,jdbcType=INTEGER},</if>
|
||||||
|
<if test="enabled != null">#{enabled,jdbcType=BIT},</if>
|
||||||
|
<if test="createdBy != null">#{createdBy,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.linkCommerce.entity.TrainingTaskClassConfig">
|
||||||
|
update training_task_class_config
|
||||||
|
<set>
|
||||||
|
<if test="projectName != null">project_name = #{projectName,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="taskName != null">task_name = #{taskName,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="knowledge != null">knowledge = #{knowledge},</if>
|
||||||
|
<if test="background != null">background = #{background},</if>
|
||||||
|
<if test="objectives != null">objectives = #{objectives},</if>
|
||||||
|
<if test="requirements != null">requirements = #{requirements},</if>
|
||||||
|
<if test="steps != null">steps = #{steps},</if>
|
||||||
|
<if test="materialName != null">material_name = #{materialName,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="materialUrl != null">material_url = #{materialUrl,jdbcType=VARCHAR},</if>
|
||||||
|
<if test="sort != null">sort = #{sort,jdbcType=INTEGER},</if>
|
||||||
|
<if test="enabled != null">enabled = #{enabled,jdbcType=BIT},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue