|
@@ -87,6 +87,10 @@ public class QuestionNoService extends AbstractService {
|
|
|
example.createCriteria()
|
|
|
.andIn("id", Arrays.stream(ids).collect(Collectors.toList()))
|
|
|
);
|
|
|
+ example.and(
|
|
|
+ example.createCriteria()
|
|
|
+ .andIsNull("deleteTime")
|
|
|
+ );
|
|
|
example.orderBy("id").asc();
|
|
|
Page<QuestionNo> p = page(()->select(questionNoMapper, example), page, size);
|
|
|
logger.info("SearchNo result: {}", p.toString());
|
|
@@ -153,6 +157,10 @@ public class QuestionNoService extends AbstractService {
|
|
|
.andGreaterThan("questionId", 0)
|
|
|
.andCondition(String.format(formatSet, structId, "module_struct"))
|
|
|
);
|
|
|
+ example.and(
|
|
|
+ example.createCriteria()
|
|
|
+ .andIsNull("deleteTime")
|
|
|
+ );
|
|
|
example.orderBy("no").asc();
|
|
|
return select(questionNoMapper, example);
|
|
|
}
|
|
@@ -177,6 +185,10 @@ public class QuestionNoService extends AbstractService {
|
|
|
}
|
|
|
example.and(criteria);
|
|
|
}
|
|
|
+ example.and(
|
|
|
+ example.createCriteria()
|
|
|
+ .andIsNull("deleteTime")
|
|
|
+ );
|
|
|
example.orderBy("no").asc();
|
|
|
return select(questionNoMapper, example);
|
|
|
}
|
|
@@ -209,6 +221,11 @@ public class QuestionNoService extends AbstractService {
|
|
|
example.createCriteria()
|
|
|
.andEqualTo("module", module)
|
|
|
);
|
|
|
+
|
|
|
+ example.and(
|
|
|
+ example.createCriteria()
|
|
|
+ .andIsNull("deleteTime")
|
|
|
+ );
|
|
|
List<QuestionNo> p = select(questionNoMapper, example);
|
|
|
return relation(p);
|
|
|
}
|
|
@@ -224,6 +241,10 @@ public class QuestionNoService extends AbstractService {
|
|
|
example.createCriteria()
|
|
|
.andEqualTo("questionId", questionId)
|
|
|
);
|
|
|
+ example.and(
|
|
|
+ example.createCriteria()
|
|
|
+ .andIsNull("deleteTime")
|
|
|
+ );
|
|
|
return select(questionNoMapper, example);
|
|
|
}
|
|
|
|
|
@@ -324,6 +345,10 @@ public class QuestionNoService extends AbstractService {
|
|
|
.andEqualTo("relationNumber", number)
|
|
|
.andNotIn("id", filterIds)
|
|
|
);
|
|
|
+ example.and(
|
|
|
+ example.createCriteria()
|
|
|
+ .andIsNull("deleteTime")
|
|
|
+ );
|
|
|
example.setOrderByClause("RAND()");
|
|
|
QuestionNo questionNo = one(questionNoMapper, example);
|
|
|
if (questionNo == null){
|
|
@@ -383,6 +408,7 @@ public class QuestionNoService extends AbstractService {
|
|
|
Integer totalNumber = 0;
|
|
|
Integer totalCorrect = 0;
|
|
|
for(QuestionNo questionNo : questionNoList){
|
|
|
+ if (questionNo == null) continue;
|
|
|
totalTime += questionNo.getTotalTime();
|
|
|
totalNumber += questionNo.getTotalNumber();
|
|
|
totalCorrect += questionNo.getTotalCorrect();
|
|
@@ -453,6 +479,8 @@ public class QuestionNoService extends AbstractService {
|
|
|
List<String> l = new ArrayList<>();
|
|
|
for (Integer questionNoId : questionNoIdsMap.get(k)){
|
|
|
QuestionNoRelation relation = (QuestionNoRelation)questionNoMap.get(questionNoId);
|
|
|
+ if (relation == null) continue;
|
|
|
+ if (relation.getQuestion() == null) continue;
|
|
|
if (!l.contains(relation.getQuestion().getQuestionType())){
|
|
|
l.add(relation.getQuestion().getQuestionType());
|
|
|
}
|
|
@@ -521,7 +549,7 @@ public class QuestionNoService extends AbstractService {
|
|
|
if(in == null){
|
|
|
throw new ParameterException("题目不存在");
|
|
|
}
|
|
|
- int result = delete(questionNoMapper, id, SOFT_FLAG);
|
|
|
+ int result = delete(questionNoMapper, id, true);
|
|
|
return result > 0;
|
|
|
}
|
|
|
|