Commit e46a8d64 by 18356073052

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

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