LIVE_YE преди 2 години
родител
ревизия
1fd91fbeb0

+ 116 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/course/CourseChangeController.java

@@ -0,0 +1,116 @@
+package com.ruoyi.web.controller.course;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+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.enums.BusinessType;
+import com.ruoyi.system.domain.CourseChange;
+import com.ruoyi.system.service.ICourseChangeService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 调课Controller
+ * 
+ * @author ruoyi
+ * @date 2023-06-02
+ */
+@RestController
+@RequestMapping("/course/change")
+public class CourseChangeController extends BaseController
+{
+    @Autowired
+    private ICourseChangeService courseChangeService;
+
+    /**
+     * 查询调课列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:change:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CourseChange courseChange)
+    {
+        startPage();
+        List<CourseChange> list = courseChangeService.selectCourseChangeList(courseChange);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出调课列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:change:export')")
+    @Log(title = "调课", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CourseChange courseChange)
+    {
+        List<CourseChange> list = courseChangeService.selectCourseChangeList(courseChange);
+        ExcelUtil<CourseChange> util = new ExcelUtil<CourseChange>(CourseChange.class);
+        util.exportExcel(response, list, "调课数据");
+    }
+
+    /**
+     * 获取调课详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('course:change:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(courseChangeService.selectCourseChangeById(id));
+    }
+
+    /**
+     * 新增调课
+     */
+    @PreAuthorize("@ss.hasPermi('course:change:add')")
+    @Log(title = "调课", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CourseChange courseChange)
+    {
+        return toAjax(courseChangeService.insertCourseChange(courseChange));
+    }
+
+    /**
+     * 修改调课
+     */
+    @PreAuthorize("@ss.hasPermi('course:change:edit')")
+    @Log(title = "调课", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody CourseChange courseChange)
+    {
+        return toAjax(courseChangeService.updateCourseChange(courseChange));
+    }
+
+
+    /**
+     * 回复调课
+     */
+    @PreAuthorize("@ss.hasPermi('course:change:reply')")
+    @Log(title = "调课", businessType = BusinessType.UPDATE)
+    @GetMapping("/reply")
+    public AjaxResult reply(CourseChange courseChange)
+    {
+        return courseChangeService.updateCourseChangeReply(courseChange);
+    }
+
+    /**
+     * 删除调课
+     */
+    @PreAuthorize("@ss.hasPermi('course:change:remove')")
+    @Log(title = "调课", businessType = BusinessType.DELETE)
+	@GetMapping("/delete/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(courseChangeService.deleteCourseChangeByIds(ids));
+    }
+}

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/course/CourseTableController.java

@@ -101,4 +101,6 @@ public class CourseTableController extends BaseController
     {
         return toAjax(courseTableService.deleteCourseTableByIds(ids));
     }
+
+
 }

+ 239 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/CourseChange.java

@@ -0,0 +1,239 @@
+package com.ruoyi.system.domain;
+
+import java.util.Date;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+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;
+
+/**
+ * 调课对象 course_change
+ * 
+ * @author ruoyi
+ * @date 2023-06-02
+ */
+public class CourseChange extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long id;
+
+    /** 申请人id */
+    @Excel(name = "申请人id")
+    private Long applyId;
+
+    /** 申请人 */
+    @Excel(name = "申请人")
+    private String applyName;
+
+    /** 申请时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date applyTime;
+
+    /** 调课班级id */
+    @Excel(name = "调课班级id")
+    private Long subjectClassId;
+
+    /** 调课班级 */
+    @Excel(name = "调课班级")
+    private String subjectClass;
+
+    /** 调课科目 */
+    @Excel(name = "调课科目")
+    private String subject;
+
+    /** 被调科目 */
+    @Excel(name = "被调科目")
+    private String beSubject;
+
+    /** 周几 */
+    @Excel(name = "周几")
+    private String week;
+
+    /** 结果(1:待审核,2:同意,3:不同意) */
+    @Excel(name = "结果", readConverterExp = "1=:待审核,2:同意,3:不同意")
+    private String isPass;
+
+    /** 内容描述 */
+    @Excel(name = "内容描述")
+    private String content;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private Long auditId;
+
+    /** 审核人 */
+    @Excel(name = "审核人")
+    private String auditUser;
+
+    /** 审核意见 */
+    @Excel(name = "审核意见")
+    private String opinion;
+
+    private List<Long> subjectClassIds;
+
+    public List<Long> getSubjectClassIds() {
+        return subjectClassIds;
+    }
+
+    public void setSubjectClassIds(List<Long> subjectClassIds) {
+        this.subjectClassIds = subjectClassIds;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setApplyId(Long applyId) 
+    {
+        this.applyId = applyId;
+    }
+
+    public Long getApplyId() 
+    {
+        return applyId;
+    }
+    public void setApplyName(String applyName) 
+    {
+        this.applyName = applyName;
+    }
+
+    public String getApplyName() 
+    {
+        return applyName;
+    }
+    public void setApplyTime(Date applyTime) 
+    {
+        this.applyTime = applyTime;
+    }
+
+    public Date getApplyTime() 
+    {
+        return applyTime;
+    }
+    public void setSubjectClassId(Long subjectClassId)
+    {
+        this.subjectClassId = subjectClassId;
+    }
+
+    public Long getSubjectClassId()
+    {
+        return subjectClassId;
+    }
+    public void setSubjectClass(String subjectClass) 
+    {
+        this.subjectClass = subjectClass;
+    }
+
+    public String getSubjectClass() 
+    {
+        return subjectClass;
+    }
+    public void setSubject(String subject) 
+    {
+        this.subject = subject;
+    }
+
+    public String getSubject() 
+    {
+        return subject;
+    }
+    public void setBeSubject(String beSubject) 
+    {
+        this.beSubject = beSubject;
+    }
+
+    public String getBeSubject() 
+    {
+        return beSubject;
+    }
+    public void setWeek(String week) 
+    {
+        this.week = week;
+    }
+
+    public String getWeek() 
+    {
+        return week;
+    }
+    public void setIsPass(String isPass) 
+    {
+        this.isPass = isPass;
+    }
+
+    public String getIsPass() 
+    {
+        return isPass;
+    }
+    public void setContent(String content) 
+    {
+        this.content = content;
+    }
+
+    public String getContent() 
+    {
+        return content;
+    }
+    public void setAuditId(Long auditId) 
+    {
+        this.auditId = auditId;
+    }
+
+    public Long getAuditId() 
+    {
+        return auditId;
+    }
+    public void setAuditUser(String auditUser) 
+    {
+        this.auditUser = auditUser;
+    }
+
+    public String getAuditUser() 
+    {
+        return auditUser;
+    }
+    public void setOpinion(String opinion) 
+    {
+        this.opinion = opinion;
+    }
+
+    public String getOpinion() 
+    {
+        return opinion;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("applyId", getApplyId())
+            .append("applyName", getApplyName())
+            .append("applyTime", getApplyTime())
+            .append("subjectClassId", getSubjectClassId())
+            .append("subjectClass", getSubjectClass())
+            .append("subject", getSubject())
+            .append("beSubject", getBeSubject())
+            .append("week", getWeek())
+            .append("isPass", getIsPass())
+            .append("content", getContent())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .append("auditId", getAuditId())
+            .append("auditUser", getAuditUser())
+            .append("opinion", getOpinion())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CourseChangeMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.CourseChange;
+
+/**
+ * 调课Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-06-02
+ */
+public interface CourseChangeMapper 
+{
+    /**
+     * 查询调课
+     * 
+     * @param id 调课主键
+     * @return 调课
+     */
+    public CourseChange selectCourseChangeById(Long id);
+
+    /**
+     * 查询调课列表
+     * 
+     * @param courseChange 调课
+     * @return 调课集合
+     */
+    public List<CourseChange> selectCourseChangeList(CourseChange courseChange);
+
+    /**
+     * 新增调课
+     * 
+     * @param courseChange 调课
+     * @return 结果
+     */
+    public int insertCourseChange(CourseChange courseChange);
+
+    /**
+     * 修改调课
+     * 
+     * @param courseChange 调课
+     * @return 结果
+     */
+    public int updateCourseChange(CourseChange courseChange);
+
+    /**
+     * 删除调课
+     * 
+     * @param id 调课主键
+     * @return 结果
+     */
+    public int deleteCourseChangeById(Long id);
+
+    /**
+     * 批量删除调课
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCourseChangeByIds(Long[] ids);
+}

+ 65 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ICourseChangeService.java

@@ -0,0 +1,65 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.domain.CourseChange;
+
+/**
+ * 调课Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-06-02
+ */
+public interface ICourseChangeService 
+{
+    /**
+     * 查询调课
+     * 
+     * @param id 调课主键
+     * @return 调课
+     */
+    public CourseChange selectCourseChangeById(Long id);
+
+    /**
+     * 查询调课列表
+     * 
+     * @param courseChange 调课
+     * @return 调课集合
+     */
+    public List<CourseChange> selectCourseChangeList(CourseChange courseChange);
+
+    /**
+     * 新增调课
+     * 
+     * @param courseChange 调课
+     * @return 结果
+     */
+    public int insertCourseChange(CourseChange courseChange);
+
+    /**
+     * 修改调课
+     * 
+     * @param courseChange 调课
+     * @return 结果
+     */
+    public int updateCourseChange(CourseChange courseChange);
+
+    /**
+     * 批量删除调课
+     * 
+     * @param ids 需要删除的调课主键集合
+     * @return 结果
+     */
+    public int deleteCourseChangeByIds(Long[] ids);
+
+    /**
+     * 删除调课信息
+     * 
+     * @param id 调课主键
+     * @return 结果
+     */
+    public int deleteCourseChangeById(Long id);
+
+    AjaxResult updateCourseChangeReply(CourseChange courseChange);
+}

+ 147 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CourseChangeServiceImpl.java

@@ -0,0 +1,147 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.FormalTeacherClass;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.mapper.FormalTeacherClassMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.CourseChangeMapper;
+import com.ruoyi.system.domain.CourseChange;
+import com.ruoyi.system.service.ICourseChangeService;
+
+/**
+ * 调课Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-06-02
+ */
+@Service
+public class CourseChangeServiceImpl implements ICourseChangeService 
+{
+    @Autowired
+    private CourseChangeMapper courseChangeMapper;
+    @Autowired
+    private FormalTeacherClassMapper formalTeacherClassMapper;
+
+    /**
+     * 查询调课
+     * 
+     * @param id 调课主键
+     * @return 调课
+     */
+    @Override
+    public CourseChange selectCourseChangeById(Long id)
+    {
+        return courseChangeMapper.selectCourseChangeById(id);
+    }
+
+    /**
+     * 查询调课列表
+     * 
+     * @param courseChange 调课
+     * @return 调课
+     */
+    @Override
+    public List<CourseChange> selectCourseChangeList(CourseChange courseChange)
+    {
+
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        List<SysRole> roles = user.getRoles();
+        boolean bl = false;
+        for (SysRole role : roles) {
+            if("teacher".equals(role.getRoleKey())){
+                bl = true;
+                break;
+            }
+        }
+        //角色是老师
+        if(bl){
+            //查询老师班级
+            FormalTeacherClass formalTeacherClass = new FormalTeacherClass();
+            formalTeacherClass.setTeacherId(user.getUserId());
+            List<FormalTeacherClass> formalTeacherClassList = formalTeacherClassMapper.selectFormalTeacherClassList(formalTeacherClass);
+            List<Long> classIds = formalTeacherClassList.stream().map(FormalTeacherClass::getClassId).collect(Collectors.toList());
+            courseChange.setSubjectClassIds(classIds);
+        }
+
+        return courseChangeMapper.selectCourseChangeList(courseChange);
+    }
+
+    /**
+     * 新增调课
+     * 
+     * @param courseChange 调课
+     * @return 结果
+     */
+    @Override
+    public int insertCourseChange(CourseChange courseChange)
+    {
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        courseChange.setApplyId(user.getUserId());
+        courseChange.setApplyName(user.getNickName());
+        courseChange.setCreateTime(DateUtils.getNowDate());
+        return courseChangeMapper.insertCourseChange(courseChange);
+    }
+
+    /**
+     * 修改调课
+     * 
+     * @param courseChange 调课
+     * @return 结果
+     */
+    @Override
+    public int updateCourseChange(CourseChange courseChange)
+    {
+        courseChange.setUpdateTime(DateUtils.getNowDate());
+        return courseChangeMapper.updateCourseChange(courseChange);
+    }
+
+    /**
+     * 批量删除调课
+     * 
+     * @param ids 需要删除的调课主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCourseChangeByIds(Long[] ids)
+    {
+        return courseChangeMapper.deleteCourseChangeByIds(ids);
+    }
+
+    /**
+     * 删除调课信息
+     * 
+     * @param id 调课主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCourseChangeById(Long id)
+    {
+        return courseChangeMapper.deleteCourseChangeById(id);
+    }
+
+    @Override
+    public AjaxResult updateCourseChangeReply(CourseChange courseChange) {
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        //判断当前老师是否有权限回复该信息
+        FormalTeacherClass formalTeacherClass = new FormalTeacherClass();
+        formalTeacherClass.setTeacherId(user.getUserId());
+        formalTeacherClass.setClassId(courseChange.getSubjectClassId());
+        formalTeacherClass.setDiscipline(courseChange.getBeSubject());
+        List<FormalTeacherClass> formalTeacherClassList = formalTeacherClassMapper.selectFormalTeacherClassList(formalTeacherClass);
+        if(formalTeacherClassList == null || formalTeacherClassList.size()<=0){
+            return AjaxResult.error("请回复自己授课的班级与课程");
+        }
+        courseChange.setAuditId(user.getUserId());
+        courseChange.setAuditUser(user.getNickName());
+        courseChange.setCreateTime(DateUtils.getNowDate());
+        return AjaxResult.success();
+    }
+}

+ 142 - 0
ruoyi-system/src/main/resources/mapper/system/CourseChangeMapper.xml

@@ -0,0 +1,142 @@
+<?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.system.mapper.CourseChangeMapper">
+    
+    <resultMap type="CourseChange" id="CourseChangeResult">
+        <result property="id"    column="id"    />
+        <result property="applyId"    column="apply_id"    />
+        <result property="applyName"    column="apply_name"    />
+        <result property="applyTime"    column="apply_time"    />
+        <result property="subjectClassId"    column="subject_class_id"    />
+        <result property="subjectClass"    column="subject_class"    />
+        <result property="subject"    column="subject"    />
+        <result property="beSubject"    column="be_subject"    />
+        <result property="week"    column="week"    />
+        <result property="isPass"    column="is_pass"    />
+        <result property="content"    column="content"    />
+        <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"    />
+        <result property="auditId"    column="audit_id"    />
+        <result property="auditUser"    column="audit_user"    />
+        <result property="opinion"    column="opinion"    />
+    </resultMap>
+
+    <sql id="selectCourseChangeVo">
+        select id, apply_id, apply_name, apply_time, subject_class_id, subject_class, subject, be_subject, week, is_pass, content, create_by, create_time, update_by, update_time, remark, audit_id, audit_user, opinion from course_change
+    </sql>
+
+    <select id="selectCourseChangeList" parameterType="CourseChange" resultMap="CourseChangeResult">
+        <include refid="selectCourseChangeVo"/>
+        <where>  
+            <if test="applyId != null "> and apply_id = #{applyId}</if>
+            <if test="applyName != null  and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
+            <if test="applyTime != null "> and apply_time = #{applyTime}</if>
+            <if test="subjectClassId != null  "> and subject_class_id = #{subjectClassId}</if>
+            <if test="subjectClass != null  and subjectClass != ''"> and subject_class = #{subjectClass}</if>
+            <if test="subject != null  and subject != ''"> and subject = #{subject}</if>
+            <if test="beSubject != null  and beSubject != ''"> and be_subject = #{beSubject}</if>
+            <if test="week != null  and week != ''"> and week = #{week}</if>
+            <if test="isPass != null  and isPass != ''"> and is_pass = #{isPass}</if>
+            <if test="content != null  and content != ''"> and content = #{content}</if>
+            <if test="auditId != null "> and audit_id = #{auditId}</if>
+            <if test="auditUser != null  and auditUser != ''"> and audit_user = #{auditUser}</if>
+            <if test="opinion != null  and opinion != ''"> and opinion = #{opinion}</if>
+            <if test="subjectClassIds != null  and subjectClassIds.size()>0">
+                and subject_class_id in
+                <foreach collection="subjectClassIds" index="index" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+    </select>
+    
+    <select id="selectCourseChangeById" parameterType="Long" resultMap="CourseChangeResult">
+        <include refid="selectCourseChangeVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertCourseChange" parameterType="CourseChange" useGeneratedKeys="true" keyProperty="id">
+        insert into course_change
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="applyId != null">apply_id,</if>
+            <if test="applyName != null">apply_name,</if>
+            <if test="applyTime != null">apply_time,</if>
+            <if test="subjectClassId != null">subject_class_id,</if>
+            <if test="subjectClass != null">subject_class,</if>
+            <if test="subject != null">subject,</if>
+            <if test="beSubject != null">be_subject,</if>
+            <if test="week != null">week,</if>
+            <if test="isPass != null">is_pass,</if>
+            <if test="content != null">content,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+            <if test="auditId != null">audit_id,</if>
+            <if test="auditUser != null">audit_user,</if>
+            <if test="opinion != null">opinion,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="applyId != null">#{applyId},</if>
+            <if test="applyName != null">#{applyName},</if>
+            <if test="applyTime != null">#{applyTime},</if>
+            <if test="subjectClassId != null">#{subjectClassId},</if>
+            <if test="subjectClass != null">#{subjectClass},</if>
+            <if test="subject != null">#{subject},</if>
+            <if test="beSubject != null">#{beSubject},</if>
+            <if test="week != null">#{week},</if>
+            <if test="isPass != null">#{isPass},</if>
+            <if test="content != null">#{content},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="auditId != null">#{auditId},</if>
+            <if test="auditUser != null">#{auditUser},</if>
+            <if test="opinion != null">#{opinion},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCourseChange" parameterType="CourseChange">
+        update course_change
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="applyId != null">apply_id = #{applyId},</if>
+            <if test="applyName != null">apply_name = #{applyName},</if>
+            <if test="applyTime != null">apply_time = #{applyTime},</if>
+            <if test="subjectClassId != null">subject_class_id = #{subjectClassId},</if>
+            <if test="subjectClass != null">subject_class = #{subjectClass},</if>
+            <if test="subject != null">subject = #{subject},</if>
+            <if test="beSubject != null">be_subject = #{beSubject},</if>
+            <if test="week != null">week = #{week},</if>
+            <if test="isPass != null">is_pass = #{isPass},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="auditId != null">audit_id = #{auditId},</if>
+            <if test="auditUser != null">audit_user = #{auditUser},</if>
+            <if test="opinion != null">opinion = #{opinion},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCourseChangeById" parameterType="Long">
+        delete from course_change where id = #{id}
+    </delete>
+
+    <delete id="deleteCourseChangeByIds" parameterType="String">
+        delete from course_change where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>