Commit 588bd17d authored by liaoanyuan's avatar liaoanyuan

方案PDF导出排序修改和用户模糊查询修改

parent 7ad697ba
...@@ -103,15 +103,16 @@ ...@@ -103,15 +103,16 @@
<include refid="table"/> <include refid="table"/>
<where> <where>
is_delete=0 is_delete=0
<if test="userName != null">and user_name = #{userName}</if>
<if test="phone != null">and phone =#{phone}</if>
<if test="startTime != null"> <if test="startTime != null">
and create_time and create_time
between #{startTime} between #{startTime}
</if> </if>
<if test="userName != null">and user_name like ('%' #{userName} '%')</if>
<if test="phone != null">and phone like ('%' #{phone} '%')</if>
<if test="endTime != null">and #{endTime}</if> <if test="endTime != null">and #{endTime}</if>
order by create_time desc order by create_time desc
limit #{pageNo},#{pageSize} limit #{pageNo},#{pageSize}
...@@ -124,15 +125,17 @@ ...@@ -124,15 +125,17 @@
<include refid="table"/> <include refid="table"/>
<where> <where>
is_delete=0 is_delete=0
<if test="userName != null">and user_name = #{userName}</if>
<if test="phone != null">and phone =#{phone}</if> <if test="endTime != null">and #{endTime}</if>
<if test="userName != null">and user_name like ('%' #{userName} '%')</if>
<if test="phone != null">and phone like ('%' #{phone} '%')</if>
<if test="startTime != null"> <if test="startTime != null">
and create_time and create_time
between #{startTime} between #{startTime}
</if> </if>
<if test="endTime != null">and #{endTime}</if>
</where> </where>
</select> </select>
......
...@@ -133,7 +133,7 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch ...@@ -133,7 +133,7 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch
List<Integer> ids = list.stream().map(UserVolunteer::getVolunteerId).collect(Collectors.toList()); List<Integer> ids = list.stream().map(UserVolunteer::getVolunteerId).collect(Collectors.toList());
List<Volunteer> result = volunteerMapper.getListByIds(ids); List<Volunteer> result = volunteerMapper.getListByIds(ids);
result.sort(Comparator.comparing(Volunteer::getLowestMark).reversed());
//调用工具生成PDF //调用工具生成PDF
try { try {
// 1.新建document对象 // 1.新建document对象
......
...@@ -58,12 +58,20 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U ...@@ -58,12 +58,20 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
public R<PageInfo<UserInfoDto>> getUserList(UserQueryVo queryVo) { public R<PageInfo<UserInfoDto>> getUserList(UserQueryVo queryVo) {
log.info("volunteer_service[]UserServiceImpl[]getUserList[]input.param.queryVo:" + queryVo); log.info("volunteer_service[]UserServiceImpl[]getUserList[]input.param.queryVo:" + queryVo);
Integer pageNum = queryVo.getPageNo();
Integer pageSize = queryVo.getPageSize();
if (null == pageSize || pageSize == 0) {
pageSize = 10;
}
if (null == pageNum || pageNum == 0) {
pageNum = 1;
}
//创建参数容器 //创建参数容器
Map<String, Object> map = new HashMap<>(4); Map<String, Object> map = new HashMap<>(8);
//将参数放入容器中 //将参数放入容器中
map.put("pageNo", (queryVo.getPageNo() - 1) * queryVo.getPageSize()); map.put("pageNo", (pageNum-1)*pageSize);
map.put("pageSize", queryVo.getPageSize()); map.put("pageSize", pageSize);
map.put("startTime", queryVo.getStartTime()); map.put("startTime", queryVo.getStartTime());
map.put("endTime", queryVo.getEndTime()); map.put("endTime", queryVo.getEndTime());
map.put("userName", queryVo.getUserName()); map.put("userName", queryVo.getUserName());
...@@ -113,8 +121,8 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U ...@@ -113,8 +121,8 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
} }
PageInfo<UserInfoDto> info = new PageInfo<>(); PageInfo<UserInfoDto> info = new PageInfo<>();
info.setPageSize(queryVo.getPageSize()); info.setPageSize(pageSize);
info.setPageNum(queryVo.getPageNo()); info.setPageNum(pageNum);
info.setTotal(usersMapper.getUserNumbers(map)); info.setTotal(usersMapper.getUserNumbers(map));
info.setList(list); info.setList(list);
......
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