理论试题管理
This commit is contained in:
parent
226d5d62b1
commit
2d2d0fc459
@ -817,4 +817,12 @@ public interface BusinessConsts {
|
||||
/** 关闭自动调度 */
|
||||
REGULATION_OFF,
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据库数据逻辑删除标识
|
||||
*/
|
||||
enum DBLogicDelete{
|
||||
NORMAL,
|
||||
DELETE,
|
||||
}
|
||||
}
|
||||
|
@ -6,24 +6,23 @@ import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.question.QuestionQueryVO;
|
||||
import club.joylink.rtss.vo.client.question.v2.QuestionVO2;
|
||||
import club.joylink.rtss.vo.client.question.v2.PaperQuestionVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
*题库管理接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(path = "/api/questionBank2")
|
||||
public class QuestionBankController2 {
|
||||
@RequestMapping(path = "/api/pager_question")
|
||||
public class TheoryQuestionBankController2 {
|
||||
|
||||
/*@Autowired
|
||||
private IQuestionBankService iQuestionBankService;*/
|
||||
|
||||
@Autowired
|
||||
private QuestionBankService2 questionBankService;
|
||||
@ -31,7 +30,7 @@ public class QuestionBankController2 {
|
||||
*分页查询题目
|
||||
*/
|
||||
@GetMapping(path = "/questions/paging")
|
||||
public PageVO<QuestionVO2> pagingQueryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) {
|
||||
public PageVO<PaperQuestionVO> pagingQueryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) {
|
||||
queryVO.setProjectCode(loginInfo.getProject().name());
|
||||
return questionBankService.pagingQueryQuestions(queryVO);
|
||||
}
|
||||
@ -40,7 +39,7 @@ public class QuestionBankController2 {
|
||||
*查询题目列表
|
||||
*/
|
||||
@GetMapping(path = "/questions")
|
||||
public List<QuestionVO2> queryQuestions(@RequestAttribute LoginUserInfoVO loginInfo,QuestionQueryVO queryVO) {
|
||||
public List<PaperQuestionVO> queryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) {
|
||||
queryVO.setProjectCode(loginInfo.getProject().name());
|
||||
return questionBankService.queryQuestions(queryVO);
|
||||
}
|
||||
@ -49,7 +48,7 @@ public class QuestionBankController2 {
|
||||
*获取题目信息
|
||||
*/
|
||||
@GetMapping(path = "/questions/{questionId}")
|
||||
public QuestionVO2 getQuestion(@PathVariable Long questionId) {
|
||||
public PaperQuestionVO getQuestion(@PathVariable Long questionId) {
|
||||
return questionBankService.getQuestion(questionId);
|
||||
}
|
||||
|
||||
@ -57,7 +56,7 @@ public class QuestionBankController2 {
|
||||
*添加题目
|
||||
*/
|
||||
@PostMapping(path = "/questions")
|
||||
public void addQuestion(@Validated @RequestBody QuestionVO2 questionVO, @RequestAttribute LoginUserInfoVO loginInfo,
|
||||
public void addQuestion(@Validated @RequestBody PaperQuestionVO questionVO, @RequestAttribute LoginUserInfoVO loginInfo,
|
||||
@RequestAttribute AccountVO user) {
|
||||
questionVO.setProjectCode(loginInfo.getProject().name());
|
||||
questionBankService.saveOrUpdate(questionVO, user);
|
||||
@ -67,7 +66,7 @@ public class QuestionBankController2 {
|
||||
*导入项目或单位试题库
|
||||
*/
|
||||
@PostMapping(path = "/questions/import")
|
||||
public void importProjectQuestion(@Validated @RequestBody List<QuestionVO2> questions, @RequestAttribute LoginUserInfoVO loginInfo,
|
||||
public void importProjectQuestion(@Validated @RequestBody List<PaperQuestionVO> questions, @RequestAttribute LoginUserInfoVO loginInfo,
|
||||
@RequestAttribute AccountVO user, @RequestParam(required = false, name = "id") Long companyId) {
|
||||
|
||||
questionBankService.importProjectQuestion(questions, loginInfo.getProject().name(), companyId,user);
|
||||
@ -84,14 +83,14 @@ public class QuestionBankController2 {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据标签查询所有的题型
|
||||
* 根据标签查询所有的题型
|
||||
* @param companyId
|
||||
* @param raceLable
|
||||
* @param raceMap
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path="/questions/{companyId}/question")
|
||||
public List<QuestionVO2> findByLable(@PathVariable Long companyId, @RequestParam(value = "raceLable") String raceLable){
|
||||
return this.questionBankService.queryQuestionsForRaceLable(companyId,raceLable);
|
||||
@PostMapping(path="/questions/{companyId}/question")
|
||||
public List<PaperQuestionVO> findByLable(@PathVariable Long companyId, @RequestBody Map<String,String> raceMap){
|
||||
return this.questionBankService.queryQuestionsForRaceLable(companyId,raceMap);
|
||||
|
||||
}
|
||||
|
||||
@ -103,7 +102,7 @@ public class QuestionBankController2 {
|
||||
* @param user
|
||||
*/
|
||||
@PutMapping(path = "/questions/{questionId}")
|
||||
public void updateQuestion(@PathVariable Long questionId, @RequestAttribute LoginUserInfoVO loginInfo,@RequestBody QuestionVO2 questionVO,@RequestAttribute AccountVO user) {
|
||||
public void updateQuestion(@PathVariable Long questionId, @RequestAttribute LoginUserInfoVO loginInfo, @RequestBody PaperQuestionVO questionVO, @RequestAttribute AccountVO user) {
|
||||
questionVO.setId(questionId);
|
||||
questionVO.setProjectCode(loginInfo.getProject().name());
|
||||
questionBankService.saveOrUpdate(questionVO,user);
|
||||
@ -112,8 +111,8 @@ public class QuestionBankController2 {
|
||||
/**
|
||||
*删除题目
|
||||
*/
|
||||
@DeleteMapping(path = "/questions/{questionId}")
|
||||
public void deleteQuestion(@PathVariable Long questionId) {
|
||||
@DeleteMapping(path = "/questions")
|
||||
public void deleteQuestion(@RequestBody List<Long> questionId) {
|
||||
questionBankService.deleteQuestion(questionId);
|
||||
}
|
||||
|
28
src/main/java/club/joylink/rtss/dao/PagerQuestionDAO.java
Normal file
28
src/main/java/club/joylink/rtss/dao/PagerQuestionDAO.java
Normal file
@ -0,0 +1,28 @@
|
||||
package club.joylink.rtss.dao;
|
||||
|
||||
import club.joylink.rtss.constants.BusinessConsts;
|
||||
import club.joylink.rtss.entity.question.PaperQuestion;
|
||||
import club.joylink.rtss.entity.question.PaperQuestionExample;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PagerQuestionDAO extends MyBatisBaseDao<PaperQuestion, Long, PaperQuestionExample>{
|
||||
@Select("<script>" +
|
||||
"select race_lable from paper_question where company_id = #{companyId,jdbcType=BIGINT} group by race_lable" +
|
||||
"</script>")
|
||||
List<String> findAllLableByCompanyId(Long companyId);
|
||||
|
||||
@Select("<script>" +
|
||||
"select * from paper_question where company_id = #{companyId,jdbcType=BIGINT} and is_del= #{isDelete,jdbcType=INTEGER}" +
|
||||
" and <foreach collection=\"lable\" open=\"(\" close=\")\" item=\"d\" separator=\"or\"> "+
|
||||
" find_in_set(#{d},race_lable) > 0 "+
|
||||
"</foreach></script>")
|
||||
List<PaperQuestion> findByCompanyIdAndRaceLable(Long companyId,int isDelete, List<String> lable);
|
||||
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package club.joylink.rtss.dao;
|
||||
|
||||
import club.joylink.rtss.entity.race2.RaceQuestion2;
|
||||
import club.joylink.rtss.entity.race2.RaceQuestion2Example;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface RaceQuestion2DAO extends MyBatisBaseDao<RaceQuestion2, Long, RaceQuestion2Example>{
|
||||
@Select(" <select>" +
|
||||
"select count(id) from race_question2 where id = #{id,jdbcType=BIGINT}" +
|
||||
" </select>")
|
||||
Long checkExistByPK(Long id);
|
||||
@Select("<script>" +
|
||||
"select race_lable from race_question2 where company_id = #{companyId,jdbcType=BIGINT} group by race_lable" +
|
||||
"</script>")
|
||||
List<String> findAllLableByCompanyId(Long companyId);
|
||||
|
||||
@Select("<script>" +
|
||||
"select * from race_question2 where company_id = #{companyId,jdbcType=BIGINT} and find_in_set(#{lable,jdbcType=VARCHAR},race_lable) > 0" +
|
||||
"</script>")
|
||||
List<RaceQuestion2> findByCompanyIdAndRaceLable(Long companyId,String lable);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package club.joylink.rtss.entity.race2;
|
||||
package club.joylink.rtss.entity.question;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
@ -10,8 +10,7 @@ import lombok.Data;
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class RaceQuestion2 implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class PaperQuestion implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ -46,7 +45,13 @@ public class RaceQuestion2 implements Serializable {
|
||||
* 标签
|
||||
*/
|
||||
private String raceLable;
|
||||
|
||||
/**
|
||||
* 是否删除0=否,1=是
|
||||
*/
|
||||
private Integer isDel;
|
||||
private String topic;
|
||||
|
||||
private String questions;
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
package club.joylink.rtss.entity.race2;
|
||||
package club.joylink.rtss.entity.question;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class RaceQuestion2Example {
|
||||
public class PaperQuestionExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
@ -15,7 +15,7 @@ public class RaceQuestion2Example {
|
||||
|
||||
private Long offset;
|
||||
|
||||
public RaceQuestion2Example() {
|
||||
public PaperQuestionExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
@ -224,6 +224,7 @@ public class RaceQuestion2Example {
|
||||
addCriterion("`type` <=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTopicLike(String value) {
|
||||
addCriterion("`topic` like", value, "topic");
|
||||
return (Criteria) this;
|
||||
@ -577,6 +578,66 @@ public class RaceQuestion2Example {
|
||||
addCriterion("race_lable not between", value1, value2, "raceLable");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelIsNull() {
|
||||
addCriterion("is_del is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelIsNotNull() {
|
||||
addCriterion("is_del is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelEqualTo(Integer value) {
|
||||
addCriterion("is_del =", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelNotEqualTo(Integer value) {
|
||||
addCriterion("is_del <>", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelGreaterThan(Integer value) {
|
||||
addCriterion("is_del >", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("is_del >=", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelLessThan(Integer value) {
|
||||
addCriterion("is_del <", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("is_del <=", value, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelIn(List<Integer> values) {
|
||||
addCriterion("is_del in", values, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelNotIn(List<Integer> values) {
|
||||
addCriterion("is_del not in", values, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelBetween(Integer value1, Integer value2) {
|
||||
addCriterion("is_del between", value1, value2, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDelNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("is_del not between", value1, value2, "isDel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
@ -1,4 +1,4 @@
|
||||
package club.joylink.rtss.entity.race2;
|
||||
package club.joylink.rtss.entity.question;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
@ -8,7 +8,7 @@ import lombok.Data;
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class RaceQuestion2WithBLOBs extends RaceQuestion2 implements Serializable {
|
||||
public class PaperQuestionWithBLOBs extends PaperQuestion implements Serializable {
|
||||
/**
|
||||
* 问题内容
|
||||
*/
|
@ -2,17 +2,19 @@ package club.joylink.rtss.services.completition.question;
|
||||
|
||||
import club.joylink.rtss.constants.BusinessConsts;
|
||||
import club.joylink.rtss.constants.Project;
|
||||
import club.joylink.rtss.dao.RaceQuestion2DAO;
|
||||
import club.joylink.rtss.entity.race2.RaceQuestion2;
|
||||
import club.joylink.rtss.entity.race2.RaceQuestion2Example;
|
||||
import club.joylink.rtss.dao.PagerQuestionDAO;
|
||||
import club.joylink.rtss.entity.question.PaperQuestion;
|
||||
import club.joylink.rtss.entity.question.PaperQuestionExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.question.QuestionQueryVO;
|
||||
import club.joylink.rtss.vo.client.question.v2.QuestionOptionVO2;
|
||||
import club.joylink.rtss.vo.client.question.v2.QuestionVO2;
|
||||
import club.joylink.rtss.vo.client.question.v2.PaperQuestionOptionVO2;
|
||||
import club.joylink.rtss.vo.client.question.v2.PaperQuestionVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.base.Strings;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -26,21 +28,21 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class QuestionBankService2 {
|
||||
@Resource
|
||||
private RaceQuestion2DAO questionDAO;
|
||||
private PagerQuestionDAO questionDAO;
|
||||
|
||||
private Object queryQuestions(QuestionQueryVO queryVO,boolean isPaging){
|
||||
if(isPaging){
|
||||
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
|
||||
}
|
||||
RaceQuestion2Example example = new RaceQuestion2Example();
|
||||
RaceQuestion2Example.Criteria criteria = example.createCriteria();
|
||||
PaperQuestionExample example = new PaperQuestionExample();
|
||||
PaperQuestionExample.Criteria criteria = example.createCriteria();
|
||||
if (StringUtils.hasText(queryVO.getTopic())) {
|
||||
criteria.andTopicLike(String.format("%%%s%%", queryVO.getTopic()));
|
||||
}
|
||||
if (StringUtils.hasText(queryVO.getType())) {
|
||||
criteria.andTypeEqualTo(queryVO.getType());
|
||||
}
|
||||
|
||||
criteria.andIsDelEqualTo(BusinessConsts.DBLogicDelete.NORMAL.ordinal());
|
||||
boolean isDefault = Project.isDefault(Project.valueOf(queryVO.getProjectCode()));
|
||||
if (isDefault) {
|
||||
criteria.andProjectCodeIsNull();
|
||||
@ -60,9 +62,9 @@ public class QuestionBankService2 {
|
||||
* @param queryVO
|
||||
* @return
|
||||
*/
|
||||
public PageVO<QuestionVO2> pagingQueryQuestions(QuestionQueryVO queryVO) {
|
||||
Page<RaceQuestion2> page = (Page<RaceQuestion2>) this.queryQuestions(queryVO,true);
|
||||
List<QuestionVO2> questionVOS = QuestionVO2.convert2VOList(page.getResult());
|
||||
public PageVO<PaperQuestionVO> pagingQueryQuestions(QuestionQueryVO queryVO) {
|
||||
Page<PaperQuestion> page = (Page<PaperQuestion>) this.queryQuestions(queryVO,true);
|
||||
List<PaperQuestionVO> questionVOS = PaperQuestionVO.convert2VOList(page.getResult());
|
||||
return PageVO.convert(page, questionVOS);
|
||||
}
|
||||
|
||||
@ -72,9 +74,9 @@ public class QuestionBankService2 {
|
||||
* @param queryVO
|
||||
* @return
|
||||
*/
|
||||
public List<QuestionVO2> queryQuestions(QuestionQueryVO queryVO) {
|
||||
List<RaceQuestion2> list = (List<RaceQuestion2>) this.queryQuestions(queryVO,true);
|
||||
List<QuestionVO2> questionVOS = QuestionVO2.convert2VOList(list);
|
||||
public List<PaperQuestionVO> queryQuestions(QuestionQueryVO queryVO) {
|
||||
List<PaperQuestion> list = (List<PaperQuestion>) this.queryQuestions(queryVO,true);
|
||||
List<PaperQuestionVO> questionVOS = PaperQuestionVO.convert2VOList(list);
|
||||
return questionVOS;
|
||||
}
|
||||
|
||||
@ -84,10 +86,11 @@ public class QuestionBankService2 {
|
||||
* @param questionId
|
||||
* @return
|
||||
*/
|
||||
public QuestionVO2 getQuestion(Long questionId) {
|
||||
RaceQuestion2 question = questionDAO.selectByPrimaryKey(questionId);
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(question);
|
||||
QuestionVO2 questionVO = new QuestionVO2(question);
|
||||
public PaperQuestionVO getQuestion(Long questionId) {
|
||||
PaperQuestion question = questionDAO.selectByPrimaryKey(questionId);
|
||||
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(question) || question.getIsDel() == BusinessConsts.DBLogicDelete.NORMAL.ordinal());
|
||||
PaperQuestionVO questionVO = new PaperQuestionVO(question);
|
||||
return questionVO;
|
||||
}
|
||||
|
||||
@ -96,18 +99,26 @@ public class QuestionBankService2 {
|
||||
* @param companyId
|
||||
*/
|
||||
public Collection<String> findAllLable(Long companyId){
|
||||
List<String> lableList = this.questionDAO.findAllLableByCompanyId(companyId);
|
||||
PaperQuestionExample example = new PaperQuestionExample();
|
||||
PaperQuestionExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andCompanyIdEqualTo(companyId);
|
||||
criteria.andIsDelEqualTo(BusinessConsts.DBLogicDelete.NORMAL.ordinal());
|
||||
List<PaperQuestion> lableList = this.questionDAO.selectByExample(example);
|
||||
if(CollectionUtils.isEmpty(lableList)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return lableList.stream().filter(Objects::nonNull).flatMap(d-> Arrays.stream(d.split(","))).collect(Collectors.toSet());
|
||||
return lableList.stream().map(PaperQuestion::getRaceLable).filter(Objects::nonNull).flatMap(d-> Splitter.on(",").omitEmptyStrings()
|
||||
.trimResults().splitToStream(d)).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
public List<QuestionVO2> queryQuestionsForRaceLable(Long companyId,String raceLable) {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(raceLable)
|
||||
,"查询标签不能为空");
|
||||
List<RaceQuestion2> list = this.questionDAO.findByCompanyIdAndRaceLable(companyId,raceLable);
|
||||
List<QuestionVO2> questionVOS = QuestionVO2.convert2VOList(list);
|
||||
|
||||
|
||||
public List<PaperQuestionVO> queryQuestionsForRaceLable(Long companyId, Map<String,String> raceMap) {
|
||||
String raceLableStr = Objects.isNull(raceMap) ? null :raceMap.get("raceLable");
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(!Strings.isNullOrEmpty(raceLableStr),"查询标签不能为空");
|
||||
List<String> raceLableList = Splitter.on(",").omitEmptyStrings().trimResults().splitToList(raceLableStr);
|
||||
List<PaperQuestion> list = this.questionDAO.findByCompanyIdAndRaceLable(companyId,BusinessConsts.DBLogicDelete.NORMAL.ordinal(),raceLableList);
|
||||
List<PaperQuestionVO> questionVOS = PaperQuestionVO.convert2VOList(list);
|
||||
return questionVOS;
|
||||
}
|
||||
/**
|
||||
@ -115,7 +126,7 @@ public class QuestionBankService2 {
|
||||
* @param questionVO
|
||||
* @param accountVO
|
||||
*/
|
||||
public void saveOrUpdate(QuestionVO2 questionVO, AccountVO accountVO) {
|
||||
public void saveOrUpdate(PaperQuestionVO questionVO, AccountVO accountVO) {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue((Objects.equals(BusinessConsts.TheoryType.select.name(),questionVO.getType())
|
||||
|| Objects.equals(BusinessConsts.TheoryType.judge.name(),questionVO.getType()) || Objects.equals(BusinessConsts.TheoryType.multi.name(),questionVO.getType()))
|
||||
,"题库目前只支持单选,多选和判断");
|
||||
@ -123,19 +134,23 @@ public class QuestionBankService2 {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(
|
||||
(Objects.equals(BusinessConsts.TheoryType.select.name(), questionVO.getType()) ||
|
||||
Objects.equals(BusinessConsts.TheoryType.judge.name(), questionVO.getType())) &&
|
||||
questionVO.getOptionList().stream().filter(QuestionOptionVO2::getCorrect).count() == 1,
|
||||
questionVO.getOptionList().stream().filter(PaperQuestionOptionVO2::getCorrect).count() == 1,
|
||||
"单选或判断题正确答案有且只有一个!");
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotTrue(
|
||||
(Objects.equals(BusinessConsts.TheoryType.multi.name(), questionVO.getType())) &&
|
||||
questionVO.getOptionList().stream().filter(QuestionOptionVO2::getCorrect).count() <= 1,
|
||||
questionVO.getOptionList().stream().filter(PaperQuestionOptionVO2::getCorrect).count() <= 1,
|
||||
"多选题正确答案必须是2个以上!");
|
||||
RaceQuestion2 question = questionVO.convert2DB();
|
||||
PaperQuestion question = questionVO.convert2DB();
|
||||
question.setCreateUserId(accountVO.getId());
|
||||
question.setCreateTime(LocalDateTime.now());
|
||||
|
||||
question.setIsDel(BusinessConsts.DBLogicDelete.NORMAL.ordinal());
|
||||
if(Objects.nonNull(questionVO.getId())){
|
||||
Long exist = this.questionDAO.checkExistByPK(questionVO.getId());
|
||||
if(Objects.isNull(exist)){
|
||||
PaperQuestionExample example = new PaperQuestionExample();
|
||||
PaperQuestionExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andIdEqualTo(questionVO.getId());
|
||||
criteria.andIsDelEqualTo(BusinessConsts.DBLogicDelete.NORMAL.ordinal());
|
||||
Long exist = this.questionDAO.countByExample(example);
|
||||
if(Objects.isNull(exist) || exist <= 0){
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotTrue(true,
|
||||
"未找到要修改的数据!");
|
||||
}
|
||||
@ -147,9 +162,8 @@ public class QuestionBankService2 {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void importProjectQuestion(List<QuestionVO2> questions, String projectCode, Long companyId, AccountVO accountVO) {
|
||||
public void importProjectQuestion(List<PaperQuestionVO> questions, String projectCode, Long companyId, AccountVO accountVO) {
|
||||
|
||||
questions.forEach(questionVO -> {
|
||||
String topic = questionVO.getTopic();
|
||||
@ -157,7 +171,7 @@ public class QuestionBankService2 {
|
||||
|| Objects.equals(BusinessConsts.TheoryType.judge.name(),questionVO.getType()) || Objects.equals(BusinessConsts.TheoryType.multi.name(),questionVO.getType()))
|
||||
,String.format("题库目前只支持单选,多选和判断,题序[%s]",questionVO.getId()));
|
||||
|
||||
long answerCount = questionVO.getOptionList().stream().filter(QuestionOptionVO2::getCorrect).count();
|
||||
long answerCount = questionVO.getOptionList().stream().filter(PaperQuestionOptionVO2::getCorrect).count();
|
||||
if (questionVO.isSelect() || questionVO.isJudge()) {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(answerCount == 1,
|
||||
String.format("题序[%s]:单选或判断题[%s]正确答案应当有且只有一个!", questionVO.getId(),topic));
|
||||
@ -170,8 +184,8 @@ public class QuestionBankService2 {
|
||||
boolean isDefault = Project.isDefault(Project.valueOf(projectCode));
|
||||
//默认项目导入题考虑是否有单位关联
|
||||
if (isDefault) {
|
||||
RaceQuestion2Example example = new RaceQuestion2Example();
|
||||
RaceQuestion2Example.Criteria criteria = example.createCriteria();
|
||||
PaperQuestionExample example = new PaperQuestionExample();
|
||||
PaperQuestionExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andProjectCodeIsNull();
|
||||
if (Objects.nonNull(companyId)) {
|
||||
criteria.andCompanyIdEqualTo(companyId);
|
||||
@ -181,25 +195,27 @@ public class QuestionBankService2 {
|
||||
questionDAO.deleteByExample(example);
|
||||
questions.forEach(questionVO -> {
|
||||
questionVO.setProjectCode(projectCode);
|
||||
RaceQuestion2 question = questionVO.convert2DB();
|
||||
PaperQuestion question = questionVO.convert2DB();
|
||||
question.setProjectCode(null);
|
||||
question.setCreateUserId(accountVO.getId());
|
||||
question.setCreateTime(LocalDateTime.now());
|
||||
question.setCompanyId(companyId);
|
||||
question.setIsDel(BusinessConsts.DBLogicDelete.NORMAL.ordinal());
|
||||
questionDAO.insert(question);
|
||||
});
|
||||
|
||||
} else {
|
||||
//非默认项目导入题
|
||||
RaceQuestion2Example example = new RaceQuestion2Example();
|
||||
PaperQuestionExample example = new PaperQuestionExample();
|
||||
example.createCriteria().andProjectCodeEqualTo(projectCode);
|
||||
questionDAO.deleteByExample(example);
|
||||
questions.forEach(questionVO -> {
|
||||
questionVO.setProjectCode(projectCode);
|
||||
RaceQuestion2 question = questionVO.convert2DB();
|
||||
PaperQuestion question = questionVO.convert2DB();
|
||||
question.setProjectCode(projectCode);
|
||||
question.setCreateUserId(accountVO.getId());
|
||||
question.setCreateTime(LocalDateTime.now());
|
||||
question.setIsDel(BusinessConsts.DBLogicDelete.NORMAL.ordinal());
|
||||
questionDAO.insert(question);
|
||||
});
|
||||
}
|
||||
@ -208,7 +224,11 @@ public class QuestionBankService2 {
|
||||
|
||||
|
||||
|
||||
public void deleteQuestion(Long questionId) {
|
||||
questionDAO.deleteByPrimaryKey(questionId);
|
||||
public void deleteQuestion(List<Long> questionId) {
|
||||
PaperQuestionExample example = new PaperQuestionExample();
|
||||
example.createCriteria().andIdIn(questionId);
|
||||
PaperQuestion pq = new PaperQuestion();
|
||||
pq.setIsDel(BusinessConsts.DBLogicDelete.DELETE.ordinal());
|
||||
questionDAO.updateByExampleSelective(pq,example);
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class QuestionOptionVO2 implements Cloneable {
|
||||
public class PaperQuestionOptionVO2 implements Cloneable {
|
||||
|
||||
private Long id;
|
||||
private Long questionId;
|
||||
@ -32,7 +32,7 @@ public class QuestionOptionVO2 implements Cloneable {
|
||||
@NotNull(message = "题目没有设置正确选项")
|
||||
private Boolean correct;
|
||||
|
||||
public QuestionOptionVO2(RaceQuestionOption questionOption) {
|
||||
public PaperQuestionOptionVO2(RaceQuestionOption questionOption) {
|
||||
this.id = questionOption.getId();
|
||||
this.questionId = questionOption.getQuestionId();
|
||||
this.content = questionOption.getContent();
|
||||
@ -49,10 +49,10 @@ public class QuestionOptionVO2 implements Cloneable {
|
||||
return questionOption;
|
||||
}
|
||||
|
||||
public static List<QuestionOptionVO2> convert2VOList(List<RaceQuestionOption> options){
|
||||
List<QuestionOptionVO2> voList = new ArrayList<>();
|
||||
public static List<PaperQuestionOptionVO2> convert2VOList(List<RaceQuestionOption> options){
|
||||
List<PaperQuestionOptionVO2> voList = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(options)) {
|
||||
options.forEach(option -> voList.add(new QuestionOptionVO2(option)));
|
||||
options.forEach(option -> voList.add(new PaperQuestionOptionVO2(option)));
|
||||
}
|
||||
return voList;
|
||||
}
|
@ -2,10 +2,8 @@ package club.joylink.rtss.vo.client.question.v2;
|
||||
|
||||
import club.joylink.rtss.constants.BusinessConsts;
|
||||
import club.joylink.rtss.constants.Project;
|
||||
import club.joylink.rtss.entity.RaceQuestion;
|
||||
import club.joylink.rtss.entity.race2.RaceQuestion2;
|
||||
import club.joylink.rtss.entity.question.PaperQuestion;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.vo.client.question.QuestionOptionVO;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
@ -23,7 +21,7 @@ import java.util.stream.Collectors;
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class QuestionVO2 implements Cloneable {
|
||||
public class PaperQuestionVO implements Cloneable {
|
||||
|
||||
|
||||
private Long id;
|
||||
@ -43,7 +41,7 @@ public class QuestionVO2 implements Cloneable {
|
||||
/**
|
||||
*选项列表
|
||||
*/
|
||||
private List<QuestionOptionVO2> optionList;
|
||||
private List<PaperQuestionOptionVO2> optionList;
|
||||
|
||||
private Long createUserId;
|
||||
|
||||
@ -57,43 +55,45 @@ public class QuestionVO2 implements Cloneable {
|
||||
*/
|
||||
private Float score = 1f;
|
||||
|
||||
public QuestionVO2(RaceQuestion2 question) {
|
||||
public PaperQuestionVO(PaperQuestion question) {
|
||||
this.id = question.getId();
|
||||
this.type = question.getType();
|
||||
this.topic = question.getTopic();
|
||||
this.projectCode = question.getProjectCode();
|
||||
this.companyId = question.getCompanyId();
|
||||
this.raceLable = question.getRaceLable();
|
||||
this.optionList = JsonUtils.readCollection(question.getQuestions(),ArrayList.class,QuestionOptionVO2.class);
|
||||
this.optionList = JsonUtils.readCollection(question.getQuestions(),ArrayList.class, PaperQuestionOptionVO2.class);
|
||||
}
|
||||
|
||||
public RaceQuestion2 convert2DB() {
|
||||
RaceQuestion2 question = new RaceQuestion2();
|
||||
public PaperQuestion convert2DB() {
|
||||
PaperQuestion question = new PaperQuestion();
|
||||
question.setId(this.id);
|
||||
question.setType(type);
|
||||
question.setTopic(topic);
|
||||
question.setProjectCode(Project.isDefault(Project.valueOf(projectCode)) ? null : projectCode);
|
||||
question.setCompanyId(companyId);
|
||||
question.setQuestions(JsonUtils.writeValueAsString(this.optionList));
|
||||
question.setRaceLable(this.raceLable);
|
||||
|
||||
return question;
|
||||
}
|
||||
|
||||
|
||||
public static List<QuestionVO2> convert2VOList(List<RaceQuestion2> questions){
|
||||
List<QuestionVO2> voList = new ArrayList<>();
|
||||
public static List<PaperQuestionVO> convert2VOList(List<PaperQuestion> questions){
|
||||
List<PaperQuestionVO> voList = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(questions)) {
|
||||
questions.forEach(e -> voList.add(new QuestionVO2(e)));
|
||||
questions.forEach(e -> voList.add(new PaperQuestionVO(e)));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuestionVO2 clone() throws CloneNotSupportedException {
|
||||
QuestionVO2 clone = (QuestionVO2) super.clone();
|
||||
public PaperQuestionVO clone() throws CloneNotSupportedException {
|
||||
PaperQuestionVO clone = (PaperQuestionVO) super.clone();
|
||||
AtomicBoolean error = new AtomicBoolean(false);
|
||||
List<QuestionOptionVO2> cloneList = optionList.stream().map(questionOption -> {
|
||||
List<PaperQuestionOptionVO2> cloneList = optionList.stream().map(questionOption -> {
|
||||
try {
|
||||
return (QuestionOptionVO2) questionOption.clone();
|
||||
return (PaperQuestionOptionVO2) questionOption.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package club.joylink.rtss.vo.client.question.v2;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import club.joylink.rtss.entity.race2.RaceQuestion2;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class RaceQuestion2WithBLOBs extends RaceQuestion2 implements Serializable {
|
||||
/**
|
||||
* 问题内容
|
||||
*/
|
||||
private String topic;
|
||||
|
||||
private String questions;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -50,6 +50,8 @@ spring:
|
||||
mybatis:
|
||||
mapper-locations: classpath:mybatis/mapper/*.xml
|
||||
type-aliases-package: club.joylink.rtss.entity
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
pagehelper:
|
||||
helper-dialect: mysql
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?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="club.joylink.rtss.dao.RaceQuestion2DAO">
|
||||
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.race2.RaceQuestion2">
|
||||
<mapper namespace="club.joylink.rtss.dao.PagerQuestionDAO">
|
||||
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.question.PaperQuestion">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
|
||||
@ -9,11 +9,13 @@
|
||||
<result column="project_code" jdbcType="VARCHAR" property="projectCode" />
|
||||
<result column="company_id" jdbcType="BIGINT" property="companyId" />
|
||||
<result column="race_lable" jdbcType="VARCHAR" property="raceLable" />
|
||||
<result column="is_del" jdbcType="INTEGER" property="isDel" />
|
||||
<result column="topic" jdbcType="LONGVARCHAR" property="topic" />
|
||||
<result column="questions" jdbcType="LONGVARCHAR" property="questions" />
|
||||
</resultMap>
|
||||
<!-- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="club.joylink.rtss.entity.race2.RaceQuestion2WithBLOBs">
|
||||
|
||||
<!-- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="club.joylink.rtss.entity.race2.PaperQuestionWithBLOBs">
|
||||
<result column="topic" jdbcType="LONGVARCHAR" property="topic" />
|
||||
<result column="questions" jdbcType="LONGVARCHAR" property="questions" />
|
||||
</resultMap>-->
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
@ -74,12 +76,12 @@
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, `type`, create_user_id, create_time, project_code, company_id, race_lable,topic, questions
|
||||
id, `type`, create_user_id, create_time, project_code, company_id, race_lable, is_del
|
||||
</sql>
|
||||
<!--<sql id="Blob_Column_List">
|
||||
<sql id="Blob_Column_List">
|
||||
topic, questions
|
||||
</sql>-->
|
||||
<!-- <select id="selectByExampleWithBLOBs" parameterType="club.joylink.rtss.entity.race2.RaceQuestion2Example" resultMap="ResultMapWithBLOBs">
|
||||
</sql>
|
||||
<!--<select id="selectByExampleWithBLOBs" parameterType="club.joylink.rtss.entity.race2.PaperQuestionExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
@ -87,7 +89,7 @@
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from race_question2
|
||||
from paper_question
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
@ -103,15 +105,15 @@
|
||||
</if>
|
||||
</if>
|
||||
</select>-->
|
||||
|
||||
|
||||
<select id="selectByExample" parameterType="club.joylink.rtss.entity.race2.RaceQuestion2Example" resultMap="BaseResultMap">
|
||||
<select id="selectByExample" parameterType="club.joylink.rtss.entity.question.PaperQuestionExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from race_question2
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from paper_question
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
@ -130,32 +132,33 @@
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
|
||||
from race_question2
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from paper_question
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from race_question2
|
||||
delete from paper_question
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.race2.RaceQuestion2Example">
|
||||
delete from race_question2
|
||||
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.question.PaperQuestionExample">
|
||||
delete from paper_question
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="club.joylink.rtss.entity.race2.RaceQuestion2">
|
||||
insert into race_question2 (id, `type`, create_user_id,
|
||||
create_time, project_code, company_id,
|
||||
race_lable, topic, questions
|
||||
)
|
||||
<insert id="insert" parameterType="club.joylink.rtss.entity.question.PaperQuestionWithBLOBs">
|
||||
insert into paper_question (id, `type`, create_user_id,
|
||||
create_time, project_code, company_id,
|
||||
race_lable, is_del, topic,
|
||||
questions)
|
||||
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{createUserId,jdbcType=BIGINT},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{projectCode,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT},
|
||||
#{raceLable,jdbcType=VARCHAR}, #{topic,jdbcType=LONGVARCHAR}, #{questions,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{projectCode,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT},
|
||||
#{raceLable,jdbcType=VARCHAR}, #{isDel,jdbcType=INTEGER}, #{topic,jdbcType=LONGVARCHAR},
|
||||
#{questions,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.race2.RaceQuestion2WithBLOBs">
|
||||
insert into race_question2
|
||||
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.question.PaperQuestionWithBLOBs">
|
||||
insert into paper_question
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
@ -178,6 +181,9 @@
|
||||
<if test="raceLable != null">
|
||||
race_lable,
|
||||
</if>
|
||||
<if test="isDel != null">
|
||||
is_del,
|
||||
</if>
|
||||
<if test="topic != null">
|
||||
topic,
|
||||
</if>
|
||||
@ -207,6 +213,9 @@
|
||||
<if test="raceLable != null">
|
||||
#{raceLable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isDel != null">
|
||||
#{isDel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="topic != null">
|
||||
#{topic,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@ -215,14 +224,14 @@
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="club.joylink.rtss.entity.race2.RaceQuestion2Example" resultType="java.lang.Long">
|
||||
select count(*) from race_question2
|
||||
<select id="countByExample" parameterType="club.joylink.rtss.entity.question.PaperQuestionExample" resultType="java.lang.Long">
|
||||
select count(*) from paper_question
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update race_question2
|
||||
update paper_question
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
@ -245,6 +254,9 @@
|
||||
<if test="record.raceLable != null">
|
||||
race_lable = #{record.raceLable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.isDel != null">
|
||||
is_del = #{record.isDel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.topic != null">
|
||||
topic = #{record.topic,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@ -257,37 +269,40 @@
|
||||
</if>
|
||||
</update>
|
||||
<!-- <update id="updateByExampleWithBLOBs" parameterType="map">
|
||||
update race_question2
|
||||
update paper_question
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
create_user_id = #{record.createUserId,jdbcType=BIGINT},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
project_code = #{record.projectCode,jdbcType=VARCHAR},
|
||||
company_id = #{record.companyId,jdbcType=BIGINT},
|
||||
race_lable = #{record.raceLable,jdbcType=VARCHAR},
|
||||
topic = #{record.topic,jdbcType=LONGVARCHAR},
|
||||
questions = #{record.questions,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>-->
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update race_question2
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
create_user_id = #{record.createUserId,jdbcType=BIGINT},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
project_code = #{record.projectCode,jdbcType=VARCHAR},
|
||||
company_id = #{record.companyId,jdbcType=BIGINT},
|
||||
race_lable = #{record.raceLable,jdbcType=VARCHAR},
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
create_user_id = #{record.createUserId,jdbcType=BIGINT},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
project_code = #{record.projectCode,jdbcType=VARCHAR},
|
||||
company_id = #{record.companyId,jdbcType=BIGINT},
|
||||
race_lable = #{record.raceLable,jdbcType=VARCHAR},
|
||||
is_del = #{record.isDel,jdbcType=INTEGER},
|
||||
topic = #{record.topic,jdbcType=LONGVARCHAR},
|
||||
questions = #{record.questions,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>-->
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update paper_question
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
`type` = #{record.type,jdbcType=VARCHAR},
|
||||
create_user_id = #{record.createUserId,jdbcType=BIGINT},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
project_code = #{record.projectCode,jdbcType=VARCHAR},
|
||||
company_id = #{record.companyId,jdbcType=BIGINT},
|
||||
race_lable = #{record.raceLable,jdbcType=VARCHAR},
|
||||
is_del = #{record.isDel,jdbcType=INTEGER},
|
||||
topic = #{record.topic,jdbcType=LONGVARCHAR},
|
||||
questions = #{record.questions,jdbcType=LONGVARCHAR}
|
||||
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.race2.RaceQuestion2WithBLOBs">
|
||||
update race_question2
|
||||
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.question.PaperQuestionWithBLOBs">
|
||||
update paper_question
|
||||
<set>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=VARCHAR},
|
||||
@ -307,6 +322,9 @@
|
||||
<if test="raceLable != null">
|
||||
race_lable = #{raceLable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isDel != null">
|
||||
is_del = #{isDel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="topic != null">
|
||||
topic = #{topic,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@ -316,26 +334,28 @@
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<!-- <update id="updateByPrimaryKeyWithBLOBs" parameterType="club.joylink.rtss.entity.race2.RaceQuestion2WithBLOBs">
|
||||
update race_question2
|
||||
<!-- <update id="updateByPrimaryKeyWithBLOBs" parameterType="club.joylink.rtss.entity.question.PaperQuestionWithBLOBs">
|
||||
update paper_question
|
||||
set `type` = #{type,jdbcType=VARCHAR},
|
||||
create_user_id = #{createUserId,jdbcType=BIGINT},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
project_code = #{projectCode,jdbcType=VARCHAR},
|
||||
company_id = #{companyId,jdbcType=BIGINT},
|
||||
race_lable = #{raceLable,jdbcType=VARCHAR},
|
||||
topic = #{topic,jdbcType=LONGVARCHAR},
|
||||
questions = #{questions,jdbcType=LONGVARCHAR}
|
||||
create_user_id = #{createUserId,jdbcType=BIGINT},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
project_code = #{projectCode,jdbcType=VARCHAR},
|
||||
company_id = #{companyId,jdbcType=BIGINT},
|
||||
race_lable = #{raceLable,jdbcType=VARCHAR},
|
||||
is_del = #{isDel,jdbcType=INTEGER},
|
||||
topic = #{topic,jdbcType=LONGVARCHAR},
|
||||
questions = #{questions,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>-->
|
||||
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.race2.RaceQuestion2">
|
||||
update race_question2
|
||||
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.question.PaperQuestion">
|
||||
update paper_question
|
||||
set `type` = #{type,jdbcType=VARCHAR},
|
||||
create_user_id = #{createUserId,jdbcType=BIGINT},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
project_code = #{projectCode,jdbcType=VARCHAR},
|
||||
company_id = #{companyId,jdbcType=BIGINT},
|
||||
race_lable = #{raceLable,jdbcType=VARCHAR},
|
||||
create_user_id = #{createUserId,jdbcType=BIGINT},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
project_code = #{projectCode,jdbcType=VARCHAR},
|
||||
company_id = #{companyId,jdbcType=BIGINT},
|
||||
race_lable = #{raceLable,jdbcType=VARCHAR},
|
||||
is_del = #{isDel,jdbcType=INTEGER},
|
||||
topic = #{topic,jdbcType=LONGVARCHAR},
|
||||
questions = #{questions,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
Loading…
Reference in New Issue
Block a user