新增 通过url查询用户的书签 多条返回最新一条
This commit is contained in:
@ -28,6 +28,7 @@ public interface ISqBookmarkService
|
||||
public List<SqBookmark> selectBymenuIdUserID(Long menuID,Long userID,Integer sort,String sousou);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询书签管理
|
||||
*
|
||||
@ -101,4 +102,13 @@ public interface ISqBookmarkService
|
||||
* @return
|
||||
*/
|
||||
public int selectByMenuIdCount(Long menuId);
|
||||
|
||||
/**
|
||||
* 通过url 查询用户是否已经添加
|
||||
*
|
||||
* @param url
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<SqBookmark> selectByUrlUserID(String url, Long userId);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ package com.ruoyi.bookmark.service.impl;
|
||||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.bookmark.domain.SqBookmarkTag;
|
||||
|
||||
import com.ruoyi.bookmark.domain.SqMenu;
|
||||
@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bookmark.mapper.SqBookmarkMapper;
|
||||
import com.ruoyi.bookmark.domain.SqBookmark;
|
||||
import com.ruoyi.bookmark.service.ISqBookmarkService;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
|
||||
/**
|
||||
@ -284,5 +286,25 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过url 查询用户是否已经添加
|
||||
*
|
||||
* @param url
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SqBookmark> selectByUrlUserID(String url, Long userId) {
|
||||
|
||||
Example example = new Example(SqBookmark.class);
|
||||
// 排序
|
||||
example.setOrderByClause("create_time desc");
|
||||
// 条件查询
|
||||
example.createCriteria()
|
||||
.andEqualTo("url", url)
|
||||
.andEqualTo("userid",userId);
|
||||
return sqBookmarkMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user