Commit 5700a5ff by 18356073052

侧边栏增加关键词查询

1 parent d33aa070
...@@ -16,6 +16,7 @@ import java.util.List; ...@@ -16,6 +16,7 @@ import java.util.List;
/** /**
* 聊天工具侧边栏 * 聊天工具侧边栏
*
* @author kewen * @author kewen
*/ */
@RequestMapping(value = "/wecom/chat/item") @RequestMapping(value = "/wecom/chat/item")
...@@ -41,9 +42,10 @@ public class WeChatItemController extends BaseController { ...@@ -41,9 +42,10 @@ public class WeChatItemController extends BaseController {
*/ */
//@PreAuthorize("@ss.hasPermi('chat:item:list')") //@PreAuthorize("@ss.hasPermi('chat:item:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(@RequestParam(value = "sideId") Long sideId) { public TableDataInfo list(@RequestParam(value = "sideId") Long sideId
, @RequestParam(value = "keyword", required = false) String keyword) {
startPage(); startPage();
List<WeChatSideVo> weChatSideVos = weChatItemService.chatItems(sideId); List<WeChatSideVo> weChatSideVos = weChatItemService.chatItems(sideId,keyword);
return getDataTable(weChatSideVos); return getDataTable(weChatSideVos);
} }
......
...@@ -10,12 +10,14 @@ import java.util.List; ...@@ -10,12 +10,14 @@ import java.util.List;
/** /**
* 聊天工具侧边栏 * 聊天工具侧边栏
*
* @author kewen * @author kewen
*/ */
public interface WeChatItemMapper extends BaseMapper<WeChatItem> { public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
/** /**
* 批量添加侧边栏素材 * 批量添加侧边栏素材
*
* @param items 侧边栏素材列表 * @param items 侧边栏素材列表
* @return 结果 * @return 结果
*/ */
...@@ -23,6 +25,7 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> { ...@@ -23,6 +25,7 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
/** /**
* 删除侧边栏素材 * 删除侧边栏素材
*
* @param sideId 侧边栏id * @param sideId 侧边栏id
* @return 结果 * @return 结果
*/ */
...@@ -33,7 +36,8 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> { ...@@ -33,7 +36,8 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
* h5素材列表 * h5素材列表
* *
* @param sideId 侧边栏id * @param sideId 侧边栏id
* @param keyword 关键词
* @return * @return
*/ */
public List<WeChatSideVo> findChatItems(@Param("sideId") Long sideId); public List<WeChatSideVo> findChatItems(@Param("sideId") Long sideId, @Param("keyword") String keyword);
} }
...@@ -27,6 +27,6 @@ public interface IWeChatItemService extends IService<WeChatItem> { ...@@ -27,6 +27,6 @@ public interface IWeChatItemService extends IService<WeChatItem> {
* @param sideId 侧边栏id * @param sideId 侧边栏id
* @return * @return
*/ */
public List<WeChatSideVo> chatItems(Long sideId); public List<WeChatSideVo> chatItems(Long sideId,String keyword);
} }
...@@ -96,8 +96,8 @@ public class WeChatItemServiceImpl extends ServiceImpl<WeChatItemMapper, WeChatI ...@@ -96,8 +96,8 @@ public class WeChatItemServiceImpl extends ServiceImpl<WeChatItemMapper, WeChatI
} }
@Override @Override
public List<WeChatSideVo> chatItems(Long sideId) { public List<WeChatSideVo> chatItems(Long sideId,String keyword) {
return weChatItemMapper.findChatItems(sideId); return weChatItemMapper.findChatItems(sideId,keyword);
} }
/** /**
......
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,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>
wci.side_id=#{sideId} wci.side_id=#{sideId}
<if test="keyword!=null and keyword!=''">
AND wm.material_name LIKE CONCAT('%',#{keyword},'%')
</if>
</where> </where>
</select> </select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!