Commit 3cdd5886 by 18356073052

h5素材列表 新增素材类型字段

1 parent d188590f
...@@ -43,9 +43,9 @@ public class WeChatItemController extends BaseController { ...@@ -43,9 +43,9 @@ 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) { , @RequestParam(value = "keyword", required = false) String keyword,@RequestParam(value = "mediaType") String mediaType) {
startPage(); startPage();
List<WeChatSideVo> weChatSideVos = weChatItemService.chatItems(sideId,keyword); List<WeChatSideVo> weChatSideVos = weChatItemService.chatItems(sideId,keyword,mediaType);
return getDataTable(weChatSideVos); return getDataTable(weChatSideVos);
} }
......
...@@ -39,5 +39,5 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> { ...@@ -39,5 +39,5 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
* @param keyword 关键词 * @param keyword 关键词
* @return * @return
*/ */
public List<WeChatSideVo> findChatItems(@Param("sideId") Long sideId, @Param("keyword") String keyword); public List<WeChatSideVo> findChatItems(@Param("sideId") Long sideId, @Param("keyword") String keyword,@Param("mediaType") String mediaType);
} }
...@@ -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,String keyword); public List<WeChatSideVo> chatItems(Long sideId,String keyword,String mediaType);
} }
...@@ -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,String keyword) { public List<WeChatSideVo> chatItems(Long sideId,String keyword,String mediaType) {
return weChatItemMapper.findChatItems(sideId,keyword); return weChatItemMapper.findChatItems(sideId,keyword,mediaType);
} }
/** /**
......
...@@ -35,8 +35,25 @@ ...@@ -35,8 +35,25 @@
<where> <where>
wci.side_id=#{sideId} wci.side_id=#{sideId}
<if test="keyword!=null and keyword!=''"> <if test="keyword!=null and keyword!=''">
<if test="mediaType!=null and mediaType=='0'.toString()">
AND wm.content LIKE CONCAT('%',#{keyword},'%')
</if>
<if test="mediaType!=null and mediaType=='1'.toString()">
AND wm.material_name LIKE CONCAT('%',#{keyword},'%')
</if>
<if test="mediaType!=null and mediaType=='2'.toString()">
AND wm.material_name LIKE CONCAT('%',#{keyword},'%')
</if>
<if test="mediaType!=null and mediaType=='3'.toString()">
AND wm.material_name LIKE CONCAT('%',#{keyword},'%') AND wm.material_name LIKE CONCAT('%',#{keyword},'%')
</if> </if>
<if test="mediaType!=null and mediaType=='4'.toString()">
AND wm.content LIKE CONCAT('%',#{keyword},'%')
</if>
<if test="mediaType!=null and mediaType=='5'.toString()">
AND wm.material_name LIKE CONCAT('%',#{keyword},'%')
</if>
</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!