Commit 1c87c66b authored by licc's avatar licc

优化查询方案

parent 199938cc
...@@ -153,6 +153,9 @@ ...@@ -153,6 +153,9 @@
<if test="downGrade != null"> <if test="downGrade != null">
and lowest_mark >#{downGrade} and lowest_mark >#{downGrade}
</if> </if>
<if test="type != null">
and type =#{type}
</if>
<if test="classNames != null"> <if test="classNames != null">
and and
<foreach collection="classNames" index="index" item="id" separator="or" open="(" close=")"> <foreach collection="classNames" index="index" item="id" separator="or" open="(" close=")">
......
...@@ -246,17 +246,17 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -246,17 +246,17 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
list = getVolunteerList(list, totalResult); list = getVolunteerList(list, totalResult);
} }
//6保存用户方案记录、志愿之间的关联关系,扣减查询次数 // //6保存用户方案记录、志愿之间的关联关系,扣减查询次数
R<Integer> bool = volunteerManager.saveUserVolunteer(user, list, scoreInfo, queryVo.getBigMajorNames()); // R<Integer> bool = volunteerManager.saveUserVolunteer(user, list, scoreInfo, queryVo.getBigMajorNames());
if (null != bool && bool.getCode() == 500) { // if (null != bool && bool.getCode() == 500) {
return R.error("保存方案查询记录失败!"); // return R.error("保存方案查询记录失败!");
} // }
//排序 //排序
list.sort(Comparator.comparing(Volunteer::getLowestMark).reversed()); list.sort(Comparator.comparing(Volunteer::getLowestMark).reversed());
volunteerVo.setUserId(user.getId()); volunteerVo.setUserId(user.getId());
assert bool != null; // assert bool != null;
volunteerVo.setRecordId(bool.getData()); // volunteerVo.setRecordId(bool.getData());
volunteerVo.setVolunteers(list); volunteerVo.setVolunteers(list);
volunteerVo.setTotal(list.size()); volunteerVo.setTotal(list.size());
return R.ok(volunteerVo); return R.ok(volunteerVo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment