Commit e46a8d64 by 18356073052

侧边栏我的收藏添加关键词查询

1 parent 196d168c
......@@ -53,9 +53,9 @@ public class WeChatCollectionController extends BaseController {
*/
// @PreAuthorize("@ss.hasPermi('chat:collection:list')")
@GetMapping("/list")
public TableDataInfo list(@RequestParam(value = "userId") Long userId) {
public TableDataInfo list(@RequestParam(value = "userId") Long userId,@RequestParam(value = "keyword",required = false) String keyword) {
startPage();
List<WeChatSideVo> collections = weChatCollectionService.collections(userId);
List<WeChatSideVo> collections = weChatCollectionService.collections(userId,keyword);
return getDataTable(collections);
}
......
......@@ -46,6 +46,6 @@ public interface WeChatCollectionMapper extends BaseMapper<WeChatCollection> {
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public List<WeChatSideVo> findCollections(Long userId);
public List<WeChatSideVo> findCollections(@Param("userId") Long userId,@Param("keyword") String keyword);
}
......@@ -37,6 +37,6 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
* @param userId 用户id
* @return {@link WeChatSideVo}s
*/
public List<WeChatSideVo> collections(Long userId);
public List<WeChatSideVo> collections(Long userId,String keyword);
}
......@@ -38,8 +38,8 @@ public class WeChatCollectionServiceImpl extends ServiceImpl<WeChatCollectionMap
}
@Override
public List<WeChatSideVo> collections(Long userId) {
return weChatCollectionMapper.findCollections(userId);
public List<WeChatSideVo> collections(Long userId,String keyword) {
return weChatCollectionMapper.findCollections(userId,keyword);
}
}
......@@ -36,6 +36,9 @@
LEFT JOIN we_category wc ON wm.category_id = wc.id
<where>
wcc.user_id=#{userId}
<if test="keyword!=null and keyword!=''">
AND wm.material_name LIKE CONCAT('%',#{keyword},'%')
</if>
</where>
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!