| | |
| | | |
| | | VALID("0", "有效"), |
| | | INVALID("1", "无效"), |
| | | DEPRIVATION("2", "取消补考资格"), |
| | | ; |
| | | |
| | | |
| | | @EnumValue // 标明该字段存入数据库 |
| | | private final String code; |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mindskip.xzs.domain.QuestionAnswer; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | /** |
| | | * @author gonghl |
| | |
| | | @Mapper |
| | | public interface QuestionAnswerMapper extends BaseMapper<QuestionAnswer> { |
| | | |
| | | /** |
| | | * 新增时获取目前最大序列 |
| | | * @return 序号 |
| | | */ |
| | | @Select("select ifnull(max(sequence), 1) from t_question_answer") |
| | | Integer getLastSequence(); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author gonghl |
| | |
| | | |
| | | @Override |
| | | public Integer getLastSequence() { |
| | | QuestionAnswer one = new LambdaQueryChainWrapper<>(questionAnswerMapper) |
| | | .orderByDesc(QuestionAnswer::getSequence) |
| | | .last("limit 1") |
| | | .one(); |
| | | return Objects.isNull(one) ? 1 : one.getSequence() + 1; |
| | | return questionAnswerMapper.getLastSequence(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | <update id="setMissExam"> |
| | | update t_exam_paper_answer |
| | | set invalid = 1 |
| | | set invalid = 2 |
| | | where exam_paper_id = #{examPaperId} |
| | | and create_user in ( |
| | | <foreach collection="userIds" item="item" index="index" separator=","> |
| | |
| | | |
| | | <update id="setMissExamByTemplate"> |
| | | update t_exam_paper_answer |
| | | set invalid = 1 |
| | | set invalid = 2 |
| | | where exam_paper_id |
| | | in |
| | | <foreach collection="paperIds" item="item" separator="," open="(" close=")"> |
| | |
| | | (#{item.examPaperId},#{item.userId}) |
| | | </foreach> |
| | | </if> |
| | | and (invalid = 0 or invalid is null) |
| | | and (invalid = 0 or invalid is null or invalid = 2) |
| | | </select> |
| | | <select id="adminPageByGrade" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.paper.ExamPaperGradePageRequestVM"> |
| | | select |