修改浏览记录查询不到

This commit is contained in:
xuwenbo
2020-05-16 20:57:04 +08:00
parent 3e4de80eb4
commit ac7d3f4648
2 changed files with 2 additions and 4 deletions

View File

@ -58,9 +58,7 @@ public class LogServiceImpl extends BaseServiceImpl<LogMapper, co.yixiang.loggin
@Override
public Object findAllByPageable(String nickname, Pageable pageable) {
getPage(pageable);
List<co.yixiang.logging.domain.Log> list = logMapper.findAllByPageable(nickname);
PageInfo<co.yixiang.logging.domain.Log> page = new PageInfo<>(list);
PageInfo<co.yixiang.logging.domain.Log> page = new PageInfo<>(logMapper.findAllByPageable(nickname));
Map<String,Object> map = new LinkedHashMap<>(2);
map.put("content",page.getList());
map.put("totalElements",page.getTotal());

View File

@ -29,7 +29,7 @@ public interface LogMapper extends CoreMapper<Log> {
void deleteByLogType(@Param("logType") String logType);
@Select("<script>select l.id,l.create_time as createTime,l.description, l.request_ip as requestIp,l.address,u.nickname from log l " +
" left join yx_user u on u.uid=l.uid where l.type=1 " +
" <if test = \"nickname !=''\"> and u.nickname LIKE CONCAT('%',#{nickname},'%')</if> order by l.id desc</script>")
" <if test = \"nickname !=null\"> and u.nickname LIKE CONCAT('%',#{nickname},'%')</if> order by l.id desc</script>")
List<Log> findAllByPageable(@Param("nickname") String nickname);
@Select( "select count(*) FROM (select request_ip FROM log where create_time between #{date1} and #{date2} GROUP BY request_ip) as s")
long findIp(@Param("date1") String date1, @Param("date2")String date2);