合并发布:集成GitLab远端主数据扩展与教学资源基线

This commit is contained in:
wangzhibiao committed 2026-10-09 14:29:26 +08:00
commit b93ac3fa71
43 files changed
+2583 -65

No files matched your search

@@ -0,0 +1,93 @@
package com.ruoyi.web.controller.train;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.train.domain.TrainResource;
import com.ruoyi.train.service.ITrainResourceService;
/**
* 教学资源Controller
*
* @author ruoyi
*/
@RestController
@RequestMapping("/train/resource")
public class TrainResourceController extends BaseController
{
@Autowired
private ITrainResourceService trainResourceService;
/**
* 查询教学资源列表
*/
@PreAuthorize("@ss.hasPermi('train:resource:list')")
@GetMapping("/list")
public TableDataInfo list(TrainResource trainResource)
{
startPage();
List<TrainResource> list = trainResourceService.selectTrainResourceList(trainResource);
return getDataTable(list);
}
/**
* 获取教学资源详细信息
*/
@PreAuthorize("@ss.hasPermi('train:resource:list')")
@GetMapping(value = "/{resourceId}")
public AjaxResult getInfo(@PathVariable("resourceId") String resourceId)
{
return success(trainResourceService.selectTrainResourceByResourceId(resourceId));
}
/**
* 新增教学资源
*/
@PreAuthorize("@ss.hasPermi('train:resource:edit')")
@Log(title = "教学资源", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody TrainResource trainResource)
{
trainResource.setCreateBy(SecurityUtils.getUsername());
return toAjax(trainResourceService.insertTrainResource(trainResource));
}
/**
* 删除教学资源 (RESTful DELETE /train/resource/{resourceIds})
*/
@PreAuthorize("@ss.hasPermi('train:resource:edit')")
@Log(title = "教学资源", businessType = BusinessType.DELETE)
@DeleteMapping("/{resourceIds}")
public AjaxResult remove(@PathVariable String[] resourceIds)
{
return toAjax(trainResourceService.deleteTrainResourceByResourceIds(resourceIds));
}
/**
* 修改教学资源 (RESTful PUT /train/resource/{resourceId})
*/
@PreAuthorize("@ss.hasPermi('train:resource:edit')")
@Log(title = "教学资源", businessType = BusinessType.UPDATE)
@PutMapping("/{resourceId}")
public AjaxResult edit(@PathVariable("resourceId") String resourceId, @Validated @RequestBody TrainResource trainResource)
{
trainResource.setResourceId(resourceId);
trainResource.setUpdateBy(SecurityUtils.getUsername());
return toAjax(trainResourceService.updateTrainResource(trainResource));
}
}
@@ -1,15 +1,12 @@
package com.ruoyi.web.controller.train;
import java.util.List;
import java.util.regex.Pattern;
import javax.validation.Valid;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.HttpStatus;
@@ -18,6 +15,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.train.domain.dto.StudentCreateDTO;
import com.ruoyi.train.domain.dto.StudentUpdateDTO;
import com.ruoyi.train.domain.query.StudentQuery;
import com.ruoyi.train.domain.vo.StudentAdminVO;
import com.ruoyi.train.domain.vo.StudentDetailVO;
@@ -30,6 +28,8 @@ import com.ruoyi.web.service.train.TrainAccountBindingAdminService;
@RequestMapping({"/train/student", "/train/students"})
public class TrainStudentController extends BaseController
{
private static final Pattern PHONE_PATTERN = Pattern.compile("^1[3-9]\\d{9}$");
private final ITrainStudentService trainStudentService;
private final TrainAccountBindingAdminService bindingAdminService;
@@ -76,6 +76,27 @@ public class TrainStudentController extends BaseController
return success(trainStudentService.createStudent(dto));
}
/**
* 修改学员信息 (PUT /train/student/{sId})
*/
@PreAuthorize("@ss.hasPermi('train:student:edit')")
@Log(title = "学员主档", businessType = BusinessType.UPDATE,
isSaveRequestData = false, isSaveResponseData = true)
@PutMapping(value = "/{sId}")
public AjaxResult edit(@PathVariable("sId") String sId, @Valid @RequestBody StudentUpdateDTO dto)
{
dto.setsId(sId);
if (StringUtils.isNotEmpty(dto.getsName()) && dto.getsName().trim().length() > 50)
{
return AjaxResult.error("学员姓名长度不能超过50个字符");
}
if (StringUtils.isNotEmpty(dto.getsPhone()) && !isValidPhone(dto.getsPhone()))
{
return AjaxResult.error("学员手机号码格式不正确");
}
return success(trainStudentService.updateTrainStudent(dto));
}
@PreAuthorize("@ss.hasPermi('train:student:remove')")
@Log(title = "学员主档", businessType = BusinessType.DELETE)
@DeleteMapping("/{sId}")
@@ -83,4 +104,9 @@ public class TrainStudentController extends BaseController
{
return toAjax(trainStudentService.deleteTrainStudentBySId(sId));
}
private boolean isValidPhone(String phone)
{
return PHONE_PATTERN.matcher(phone).matches();
}
}
@@ -4,6 +4,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@@ -67,6 +68,17 @@ public class TrainTrainingSiteController extends BaseController
return toAjax(trainTrainingSiteService.insertTrainTrainingSite(trainTrainingSite));
}
/**
* 删除实训场地 (RESTful DELETE /train/training-site/{siteIds})
*/
@PreAuthorize("@ss.hasPermi('train:site:edit')")
@Log(title = "实训场地", businessType = BusinessType.DELETE)
@DeleteMapping("/{siteIds}")
public AjaxResult remove(@PathVariable String[] siteIds)
{
return toAjax(trainTrainingSiteService.deleteTrainTrainingSiteBySiteIds(siteIds));
}
/**
* 修改实训场地 (RESTful PUT /train/training-site/{siteId})
*/
@@ -63,7 +63,7 @@ public class SysLoginService
public String login(String username, String password, String code, String uuid)
{
// 验证码校验
//validateCaptcha(username, code, uuid);
validateCaptcha(username, code, uuid);
// 登录前置校验
loginPreCheck(username, password);
// 用户验证
@@ -46,6 +46,12 @@ public class TrainClassroomInfo extends BaseEntity
/** 删除标志 (0代表存在 2代表删除) */
private String delFlag;
private Integer multimedia;
private Integer projector;
private String seatArrange;
public void setClassRoomId(String classRoomId)
{
this.classRoomId = classRoomId;
@@ -106,6 +112,30 @@ public class TrainClassroomInfo extends BaseEntity
return delFlag;
}
public Integer getMultimedia() {
return multimedia;
}
public void setMultimedia(Integer multimedia) {
this.multimedia = multimedia;
}
public Integer getProjector() {
return projector;
}
public void setProjector(Integer projector) {
this.projector = projector;
}
public String getSeatArrange() {
return seatArrange;
}
public void setSeatArrange(String seatArrange) {
this.seatArrange = seatArrange;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -120,6 +150,9 @@ public class TrainClassroomInfo extends BaseEntity
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("multimedia", getMultimedia())
.append("projector", getProjector())
.append("seatArrange", getSeatArrange())
.toString();
}
}
@@ -43,6 +43,10 @@ public class TrainCourse extends BaseEntity
@Excel(name = "课程内容")
private String courseContent;
/** 课程资源ID,多个资源以英文逗号分隔,对应 train_resource.resource_id */
@Excel(name = "课程资源ID")
private String resourceId;
/** 课程状态 (1:正常, 0:停用) */
@Excel(name = "课程状态", readConverterExp = "1=正常,0=停用")
private Integer status;
@@ -180,6 +184,16 @@ public class TrainCourse extends BaseEntity
return courseContent;
}
public void setResourceId(String resourceId)
{
this.resourceId = resourceId;
}
public String getResourceId()
{
return resourceId;
}
public void setStatus(Integer status)
{
this.status = status;
@@ -210,6 +224,7 @@ public class TrainCourse extends BaseEntity
.append("cDuration", getcDuration())
.append("teachingObjective", getTeachingObjective())
.append("courseContent", getCourseContent())
.append("resourceId", getResourceId())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
@@ -0,0 +1,149 @@
package com.ruoyi.train.domain;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 教学资源对象 train_resource
*
* <p>统一教学资源:文档、视频、3D模型、VR资源、外部教学链接、其他。
* 该表被 train_course_resource、train_study_duration 外键引用,删除一律走逻辑删除。</p>
*
* @author ruoyi
*/
public class TrainResource extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 资源唯一ID */
private String resourceId;
/** 资源名称 */
@NotBlank(message = "资源名称不能为空")
@Size(max = 150, message = "资源名称长度不能超过150个字符")
@Excel(name = "资源名称")
private String resourceName;
/** 资源类型 (1:文档, 2:视频, 3:3D模型, 4:VR资源, 5:外部教学链接, 6:其他) */
@NotNull(message = "资源类型不能为空")
@Min(value = 1, message = "资源类型取值必须为1-6")
@Max(value = 6, message = "资源类型取值必须为1-6")
@Excel(name = "资源类型", readConverterExp = "1=文档,2=视频,3=3D模型,4=VR资源,5=外部教学链接,6=其他")
private Integer resourceType;
/** 资源存储地址/在线链接 */
@NotBlank(message = "资源地址不能为空")
@Size(max = 500, message = "资源地址长度不能超过500个字符")
@Excel(name = "资源地址")
private String resourceUrl;
/** 资源描述/使用说明 */
@Size(max = 500, message = "资源描述长度不能超过500个字符")
@Excel(name = "资源描述")
private String description;
/** 状态 (1:正常, 0:停用) */
@Min(value = 0, message = "状态取值必须为0或1")
@Max(value = 1, message = "状态取值必须为0或1")
@Excel(name = "状态", readConverterExp = "0=停用,1=正常")
private Integer status;
/** 删除标志 (0代表存在 2代表删除) */
private String delFlag;
public void setResourceId(String resourceId)
{
this.resourceId = resourceId;
}
public String getResourceId()
{
return resourceId;
}
public void setResourceName(String resourceName)
{
this.resourceName = resourceName;
}
public String getResourceName()
{
return resourceName;
}
public void setResourceType(Integer resourceType)
{
this.resourceType = resourceType;
}
public Integer getResourceType()
{
return resourceType;
}
public void setResourceUrl(String resourceUrl)
{
this.resourceUrl = resourceUrl;
}
public String getResourceUrl()
{
return resourceUrl;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getStatus()
{
return status;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString()
{
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("resourceId", getResourceId())
.append("resourceName", getResourceName())
.append("resourceType", getResourceType())
.append("resourceUrl", getResourceUrl())
.append("description", getDescription())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
@@ -42,6 +42,10 @@ public class TrainStudent extends BaseEntity
private Integer status;
private String delFlag;
private String avatar;
private Integer dutyLevel;
public String getsId()
{
return sId;
@@ -194,6 +198,22 @@ public class TrainStudent extends BaseEntity
this.delFlag = delFlag;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public Integer getDutyLevel() {
return dutyLevel;
}
public void setDutyLevel(Integer dutyLevel) {
this.dutyLevel = dutyLevel;
}
/**
* 安全日志表示:刻意不包含身份证密文、查重值或任何完整身份证信息。
*/
@@ -219,6 +239,8 @@ public class TrainStudent extends BaseEntity
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("dutyLevel", getDutyLevel())
.append("avatar", getAvatar())
.toString();
}
}
@@ -60,6 +60,15 @@ public class TrainTeacher extends BaseEntity
/** 删除标志 (0:存在, 2:删除) */
private String delFlag;
private String avatar;
private String major;
private String courses;
private Date startTeaching;
public void settId(String tId)
{
this.tId = tId;
@@ -180,6 +189,38 @@ public class TrainTeacher extends BaseEntity
return delFlag;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public String getCourses() {
return courses;
}
public void setCourses(String courses) {
this.courses = courses;
}
public Date getStartTeaching() {
return startTeaching;
}
public void setStartTeaching(Date startTeaching) {
this.startTeaching = startTeaching;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -199,6 +240,10 @@ public class TrainTeacher extends BaseEntity
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("avatar", getAvatar())
.append("major", getMajor())
.append("courses", getCourses())
.append("startTeaching", getStartTeaching())
.toString();
}
}
@@ -50,6 +50,10 @@ public class TrainTrainingSite extends BaseEntity
/** 删除标志 (0代表存在 2代表删除) */
private String delFlag;
private String major;
private String seatArrange;
public void setSiteId(String siteId)
{
this.siteId = siteId;
@@ -120,6 +124,22 @@ public class TrainTrainingSite extends BaseEntity
return delFlag;
}
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public String getSeatArrange() {
return seatArrange;
}
public void setSeatArrange(String seatArrange) {
this.seatArrange = seatArrange;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -135,6 +155,8 @@ public class TrainTrainingSite extends BaseEntity
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("major", getMajor())
.append("seatArrange", getSeatArrange())
.toString();
}
}
@@ -32,6 +32,12 @@ public class ClassroomCreateDTO implements Serializable
/** 教室状态 (0: 正在使用, 1: 可用空闲, 2: 维护中) */
private Integer roomStatus;
private Integer multimedia;
private Integer projector;
private String seatArrange;
/** 备注 */
@Size(max = 500, message = "备注长度不能超过500个字符")
private String remark;
@@ -85,4 +91,28 @@ public class ClassroomCreateDTO implements Serializable
{
this.remark = remark;
}
public Integer getMultimedia() {
return multimedia;
}
public void setMultimedia(Integer multimedia) {
this.multimedia = multimedia;
}
public Integer getProjector() {
return projector;
}
public void setProjector(Integer projector) {
this.projector = projector;
}
public String getSeatArrange() {
return seatArrange;
}
public void setSeatArrange(String seatArrange) {
this.seatArrange = seatArrange;
}
}
@@ -39,6 +39,10 @@ public class SiteCreateDTO implements Serializable
@Size(max = 500, message = "备注长度不能超过500个字符")
private String remark;
private String seatArrange;
private String major;
public String getSiteName()
{
return siteName;
@@ -98,4 +102,20 @@ public class SiteCreateDTO implements Serializable
{
this.remark = remark;
}
public String getSeatArrange() {
return seatArrange;
}
public void setSeatArrange(String seatArrange) {
this.seatArrange = seatArrange;
}
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
}
@@ -46,6 +46,9 @@ public class StudentCreateDTO implements Serializable
@Size(max = 500, message = "备注长度不能超过500个字符")
private String remark;
private Integer dutyLevel;
private String avatar;
public String getsName() { return sName; }
public void setsName(String sName) { this.sName = sName; }
public String getsGender() { return sGender; }
@@ -65,6 +68,22 @@ public class StudentCreateDTO implements Serializable
public String getRemark() { return remark; }
public void setRemark(String remark) { this.remark = remark; }
public Integer getDutyLevel() {
return dutyLevel;
}
public void setDutyLevel(Integer dutyLevel) {
this.dutyLevel = dutyLevel;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
@Override
public String toString()
{
@@ -0,0 +1,36 @@
package com.ruoyi.train.domain.dto;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* 学员手工修改请求。
*
* <p>复用 {@link StudentCreateDTO} 的可编辑字段与校验规则,额外要求携带学员主键 sId。
* 身份证号沿用「只写不读」策略:未提交时保留库内既有密文,不做清空。</p>
*/
public class StudentUpdateDTO extends StudentCreateDTO
{
private static final long serialVersionUID = 1L;
@NotBlank(message = "学员ID不能为空")
@Size(max = 64, message = "学员ID长度不能超过64个字符")
private String sId;
public String getsId()
{
return sId;
}
public void setsId(String sId)
{
this.sId = sId;
}
@Override
public String toString()
{
return "StudentUpdateDTO{sId='" + sId + "', sName='" + getsName()
+ "', idCardProvided=" + (getIdCard() != null) + "}";
}
}
@@ -40,6 +40,12 @@ public class ClassroomDetailVO implements Serializable
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String seatArrange;
private Integer multimedia;
private Integer projector;
public String getClassRoomId()
{
return classRoomId;
@@ -119,4 +125,28 @@ public class ClassroomDetailVO implements Serializable
{
this.createTime = createTime;
}
public String getSeatArrange() {
return seatArrange;
}
public void setSeatArrange(String seatArrange) {
this.seatArrange = seatArrange;
}
public Integer getMultimedia() {
return multimedia;
}
public void setMultimedia(Integer multimedia) {
this.multimedia = multimedia;
}
public Integer getProjector() {
return projector;
}
public void setProjector(Integer projector) {
this.projector = projector;
}
}
@@ -60,6 +60,8 @@ public class CourseDetailVO implements Serializable
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
private String resourceId;
/**
* 已关联的教学资源列表
* 注:当前 ISSUE-01-03 未实现真实 Course<->Resource 查询;
@@ -91,6 +93,7 @@ public class CourseDetailVO implements Serializable
vo.setCreateTime(course.getCreateTime());
vo.setUpdateBy(course.getUpdateBy());
vo.setUpdateTime(course.getUpdateTime());
vo.setResourceId(course.getResourceId());
// 资源绑定/解绑能力属于 P1,当前返回空列表保持响应结构稳定
vo.setResources(Collections.emptyList());
return vo;
@@ -286,6 +289,14 @@ public class CourseDetailVO implements Serializable
this.updateTime = updateTime;
}
public String getResourceId() {
return resourceId;
}
public void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
public List<Object> getResources()
{
return resources;
@@ -38,6 +38,10 @@ public class SiteDetailVO implements Serializable
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String seatArrange;
private String major;
public String getSiteId()
{
return siteId;
@@ -117,4 +121,20 @@ public class SiteDetailVO implements Serializable
{
this.createTime = createTime;
}
public String getSeatArrange() {
return seatArrange;
}
public void setSeatArrange(String seatArrange) {
this.seatArrange = seatArrange;
}
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
}
@@ -14,6 +14,10 @@ public class StudentDetailVO extends StudentItemVO
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private Integer dutyLevel;
private String avatar;
public String getFaceRef() { return faceRef; }
public void setFaceRef(String faceRef) { this.faceRef = faceRef; }
public String getRemark() { return remark; }
@@ -22,4 +26,20 @@ public class StudentDetailVO extends StudentItemVO
public void setCreateBy(String createBy) { this.createBy = createBy; }
public Date getCreateTime() { return createTime; }
public void setCreateTime(Date createTime) { this.createTime = createTime; }
public Integer getDutyLevel() {
return dutyLevel;
}
public void setDutyLevel(Integer dutyLevel) {
this.dutyLevel = dutyLevel;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
}
@@ -22,6 +22,10 @@ public class StudentItemVO implements Serializable
private Integer sourceType;
private Integer status;
private String avatar;
private Integer dutyLevel;
public String getsId() { return sId; }
public void setsId(String sId) { this.sId = sId; }
public String getsName() { return sName; }
@@ -44,4 +48,20 @@ public class StudentItemVO implements Serializable
public void setSourceType(Integer sourceType) { this.sourceType = sourceType; }
public Integer getStatus() { return status; }
public void setStatus(Integer status) { this.status = status; }
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public Integer getDutyLevel() {
return dutyLevel;
}
public void setDutyLevel(Integer dutyLevel) {
this.dutyLevel = dutyLevel;
}
}
@@ -0,0 +1,60 @@
package com.ruoyi.train.mapper;
import java.util.List;
import com.ruoyi.train.domain.TrainResource;
/**
* 教学资源Mapper接口
*
* @author ruoyi
*/
public interface TrainResourceMapper
{
/**
* 查询教学资源
*
* @param resourceId 教学资源主键
* @return 教学资源
*/
public TrainResource selectTrainResourceByResourceId(String resourceId);
/**
* 查询教学资源列表
*
* @param trainResource 教学资源查询条件
* @return 教学资源集合
*/
public List<TrainResource> selectTrainResourceList(TrainResource trainResource);
/**
* 新增教学资源
*
* @param trainResource 教学资源
* @return 结果
*/
public int insertTrainResource(TrainResource trainResource);
/**
* 修改教学资源
*
* @param trainResource 教学资源
* @return 结果
*/
public int updateTrainResource(TrainResource trainResource);
/**
* 删除教学资源(逻辑删除)
*
* @param resourceId 教学资源主键
* @return 结果
*/
public int deleteTrainResourceByResourceId(String resourceId);
/**
* 批量删除教学资源(逻辑删除)
*
* @param resourceIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteTrainResourceByResourceIds(String[] resourceIds);
}
@@ -18,6 +18,14 @@ public interface TrainStudentMapper
int insertTrainStudent(TrainStudent trainStudent);
/**
* 修改学员主档(仅更新非空字段,身份信息随身份证变更同步刷新)
*
* @param trainStudent 学员信息(必须携带 sId)
* @return 影响行数
*/
int updateTrainStudent(TrainStudent trainStudent);
/**
* 根据系统用户ID查询学员信息 (del_flag = '0')
*
@@ -0,0 +1,60 @@
package com.ruoyi.train.service;
import java.util.List;
import com.ruoyi.train.domain.TrainResource;
/**
* 教学资源Service接口
*
* @author ruoyi
*/
public interface ITrainResourceService
{
/**
* 查询教学资源
*
* @param resourceId 教学资源主键
* @return 教学资源
*/
public TrainResource selectTrainResourceByResourceId(String resourceId);
/**
* 查询教学资源列表
*
* @param trainResource 教学资源查询条件
* @return 教学资源集合
*/
public List<TrainResource> selectTrainResourceList(TrainResource trainResource);
/**
* 新增教学资源
*
* @param trainResource 教学资源
* @return 结果
*/
public int insertTrainResource(TrainResource trainResource);
/**
* 修改教学资源
*
* @param trainResource 教学资源
* @return 结果
*/
public int updateTrainResource(TrainResource trainResource);
/**
* 批量删除教学资源
*
* @param resourceIds 需要删除的教学资源主键集合
* @return 结果
*/
public int deleteTrainResourceByResourceIds(String[] resourceIds);
/**
* 删除教学资源信息
*
* @param resourceId 教学资源主键
* @return 结果
*/
public int deleteTrainResourceByResourceId(String resourceId);
}
@@ -2,6 +2,7 @@ package com.ruoyi.train.service;
import java.util.List;
import com.ruoyi.train.domain.dto.StudentCreateDTO;
import com.ruoyi.train.domain.dto.StudentUpdateDTO;
import com.ruoyi.train.domain.query.StudentQuery;
import com.ruoyi.train.domain.vo.StudentDetailVO;
import com.ruoyi.train.domain.vo.StudentItemVO;
@@ -15,6 +16,14 @@ public interface ITrainStudentService
String createStudent(StudentCreateDTO dto);
/**
* 修改学员主档
*
* @param dto 学员修改请求(携带 sId)
* @return 学员主档ID
*/
String updateTrainStudent(StudentUpdateDTO dto);
/**
* 安全删除学员档案(ZERO-REFERENCE SAFE DELETE)
*
@@ -57,6 +57,9 @@ public class TrainClassroomInfoServiceImpl implements ITrainClassroomInfoService
vo.setRoomStatus(classroom.getRoomStatus());
vo.setRemark(classroom.getRemark());
vo.setCreateTime(classroom.getCreateTime());
vo.setSeatArrange(classroom.getSeatArrange());
vo.setMultimedia(classroom.getMultimedia());
vo.setProjector(classroom.getProjector());
// 按 bind_classroom_id 查询绑定的电子班牌(0..N),映射为轻量摘要 VO,无绑定时返回空列表 []
TrainElectronicBoard boardQuery = new TrainElectronicBoard();
@@ -0,0 +1,159 @@
package com.ruoyi.train.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.train.domain.TrainResource;
import com.ruoyi.train.mapper.TrainResourceMapper;
import com.ruoyi.train.service.ITrainResourceService;
/**
* 教学资源Service业务层处理
*
* <p>资源表被 train_course_resource、train_study_duration 外键引用,
* 因此删除统一使用逻辑删除(del_flag = '2'),禁止物理删除。</p>
*
* @author ruoyi
*/
@Service
public class TrainResourceServiceImpl implements ITrainResourceService
{
@Autowired
private TrainResourceMapper trainResourceMapper;
/**
* 查询教学资源
*
* @param resourceId 教学资源主键
* @return 教学资源
*/
@Override
public TrainResource selectTrainResourceByResourceId(String resourceId)
{
return trainResourceMapper.selectTrainResourceByResourceId(resourceId);
}
/**
* 查询教学资源列表
*
* @param trainResource 教学资源查询条件
* @return 教学资源集合
*/
@Override
public List<TrainResource> selectTrainResourceList(TrainResource trainResource)
{
return trainResourceMapper.selectTrainResourceList(trainResource);
}
/**
* 新增教学资源
*
* @param trainResource 教学资源
* @return 结果
*/
@Override
public int insertTrainResource(TrainResource trainResource)
{
validateResourceType(trainResource.getResourceType());
validateStatus(trainResource.getStatus());
// 未指定主键时自动生成32位UUID,与 resource_id VARCHAR(32) 对齐
if (StringUtils.isEmpty(trainResource.getResourceId()))
{
trainResource.setResourceId(IdUtils.fastSimpleUUID());
}
if (trainResource.getStatus() == null)
{
trainResource.setStatus(1); // 默认正常
}
trainResource.setDelFlag("0");
trainResource.setCreateTime(DateUtils.getNowDate());
return trainResourceMapper.insertTrainResource(trainResource);
}
/**
* 修改教学资源
*
* @param trainResource 教学资源(必须携带 resourceId)
* @return 结果
*/
@Override
public int updateTrainResource(TrainResource trainResource)
{
if (StringUtils.isEmpty(trainResource.getResourceId()))
{
throw new ServiceException("资源ID不能为空");
}
if (trainResource.getResourceType() != null)
{
validateResourceType(trainResource.getResourceType());
}
if (trainResource.getStatus() != null)
{
validateStatus(trainResource.getStatus());
}
trainResource.setUpdateTime(DateUtils.getNowDate());
return trainResourceMapper.updateTrainResource(trainResource);
}
/**
* 批量删除教学资源
*
* @param resourceIds 需要删除的教学资源主键集合
* @return 结果
*/
@Override
public int deleteTrainResourceByResourceIds(String[] resourceIds)
{
if (resourceIds == null || resourceIds.length == 0)
{
throw new ServiceException("请选择要删除的资源");
}
return trainResourceMapper.deleteTrainResourceByResourceIds(resourceIds);
}
/**
* 删除教学资源信息
*
* @param resourceId 教学资源主键
* @return 结果
*/
@Override
public int deleteTrainResourceByResourceId(String resourceId)
{
if (StringUtils.isEmpty(resourceId))
{
throw new ServiceException("资源ID不能为空");
}
return trainResourceMapper.deleteTrainResourceByResourceId(resourceId);
}
/**
* 校验资源类型取值:1文档 2视频 33D模型 4VR资源 5外部教学链接 6其他
*/
private void validateResourceType(Integer resourceType)
{
if (resourceType == null)
{
throw new ServiceException("资源类型不能为空");
}
if (resourceType < 1 || resourceType > 6)
{
throw new ServiceException("资源类型取值必须为1-6");
}
}
/**
* 校验状态取值:0停用 1正常
*/
private void validateStatus(Integer status)
{
if (status != null && status != 0 && status != 1)
{
throw new ServiceException("资源状态取值必须为0或1");
}
}
}
@@ -13,6 +13,7 @@ import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.train.constant.StudentErrorCode;
import com.ruoyi.train.domain.TrainStudent;
import com.ruoyi.train.domain.dto.StudentCreateDTO;
import com.ruoyi.train.domain.dto.StudentUpdateDTO;
import com.ruoyi.train.domain.query.StudentQuery;
import com.ruoyi.train.domain.vo.StudentDetailVO;
import com.ruoyi.train.domain.vo.StudentItemVO;
@@ -99,6 +100,8 @@ public class TrainStudentServiceImpl implements ITrainStudentService
student.setOrgName(trimToNull(dto.getOrgName()));
student.setsPhone(trimToNull(dto.getsPhone()));
student.setsEmail(trimToNull(dto.getsEmail()));
student.setAvatar(trimToNull(dto.getAvatar()));
student.setDutyLevel(dto.getDutyLevel());
if (normalizedIdCard != null)
{
@@ -144,6 +147,93 @@ public class TrainStudentServiceImpl implements ITrainStudentService
return student.getsId();
}
/**
* 修改学员主档信息。
*
* <p>与 createStudent 保持完全一致的安全语义:姓名必填、身份证格式校验、
* 身份证以可逆密文 + 冻结查重哈希落库、末四位仅用于脱敏展示。差异点:</p>
* <ul>
* <li>身份证未提供时保留库内既有密文,避免误清空已归档的身份信息;</li>
* <li>身份证变更时才做全局查重,哈希未变化视为本人,不做重复判定;</li>
* <li>userId / sourceType / status / delFlag 不属于编辑范围,一律不覆盖。</li>
* </ul>
*
* @param dto 学员修改请求(携带 sId)
* @return 学员主档ID
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String updateTrainStudent(StudentUpdateDTO dto)
{
if (dto == null || StringUtils.isEmpty(dto.getsId()))
{
throw new ServiceException("学员ID不能为空");
}
validate(dto);
TrainStudent existing = trainStudentMapper.selectTrainStudentBySId(dto.getsId());
if (existing == null)
{
throw new ServiceException(StudentErrorCode.STUDENT_NOT_FOUND_MESSAGE,
StudentErrorCode.STUDENT_NOT_FOUND);
}
TrainStudent student = new TrainStudent();
student.setsId(existing.getsId());
student.setsName(dto.getsName().trim());
student.setsGender(trimToNull(dto.getsGender()));
student.setsBirth(dto.getsBirth());
student.setOrgName(trimToNull(dto.getOrgName()));
student.setsPhone(trimToNull(dto.getsPhone()));
student.setsEmail(trimToNull(dto.getsEmail()));
student.setAvatar(trimToNull(dto.getAvatar()));
student.setFaceRef(trimToNull(dto.getFaceRef()));
student.setDutyLevel(dto.getDutyLevel());
student.setRemark(trimToNull(dto.getRemark()));
String normalizedIdCard = normalizeIdCard(dto.getIdCard());
if (normalizedIdCard != null)
{
String hash = identityProtection.deterministicHash(normalizedIdCard);
// 哈希未变化说明仍是同一人,只有真正变更身份证时才需要全局查重
if (!hash.equals(existing.getIdCardHash())
&& trainStudentMapper.selectOneByIdCardHash(hash) != null)
{
throw duplicateIdentity();
}
student.setIdCardCiphertext(identityProtection.encrypt(normalizedIdCard));
student.setIdCardHash(hash);
student.setIdCardLast4(normalizedIdCard.substring(normalizedIdCard.length() - 4));
}
else
{
student.setIdCardCiphertext(existing.getIdCardCiphertext());
student.setIdCardHash(existing.getIdCardHash());
student.setIdCardLast4(existing.getIdCardLast4());
}
student.setUpdateTime(DateUtils.getNowDate());
try
{
student.setUpdateBy(SecurityUtils.getUsername());
}
catch (Exception ignored)
{
// 非 Web 单元测试无登录上下文;不使用任何请求数据作为审计用户兜底。
}
try
{
trainStudentMapper.updateTrainStudent(student);
}
catch (DuplicateKeyException e)
{
// 应用层预检之外,数据库唯一约束继续封堵并发重复身份证。
throw duplicateIdentity();
}
return student.getsId();
}
private StudentItemVO toItemVO(TrainStudent student)
{
StudentItemVO item = new StudentItemVO();
@@ -164,6 +254,8 @@ public class TrainStudentServiceImpl implements ITrainStudentService
target.setIdCardMasked(maskStoredIdentity(student));
target.setSourceType(student.getSourceType());
target.setStatus(student.getStatus());
target.setAvatar(student.getAvatar());
target.setDutyLevel(student.getDutyLevel());
}
private String maskStoredIdentity(TrainStudent student)
@@ -16,19 +16,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="seatArrange" column="seat_arrange" />
<result property="multimedia" column="multimedia" />
<result property="projector" column="projector" />
</resultMap>
<sql id="selectTrainClassroomInfoVo">
select class_room_id, room_name, room_location, capacity, room_status, del_flag, create_by, create_time, update_by, update_time, remark from train_classroom_info
select class_room_id, room_name, room_location, capacity, room_status, del_flag, create_by, create_time, update_by, update_time, remark, seat_arrange, multimedia, projector from train_classroom_info
</sql>
<select id="selectTrainClassroomInfoList" parameterType="TrainClassroomInfo" resultMap="TrainClassroomInfoResult">
<include refid="selectTrainClassroomInfoVo"/>
where del_flag = '0'
<if test="roomName != null and roomName != ''"> and room_name like concat('%', #{roomName}, '%')</if>
<if test="roomLocation != null and roomLocation != ''"> and room_location = #{roomLocation}</if>
<if test="roomLocation != null and roomLocation != ''"> and room_location like concat('%', #{roomLocation}, '%')</if>
<if test="capacity != null "> and capacity = #{capacity}</if>
<if test="roomStatus != null "> and room_status = #{roomStatus}</if>
<if test="multimedia != null "> and multimedia = #{multimedia}</if>
<if test="projector != null "> and projector = #{projector}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
order by create_time desc
</select>
@@ -61,6 +66,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="seatArrange != null">seat_arrange,</if>
<if test="multimedia != null">multimedia,</if>
<if test="projector != null">projector,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="classRoomId != null">#{classRoomId},</if>
@@ -74,6 +82,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="seatArrange != null">#{seatArrange},</if>
<if test="multimedia != null">#{multimedia},</if>
<if test="projector != null">#{projector},</if>
</trim>
</insert>
@@ -88,6 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="seatArrange != null">seat_arrange = #{seatArrange},</if>
<if test="multimedia != null">multimedia = #{multimedia},</if>
<if test="projector != null">projector = #{projector},</if>
</trim>
where class_room_id = #{classRoomId}
</update>
@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="cDuration" column="c_duration" />
<result property="teachingObjective" column="teaching_objective" />
<result property="courseContent" column="course_content" />
<result property="resourceId" column="resource_id" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
@@ -22,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectTrainCourseVo">
select c_id, c_code, c_name, c_type, c_duration, teaching_objective, course_content, status, del_flag, create_by, create_time, update_by, update_time, remark from train_course
select c_id, c_code, c_name, c_type, c_duration, teaching_objective, course_content, resource_id, status, del_flag, create_by, create_time, update_by, update_time, remark from train_course
</sql>
<select id="selectTrainCourseList" parameterType="TrainCourse" resultMap="TrainCourseResult">
@@ -63,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cDuration != null">c_duration,</if>
<if test="teachingObjective != null and teachingObjective != ''">teaching_objective,</if>
<if test="courseContent != null and courseContent != ''">course_content,</if>
<if test="resourceId != null and resourceId != ''">resource_id,</if>
<if test="status != null">status,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
@@ -79,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cDuration != null">#{cDuration},</if>
<if test="teachingObjective != null and teachingObjective != ''">#{teachingObjective},</if>
<if test="courseContent != null and courseContent != ''">#{courseContent},</if>
<if test="resourceId != null and resourceId != ''">#{resourceId},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
@@ -98,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cDuration != null">c_duration = #{cDuration},</if>
<if test="teachingObjective != null">teaching_objective = #{teachingObjective},</if>
<if test="courseContent != null">course_content = #{courseContent},</if>
<if test="resourceId != null">resource_id = #{resourceId},</if>
<if test="status != null">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
@@ -0,0 +1,103 @@
<?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.ruoyi.train.mapper.TrainResourceMapper">
<resultMap type="TrainResource" id="TrainResourceResult">
<result property="resourceId" column="resource_id" />
<result property="resourceName" column="resource_name" />
<result property="resourceType" column="resource_type" />
<result property="resourceUrl" column="resource_url" />
<result property="description" column="description" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTrainResourceVo">
select resource_id, resource_name, resource_type, resource_url, description, status, del_flag, create_by, create_time, update_by, update_time, remark from train_resource
</sql>
<select id="selectTrainResourceList" parameterType="TrainResource" resultMap="TrainResourceResult">
<include refid="selectTrainResourceVo"/>
where del_flag = '0'
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
<if test="resourceType != null"> and resource_type = #{resourceType}</if>
<if test="resourceUrl != null and resourceUrl != ''"> and resource_url like concat('%', #{resourceUrl}, '%')</if>
<if test="description != null and description != ''"> and description like concat('%', #{description}, '%')</if>
<if test="status != null"> and status = #{status}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="params.beginTime != null and params.beginTime != ''"> and create_time &gt;= #{params.beginTime}</if>
<if test="params.endTime != null and params.endTime != ''"> and create_time &lt;= #{params.endTime}</if>
order by create_time desc
</select>
<select id="selectTrainResourceByResourceId" parameterType="String" resultMap="TrainResourceResult">
<include refid="selectTrainResourceVo"/>
where resource_id = #{resourceId} and del_flag = '0'
</select>
<insert id="insertTrainResource" parameterType="TrainResource">
insert into train_resource
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="resourceId != null">resource_id,</if>
<if test="resourceName != null and resourceName != ''">resource_name,</if>
<if test="resourceType != null">resource_type,</if>
<if test="resourceUrl != null and resourceUrl != ''">resource_url,</if>
<if test="description != null">description,</if>
<if test="status != null">status,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="resourceId != null">#{resourceId},</if>
<if test="resourceName != null and resourceName != ''">#{resourceName},</if>
<if test="resourceType != null">#{resourceType},</if>
<if test="resourceUrl != null and resourceUrl != ''">#{resourceUrl},</if>
<if test="description != null">#{description},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTrainResource" parameterType="TrainResource">
update train_resource
<trim prefix="SET" suffixOverrides=",">
<if test="resourceName != null and resourceName != ''">resource_name = #{resourceName},</if>
<if test="resourceType != null">resource_type = #{resourceType},</if>
<if test="resourceUrl != null and resourceUrl != ''">resource_url = #{resourceUrl},</if>
<if test="description != null">description = #{description},</if>
<if test="status != null">status = #{status},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where resource_id = #{resourceId} and del_flag = '0'
</update>
<update id="deleteTrainResourceByResourceId" parameterType="String">
update train_resource set del_flag = '2' where resource_id = #{resourceId}
</update>
<update id="deleteTrainResourceByResourceIds" parameterType="String">
update train_resource set del_flag = '2' where resource_id in
<foreach item="resourceId" collection="array" open="(" separator="," close=")">
#{resourceId}
</foreach>
</update>
</mapper>
@@ -25,12 +25,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="avatar" column="avatar" />
<result property="dutyLevel" column="duty_level" />
</resultMap>
<sql id="selectTrainStudentDomain">
select s_id, s_name, s_gender, s_birth, user_id, org_name, s_phone, s_email,
id_card_ciphertext, id_card_hash, id_card_last4, face_ref, source_type,
status, create_by, create_time, update_by, update_time, remark, del_flag
status, create_by, create_time, update_by, update_time, remark, del_flag,
avatar, duty_level
from train_student
</sql>
@@ -77,14 +80,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into train_student (
s_id, s_name, s_gender, s_birth, user_id, org_name, s_phone, s_email,
id_card_ciphertext, id_card_hash, id_card_last4, face_ref, source_type,
status, create_by, create_time, update_by, update_time, remark, del_flag
status, create_by, create_time, update_by, update_time, remark, del_flag,
avatar, duty_level
) values (
#{sId}, #{sName}, #{sGender}, #{sBirth}, #{userId}, #{orgName}, #{sPhone}, #{sEmail},
#{idCardCiphertext}, #{idCardHash}, #{idCardLast4}, #{faceRef}, #{sourceType},
#{status}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}, #{delFlag}
#{status}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}, #{delFlag},
#{avatar}, #{dutyLevel}
)
</insert>
<!-- 修改学员主档:仅覆盖传入的非空字段,userId/sourceType/status/delFlag 不在编辑范围 -->
<update id="updateTrainStudent" parameterType="TrainStudent">
update train_student
<trim prefix="SET" suffixOverrides=",">
<if test="sName != null">s_name = #{sName},</if>
<if test="sGender != null">s_gender = #{sGender},</if>
<if test="sBirth != null">s_birth = #{sBirth},</if>
<if test="orgName != null">org_name = #{orgName},</if>
<if test="sPhone != null">s_phone = #{sPhone},</if>
<if test="sEmail != null">s_email = #{sEmail},</if>
<if test="idCardCiphertext != null">id_card_ciphertext = #{idCardCiphertext},</if>
<if test="idCardHash != null">id_card_hash = #{idCardHash},</if>
<if test="idCardLast4 != null">id_card_last4 = #{idCardLast4},</if>
<if test="faceRef != null">face_ref = #{faceRef},</if>
<if test="avatar != null">avatar = #{avatar},</if>
<if test="dutyLevel != null">duty_level = #{dutyLevel},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = #{updateTime},
update_by = #{updateBy}
</trim>
where s_id = #{sId} and del_flag = '0'
</update>
<!-- 根据系统用户ID查询学员 (仅限未删除 del_flag = '0') -->
<select id="selectTrainStudentByUserId" parameterType="Long" resultMap="TrainStudentResult">
<include refid="selectTrainStudentDomain" />
@@ -21,10 +21,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="avatar" column="avatar" />
<result property="major" column="major" />
<result property="courses" column="courses" />
<result property="startTeaching" column="start_teaching" />
</resultMap>
<sql id="selectTrainTeacherVo">
select t_id, t_name, t_gender, t_birth, user_id, org_name, job_title, t_phone, t_email, status, del_flag, create_by, create_time, update_by, update_time, remark from train_teacher
select t_id, t_name, t_gender, t_birth, user_id, org_name, job_title, t_phone, t_email, status, del_flag, create_by, create_time, update_by, update_time, remark, avatar, major, courses, start_teaching from train_teacher
</sql>
<select id="selectTrainTeacherList" parameterType="TrainTeacher" resultMap="TrainTeacherResult">
@@ -39,6 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tPhone != null and tPhone != ''"> and t_phone like concat('%', #{tPhone}, '%')</if>
<if test="tEmail != null and tEmail != ''"> and t_email = #{tEmail}</if>
<if test="status != null"> and status = #{status}</if>
<if test="major != null and major != ''"> and major like concat('%', #{major}, '%')</if>
<if test="courses != null and courses != ''"> and courses like concat('%', #{courses}, '%')</if>
</where>
order by create_time desc
</select>
@@ -72,6 +78,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="avatar != null">avatar,</if>
<if test="major != null">major,</if>
<if test="courses != null">courses,</if>
<if test="startTeaching != null">start_teaching,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tId != null">#{tId},</if>
@@ -90,6 +100,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="avatar != null">#{avatar},</if>
<if test="major != null">#{major},</if>
<if test="courses != null">#{courses},</if>
<if test="startTeaching != null">#{startTeaching},</if>
</trim>
</insert>
@@ -108,6 +122,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="avatar != null">avatar = #{avatar},</if>
<if test="major != null">major = #{major},</if>
<if test="courses != null">courses = #{courses},</if>
<if test="startTeaching != null">start_teaching = #{startTeaching},</if>
</trim>
where t_id = #{tId} and del_flag = '0'
</update>
@@ -17,20 +17,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="major" column="major" />
<result property="seatArrange" column="seat_arrange" />
</resultMap>
<sql id="selectTrainTrainingSiteVo">
select site_id, site_name, site_location, capacity, site_device, site_status, del_flag, create_by, create_time, update_by, update_time, remark from train_training_site
select site_id, site_name, site_location, capacity, site_device, site_status, del_flag, create_by, create_time, update_by, update_time, remark, major, seat_arrange from train_training_site
</sql>
<select id="selectTrainTrainingSiteList" parameterType="TrainTrainingSite" resultMap="TrainTrainingSiteResult">
<include refid="selectTrainTrainingSiteVo"/>
where del_flag = '0'
<if test="siteName != null and siteName != ''"> and site_name like concat('%', #{siteName}, '%')</if>
<if test="siteLocation != null and siteLocation != ''"> and site_location = #{siteLocation}</if>
<if test="siteLocation != null and siteLocation != ''"> and site_location like concat('%', #{siteLocation}, '%')</if>
<if test="capacity != null "> and capacity = #{capacity}</if>
<if test="siteDevice != null and siteDevice != ''"> and site_device = #{siteDevice}</if>
<if test="siteStatus != null "> and site_status = #{siteStatus}</if>
<if test="major != null and major != ''"> and major like concat('%', #{major}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
order by create_time desc
</select>
@@ -64,6 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="major != null">major,</if>
<if test="seatArrange != null">seat_arrange,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="siteId != null">#{siteId},</if>
@@ -78,6 +83,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="major != null">#{major},</if>
<if test="seatArrange != null">#{seatArrange},</if>
</trim>
</insert>
@@ -93,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="major != null">major = #{major},</if>
<if test="seatArrange != null">seat_arrange = #{seatArrange},</if>
</trim>
where site_id = #{siteId}
</update>