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 结果
*/ */
...@@ -32,8 +35,9 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> { ...@@ -32,8 +35,9 @@ 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);
} }
/** /**
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<mapper namespace="com.linkwechat.wecom.mapper.WeChatItemMapper"> <mapper namespace="com.linkwechat.wecom.mapper.WeChatItemMapper">
<insert id="addItem"> <insert id="addItem">
INSERT INTO INSERT INTO
we_chat_item(item_id,side_id,material_id,create_by,create_time,update_by,update_time) we_chat_item(item_id,side_id,material_id,create_by,create_time,update_by,update_time)
VALUES VALUES
<if test="items!=null and items.size()>0"> <if test="items!=null and items.size()>0">
<foreach collection="items" open="(" separator="," item="item" close=")"> <foreach collection="items" open="(" separator="," item="item" close=")">
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
</if> </if>
</insert> </insert>
<delete id="dropItem"> <delete id="dropItem">
DELETE FROM DELETE FROM
we_chat_item we_chat_item
<where> <where>
side_id=#{sideId} side_id=#{sideId}
</where> </where>
</delete> </delete>
<select id="findChatItems" resultType="com.linkwechat.wecom.domain.vo.WeChatSideVo"> <select id="findChatItems" resultType="com.linkwechat.wecom.domain.vo.WeChatSideVo">
...@@ -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!