【新增】 学生端上传文件 学号-试卷ID-文件Url
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package pc.exam.pp.module.exam.dal.dataobject.student;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import pc.exam.pp.framework.tenant.core.db.TenantBaseDO;
|
||||
|
||||
/**
|
||||
* 学生-试卷-文件表 DO
|
||||
*
|
||||
* @author rwb
|
||||
*/
|
||||
@TableName("exam_stu_paper_fileurl")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StuPaperFileDO extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 学生号
|
||||
*/
|
||||
private Long stuId;
|
||||
/**
|
||||
* 试卷ID
|
||||
*/
|
||||
private String paperId;
|
||||
/**
|
||||
* 学生文件URL
|
||||
*/
|
||||
private String url;
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package pc.exam.pp.module.exam.dal.mysql.student;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import pc.exam.pp.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
|
||||
|
||||
/**
|
||||
* 学生-试卷-文件 Mapper
|
||||
*
|
||||
* @author rwb
|
||||
*/
|
||||
@Mapper
|
||||
public interface StuPaperFileMapper extends BaseMapperX<StuPaperFileDO> {
|
||||
StuPaperFileDO findByStuIdAndPaperId(@Param("stuId") Long stuId, @Param("paperId") String paperId);
|
||||
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package pc.exam.pp.module.exam.service.stu_paper_file;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import pc.exam.pp.framework.common.pojo.PageResult;
|
||||
import pc.exam.pp.module.exam.controller.admin.student.vo.StudentPageReqVO;
|
||||
import pc.exam.pp.module.exam.controller.admin.student.vo.StudentSaveReqVO;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.student.StudentDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学生-试卷-文件 Service 接口
|
||||
*
|
||||
* @author rwb
|
||||
*/
|
||||
public interface StuPaperFileService {
|
||||
|
||||
StuPaperFileDO findByStuIDAndPaperId(Long stuID, String paperID);
|
||||
|
||||
void insertStuPaperFile(StuPaperFileDO stuPaperFileDO);
|
||||
|
||||
void updateStuPaperFile(StuPaperFileDO stuPaperFileDO);
|
||||
}
|
@@ -0,0 +1,35 @@
|
||||
package pc.exam.pp.module.exam.service.stu_paper_file;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
|
||||
import pc.exam.pp.module.exam.dal.mysql.student.StuPaperFileMapper;
|
||||
|
||||
/**
|
||||
* 学生-试卷-文件 Service 实现类
|
||||
*
|
||||
* @author rwb
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class StuPaperFileServiceImpl implements StuPaperFileService {
|
||||
|
||||
@Resource
|
||||
private StuPaperFileMapper stuPaperFileMapper;
|
||||
|
||||
@Override
|
||||
public StuPaperFileDO findByStuIDAndPaperId(Long stuID, String paperID) {
|
||||
return stuPaperFileMapper.findByStuIdAndPaperId(stuID, paperID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertStuPaperFile(StuPaperFileDO stuPaperFileDO) {
|
||||
stuPaperFileMapper.insert(stuPaperFileDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStuPaperFile(StuPaperFileDO stuPaperFileDO) {
|
||||
stuPaperFileMapper.updateById(stuPaperFileDO);
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?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="pc.exam.pp.module.exam.dal.mysql.student.StuPaperFileMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
<select id="findByStuIdAndPaperId" resultType="pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO">
|
||||
SELECT * FROM exam_stu_paper_fileurl WHERE stu_id = #{stuId} AND paper_id = #{paperId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user