Quellcode durchsuchen

添加 sim_real_exam_comp_request 相关。

tom vor 5 Monaten
Ursprung
Commit
c52573f060

+ 98 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamCompRequestController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.sim.controller;
+
+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.sim.domain.RealExamCompRequest;
+import com.ruoyi.sim.service.IRealExamCompRequestService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 考试更换件关联Controller
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+@RestController
+@RequestMapping("/sim/real-exam-comp-request")
+public class RealExamCompRequestController extends BaseController {
+    @Autowired
+    private IRealExamCompRequestService realExamCompRequestService;
+
+    /**
+     * 查询考试更换件关联列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(RealExamCompRequest realExamCompRequest) {
+        startPage();
+        List<RealExamCompRequest> list = realExamCompRequestService.selectRealExamCompRequestList(realExamCompRequest);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出考试更换件关联列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:export')")
+    @Log(title = "考试更换件关联", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, RealExamCompRequest realExamCompRequest) {
+        List<RealExamCompRequest> list = realExamCompRequestService.selectRealExamCompRequestList(realExamCompRequest);
+        ExcelUtil<RealExamCompRequest> util = new ExcelUtil<RealExamCompRequest>(RealExamCompRequest.class);
+        util.exportExcel(response, list, "考试更换件关联数据");
+    }
+
+    /**
+     * 获取考试更换件关联详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:query')")
+    @GetMapping(value = "/{relId}")
+    public AjaxResult getInfo(@PathVariable("relId") Long relId) {
+        return success(realExamCompRequestService.selectRealExamCompRequestByRelId(relId));
+    }
+
+    /**
+     * 新增考试更换件关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:add')")
+    @Log(title = "考试更换件关联", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody RealExamCompRequest realExamCompRequest) {
+        return toAjax(realExamCompRequestService.insertRealExamCompRequest(realExamCompRequest));
+    }
+
+    /**
+     * 修改考试更换件关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:edit')")
+    @Log(title = "考试更换件关联", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody RealExamCompRequest realExamCompRequest) {
+        return toAjax(realExamCompRequestService.updateRealExamCompRequest(realExamCompRequest));
+    }
+
+    /**
+     * 删除考试更换件关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:remove')")
+    @Log(title = "考试更换件关联", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{relIds}")
+    public AjaxResult remove(@PathVariable Long[] relIds) {
+        return toAjax(realExamCompRequestService.deleteRealExamCompRequestByRelIds(relIds));
+    }
+}

+ 119 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamCompRequest.java

@@ -0,0 +1,119 @@
+package com.ruoyi.sim.domain;
+
+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;
+
+/**
+ * 考试更换件关联对象 sim_real_exam_comp_request
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+public class RealExamCompRequest extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long relId;
+
+    /**
+     * 考试ID
+     */
+    @Excel(name = "考试ID")
+    private Long examId;
+
+    /**
+     * 故障ID
+     */
+    @Excel(name = "故障ID")
+    private String faultId;
+
+    /**
+     * 状态
+     * 1:已申请
+     * 2:已处理
+     * 3:已驳回
+     */
+    @Excel(name = "状态")
+    private String requestStatus;
+
+    /**
+     * 创建学员ID/用户ID
+     */
+    @Excel(name = "创建学员ID/用户ID")
+    private Long createByUserId;
+
+    /**
+     * 创建教师ID/用户ID
+     */
+    @Excel(name = "创建教师ID/用户ID")
+    private Long updateByUserId;
+
+    public void setRelId(Long relId) {
+        this.relId = relId;
+    }
+
+    public Long getRelId() {
+        return relId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setFaultId(String faultId) {
+        this.faultId = faultId;
+    }
+
+    public String getFaultId() {
+        return faultId;
+    }
+
+    public void setRequestStatus(String requestStatus) {
+        this.requestStatus = requestStatus;
+    }
+
+    public String getRequestStatus() {
+        return requestStatus;
+    }
+
+    public void setCreateByUserId(Long createByUserId) {
+        this.createByUserId = createByUserId;
+    }
+
+    public Long getCreateByUserId() {
+        return createByUserId;
+    }
+
+    public void setUpdateByUserId(Long updateByUserId) {
+        this.updateByUserId = updateByUserId;
+    }
+
+    public Long getUpdateByUserId() {
+        return updateByUserId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("relId", getRelId())
+                .append("examId", getExamId())
+                .append("faultId", getFaultId())
+                .append("requestStatus", getRequestStatus())
+                .append("createByUserId", getCreateByUserId())
+                .append("updateByUserId", getUpdateByUserId())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 61 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamCompRequestMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.sim.mapper;
+
+import java.util.List;
+
+import com.ruoyi.sim.domain.RealExamCompRequest;
+
+/**
+ * 考试更换件关联Mapper接口
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+public interface RealExamCompRequestMapper {
+    /**
+     * 查询考试更换件关联
+     *
+     * @param relId 考试更换件关联主键
+     * @return 考试更换件关联
+     */
+    public RealExamCompRequest selectRealExamCompRequestByRelId(Long relId);
+
+    /**
+     * 查询考试更换件关联列表
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 考试更换件关联集合
+     */
+    public List<RealExamCompRequest> selectRealExamCompRequestList(RealExamCompRequest realExamCompRequest);
+
+    /**
+     * 新增考试更换件关联
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 结果
+     */
+    public int insertRealExamCompRequest(RealExamCompRequest realExamCompRequest);
+
+    /**
+     * 修改考试更换件关联
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 结果
+     */
+    public int updateRealExamCompRequest(RealExamCompRequest realExamCompRequest);
+
+    /**
+     * 删除考试更换件关联
+     *
+     * @param relId 考试更换件关联主键
+     * @return 结果
+     */
+    public int deleteRealExamCompRequestByRelId(Long relId);
+
+    /**
+     * 批量删除考试更换件关联
+     *
+     * @param relIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRealExamCompRequestByRelIds(Long[] relIds);
+}

+ 61 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/IRealExamCompRequestService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.sim.service;
+
+import java.util.List;
+
+import com.ruoyi.sim.domain.RealExamCompRequest;
+
+/**
+ * 考试更换件关联Service接口
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+public interface IRealExamCompRequestService {
+    /**
+     * 查询考试更换件关联
+     *
+     * @param relId 考试更换件关联主键
+     * @return 考试更换件关联
+     */
+    public RealExamCompRequest selectRealExamCompRequestByRelId(Long relId);
+
+    /**
+     * 查询考试更换件关联列表
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 考试更换件关联集合
+     */
+    public List<RealExamCompRequest> selectRealExamCompRequestList(RealExamCompRequest realExamCompRequest);
+
+    /**
+     * 新增考试更换件关联
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 结果
+     */
+    public int insertRealExamCompRequest(RealExamCompRequest realExamCompRequest);
+
+    /**
+     * 修改考试更换件关联
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 结果
+     */
+    public int updateRealExamCompRequest(RealExamCompRequest realExamCompRequest);
+
+    /**
+     * 批量删除考试更换件关联
+     *
+     * @param relIds 需要删除的考试更换件关联主键集合
+     * @return 结果
+     */
+    public int deleteRealExamCompRequestByRelIds(Long[] relIds);
+
+    /**
+     * 删除考试更换件关联信息
+     *
+     * @param relId 考试更换件关联主键
+     * @return 结果
+     */
+    public int deleteRealExamCompRequestByRelId(Long relId);
+}

+ 90 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamCompRequestServiceImpl.java

@@ -0,0 +1,90 @@
+package com.ruoyi.sim.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.sim.mapper.RealExamCompRequestMapper;
+import com.ruoyi.sim.domain.RealExamCompRequest;
+import com.ruoyi.sim.service.IRealExamCompRequestService;
+
+/**
+ * 考试更换件关联Service业务层处理
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+@Service
+public class RealExamCompRequestServiceImpl implements IRealExamCompRequestService {
+    @Autowired
+    private RealExamCompRequestMapper realExamCompRequestMapper;
+
+    /**
+     * 查询考试更换件关联
+     *
+     * @param relId 考试更换件关联主键
+     * @return 考试更换件关联
+     */
+    @Override
+    public RealExamCompRequest selectRealExamCompRequestByRelId(Long relId) {
+        return realExamCompRequestMapper.selectRealExamCompRequestByRelId(relId);
+    }
+
+    /**
+     * 查询考试更换件关联列表
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 考试更换件关联
+     */
+    @Override
+    public List<RealExamCompRequest> selectRealExamCompRequestList(RealExamCompRequest realExamCompRequest) {
+        return realExamCompRequestMapper.selectRealExamCompRequestList(realExamCompRequest);
+    }
+
+    /**
+     * 新增考试更换件关联
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 结果
+     */
+    @Override
+    public int insertRealExamCompRequest(RealExamCompRequest realExamCompRequest) {
+        realExamCompRequest.setCreateTime(DateUtils.getNowDate());
+        return realExamCompRequestMapper.insertRealExamCompRequest(realExamCompRequest);
+    }
+
+    /**
+     * 修改考试更换件关联
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 结果
+     */
+    @Override
+    public int updateRealExamCompRequest(RealExamCompRequest realExamCompRequest) {
+        realExamCompRequest.setUpdateTime(DateUtils.getNowDate());
+        return realExamCompRequestMapper.updateRealExamCompRequest(realExamCompRequest);
+    }
+
+    /**
+     * 批量删除考试更换件关联
+     *
+     * @param relIds 需要删除的考试更换件关联主键
+     * @return 结果
+     */
+    @Override
+    public int deleteRealExamCompRequestByRelIds(Long[] relIds) {
+        return realExamCompRequestMapper.deleteRealExamCompRequestByRelIds(relIds);
+    }
+
+    /**
+     * 删除考试更换件关联信息
+     *
+     * @param relId 考试更换件关联主键
+     * @return 结果
+     */
+    @Override
+    public int deleteRealExamCompRequestByRelId(Long relId) {
+        return realExamCompRequestMapper.deleteRealExamCompRequestByRelId(relId);
+    }
+}

+ 111 - 0
ruoyi-sim/src/main/resources/mapper/sim/RealExamCompRequestMapper.xml

@@ -0,0 +1,111 @@
+<?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.sim.mapper.RealExamCompRequestMapper">
+
+    <resultMap type="RealExamCompRequest" id="RealExamCompRequestResult">
+        <result property="relId" column="rel_id"/>
+        <result property="examId" column="exam_id"/>
+        <result property="faultId" column="fault_id"/>
+        <result property="requestStatus" column="request_status"/>
+        <result property="createByUserId" column="create_by_user_id"/>
+        <result property="updateByUserId" column="update_by_user_id"/>
+        <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="selectRealExamCompRequestVo">
+        select rel_id,
+               exam_id,
+               fault_id,
+               request_status,
+               create_by_user_id,
+               update_by_user_id,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from sim_real_exam_comp_request
+    </sql>
+
+    <select id="selectRealExamCompRequestList" parameterType="RealExamCompRequest"
+            resultMap="RealExamCompRequestResult">
+        <include refid="selectRealExamCompRequestVo"/>
+        <where>
+            <if test="examId != null ">and exam_id = #{examId}</if>
+            <if test="faultId != null  and faultId != ''">and fault_id = #{faultId}</if>
+            <if test="requestStatus != null  and requestStatus != ''">and request_status = #{requestStatus}</if>
+            <if test="createByUserId != null ">and create_by_user_id = #{createByUserId}</if>
+            <if test="updateByUserId != null ">and update_by_user_id = #{updateByUserId}</if>
+        </where>
+    </select>
+
+    <select id="selectRealExamCompRequestByRelId" parameterType="Long" resultMap="RealExamCompRequestResult">
+        <include refid="selectRealExamCompRequestVo"/>
+        where rel_id = #{relId}
+    </select>
+
+    <insert id="insertRealExamCompRequest" parameterType="RealExamCompRequest" useGeneratedKeys="true"
+            keyProperty="relId">
+        insert into sim_real_exam_comp_request
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="examId != null">exam_id,</if>
+            <if test="faultId != null and faultId != ''">fault_id,</if>
+            <if test="requestStatus != null and requestStatus != ''">request_status,</if>
+            <if test="createByUserId != null">create_by_user_id,</if>
+            <if test="updateByUserId != null">update_by_user_id,</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>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="examId != null">#{examId},</if>
+            <if test="faultId != null and faultId != ''">#{faultId},</if>
+            <if test="requestStatus != null and requestStatus != ''">#{requestStatus},</if>
+            <if test="createByUserId != null">#{createByUserId},</if>
+            <if test="updateByUserId != null">#{updateByUserId},</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>
+        </trim>
+    </insert>
+
+    <update id="updateRealExamCompRequest" parameterType="RealExamCompRequest">
+        update sim_real_exam_comp_request
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="examId != null">exam_id = #{examId},</if>
+            <if test="faultId != null and faultId != ''">fault_id = #{faultId},</if>
+            <if test="requestStatus != null and requestStatus != ''">request_status = #{requestStatus},</if>
+            <if test="createByUserId != null">create_by_user_id = #{createByUserId},</if>
+            <if test="updateByUserId != null">update_by_user_id = #{updateByUserId},</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>
+        </trim>
+        where rel_id = #{relId}
+    </update>
+
+    <delete id="deleteRealExamCompRequestByRelId" parameterType="Long">
+        delete
+        from sim_real_exam_comp_request
+        where rel_id = #{relId}
+    </delete>
+
+    <delete id="deleteRealExamCompRequestByRelIds" parameterType="String">
+        delete from sim_real_exam_comp_request where rel_id in
+        <foreach item="relId" collection="array" open="(" separator="," close=")">
+            #{relId}
+        </foreach>
+    </delete>
+</mapper>