@@ -124,6 +124,8 @@ public class ExamStudentSearchQuery extends BaseQuery<ExamStudent> {
// 不可重复
private Boolean inspectUnrepeated;
+
+ private Boolean objectiveFill;
public ExamStudentSearchQuery() {
super();
@@ -582,4 +584,13 @@ public class ExamStudentSearchQuery extends BaseQuery<ExamStudent> {
this.trial = trial;
}
+ public Boolean getObjectiveFill() {
+ return objectiveFill;
+ }
+ public void setObjectiveFill(Boolean objectiveFill) {
+ this.objectiveFill = objectiveFill;
@@ -43,7 +43,7 @@ import cn.com.qmth.stmms.common.enums.SubjectiveStatus;
@Service
public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implements ExamStudentService {
-
+ private static String[] objectiveAnswer=new String[] {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","?"};
@PersistenceContext
private EntityManager entityManager;
@@ -717,6 +717,25 @@ public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implem
predicates.add(cb.and(sub));
+ if (query.getObjectiveFill()!=null) {
+ if(query.getObjectiveFill()){
+ Predicate[] sub = new Predicate[objectiveAnswer.length];
+ for (int i = 0; i < objectiveAnswer.length; i++) {
+ sub[i] = cb.like(root.get("answers"), "%"+objectiveAnswer[i]+"%");
+ predicates.add(cb.or(sub));
+ }else {
+ Predicate[] orp = new Predicate[3];
+ orp[0]=cb.isNull(root.get("answers"));
+ orp[1]=cb.equal(root.get("answers"),"");
+ sub[i] = cb.notLike(root.get("answers"), "%"+objectiveAnswer[i]+"%");
+ orp[2]=cb.and(sub);
+ predicates.add(cb.or(orp));
if (StringUtils.isNotBlank(query.getPaperType())) {
predicates.add(cb.equal(root.get("paperType"), query.getPaperType()));
@@ -77,6 +77,16 @@
<br/><br/>
<textarea id="examSiteInput" rows="6" maxlength="10000" class="input-xxlarge" placeholder="多个考点用英文逗号分隔"></textarea>
</div>
+ </div>
+ <div class="control-group">
+ <label class="control-label">客观题是否有识别结果</label>
+ <div class="controls">
+ <select name="objectiveFill" class="input-small">
+ <option value="">不限</option>
+ <option value="true">是</option>
+ <option value="false">否</option>
+ </select>
<div class="control-group">
<label class="control-label">客观总分</label>