fix:证明mapper中的文件是可以被重写的

上级 a780dec8
...@@ -9,8 +9,17 @@ import lombok.NoArgsConstructor; ...@@ -9,8 +9,17 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class InterviewQuestionTypeDTO { public class InterviewQuestionTypeDTO {
/**
* 问题类型编码
*/
private Integer questionType; private Integer questionType;
/**
* 问题类型名称
*/
private String name; private String name;
/**
* 问题类型数量
*/
private Integer typeSize; private Integer typeSize;
} }
...@@ -3,6 +3,7 @@ package com.kwan.springbootkwan.mapper; ...@@ -3,6 +3,7 @@ package com.kwan.springbootkwan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kwan.springbootkwan.entity.InterviewQuestion; import com.kwan.springbootkwan.entity.InterviewQuestion;
import com.kwan.springbootkwan.entity.dto.InterviewQuestionTypeDTO; import com.kwan.springbootkwan.entity.dto.InterviewQuestionTypeDTO;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList; import java.util.LinkedList;
...@@ -20,5 +21,12 @@ public interface InterviewQuestionMapper extends BaseMapper<InterviewQuestion> { ...@@ -20,5 +21,12 @@ public interface InterviewQuestionMapper extends BaseMapper<InterviewQuestion> {
* @return * @return
*/ */
LinkedList<InterviewQuestionTypeDTO> questionType(); LinkedList<InterviewQuestionTypeDTO> questionType();
/**
* 获取面试题的种类
*
* @return
*/
LinkedList<InterviewQuestionTypeDTO> questionType(@Param("id") String id);
} }
...@@ -64,6 +64,7 @@ public class InterviewQuestionServiceImpl extends ServiceImpl<InterviewQuestionM ...@@ -64,6 +64,7 @@ public class InterviewQuestionServiceImpl extends ServiceImpl<InterviewQuestionM
LinkedList<InterviewQuestionTypeDTO> types = interviewQuestionMapper.questionType(); LinkedList<InterviewQuestionTypeDTO> types = interviewQuestionMapper.questionType();
types.addFirst(new InterviewQuestionTypeDTO(0, "全部", 0)); types.addFirst(new InterviewQuestionTypeDTO(0, "全部", 0));
for (InterviewQuestionTypeDTO interviewQuestionTypeDTO : types) { for (InterviewQuestionTypeDTO interviewQuestionTypeDTO : types) {
//数据库存的是问题类型的编码
interviewQuestionTypeDTO.setName(InterviewQuestionTypeEnum.getNameByCode(interviewQuestionTypeDTO.getQuestionType())); interviewQuestionTypeDTO.setName(InterviewQuestionTypeEnum.getNameByCode(interviewQuestionTypeDTO.getQuestionType()));
} }
return types; return types;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册