1、更改find_in_set使用方法

2、为菜单、角色添加mybatis-plus适配
3、优化添加菜单服务器返回信息
This commit is contained in:
xierz 2020-12-15 11:32:13 +08:00
parent 5cb5e78a2b
commit f01ab0deda
3 changed files with 8 additions and 7 deletions

View File

@ -20,6 +20,7 @@
*/ */
package net.mingsoft.cms.action; package net.mingsoft.cms.action;
import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;

View File

@ -157,10 +157,10 @@
and and
( (
<if test="categoryParentIds != null and categoryParentIds!=''"> <if test="categoryParentIds != null and categoryParentIds!=''">
find_in_set(#{categoryParentIds},CATEGORY_PARENT_IDS) find_in_set(#{categoryParentIds},CATEGORY_PARENT_IDS)>0
</if> </if>
<if test="categoryParentIds == null or categoryParentIds ==''"> <if test="categoryParentIds == null or categoryParentIds ==''">
find_in_set('${id}',CATEGORY_PARENT_IDS) find_in_set('${id}',CATEGORY_PARENT_IDS)>0
</if> </if>
<if test="id != null"> <if test="id != null">
or id=#{id} or id=#{id}
@ -208,7 +208,7 @@
<if test="dictId != null"> and dict_id=#{dictId} </if> <if test="dictId != null"> and dict_id=#{dictId} </if>
<if test="categoryFlag != null and categoryFlag != ''"> and category_flag=#{categoryFlag}</if> <if test="categoryFlag != null and categoryFlag != ''"> and category_flag=#{categoryFlag}</if>
<if test="categoryPath != null and categoryPath != ''"> and category_path=#{categoryPath}</if> <if test="categoryPath != null and categoryPath != ''"> and category_path=#{categoryPath}</if>
<if test="categoryParentIds != null and categoryParentIds != ''"> and find_in_set(#{categoryParentIds},category_parent_ids)</if> <if test="categoryParentIds != null and categoryParentIds != ''"> and find_in_set(#{categoryParentIds},category_parent_ids)>0</if>
<if test="createBy &gt; 0"> and create_by=#{createBy} </if> <if test="createBy &gt; 0"> and create_by=#{createBy} </if>
<if test="createDate != null"> and create_date=#{createDate} </if> <if test="createDate != null"> and create_date=#{createDate} </if>
<if test="updateBy &gt; 0"> and update_by=#{updateBy} </if> <if test="updateBy &gt; 0"> and update_by=#{updateBy} </if>

View File

@ -218,7 +218,7 @@
ct.del=0 ct.del=0
<if test="contentTitle != null and contentTitle != ''"> and content_title like CONCAT('%',#{contentTitle},'%')</if> <if test="contentTitle != null and contentTitle != ''"> and content_title like CONCAT('%',#{contentTitle},'%')</if>
<if test="categoryId != null and categoryId != ''"> and (ct.category_id=#{categoryId} or ct.category_id in <if test="categoryId != null and categoryId != ''"> and (ct.category_id=#{categoryId} or ct.category_id in
(select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_IDS)))</if> (select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_IDS)>0))</if>
<if test="contentType != null and contentType != ''"> and content_type LIKE CONCAT('%',#{contentType},'%')</if> <if test="contentType != null and contentType != ''"> and content_type LIKE CONCAT('%',#{contentType},'%')</if>
<if test="contentDisplay != null and contentDisplay != ''"> and content_display=#{contentDisplay}</if> <if test="contentDisplay != null and contentDisplay != ''"> and content_display=#{contentDisplay}</if>
<if test="contentAuthor != null and contentAuthor != ''"> and content_author=#{contentAuthor}</if> <if test="contentAuthor != null and contentAuthor != ''"> and content_author=#{contentAuthor}</if>
@ -250,7 +250,7 @@
<!-- 查询子栏目数据 --> <!-- 查询子栏目数据 -->
<if test="categoryId &gt; 0"> <if test="categoryId &gt; 0">
and (ct.category_id=#{categoryId} or ct.category_id in and (ct.category_id=#{categoryId} or ct.category_id in
(select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_IDS))) (select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_IDS)>0))
</if> </if>
<if test="beginTime!=null and beginTime!=''"> <if test="beginTime!=null and beginTime!=''">
and content_datetime &gt;= #{beginTime} and content_datetime &gt;= #{beginTime}
@ -293,7 +293,7 @@
<where> <where>
a.del=0 a.del=0
<if test="ids!=null and ids!=''"> <if test="ids!=null and ids!=''">
and FIND_IN_SET(a.category_id,#{ids}) and FIND_IN_SET(a.category_id,#{ids})>0
</if> </if>
<if test="map.content_title!=null"> <if test="map.content_title!=null">
and a.content_title like CONCAT("%",#{map.content_title},"%") and a.content_title like CONCAT("%",#{map.content_title},"%")
@ -306,7 +306,7 @@
</if> </if>
<if test="map.content_type!=null"> <if test="map.content_type!=null">
and <foreach item="item" index="index" collection="map.content_type.split(',')" open="(" separator="or" close=")"> and <foreach item="item" index="index" collection="map.content_type.split(',')" open="(" separator="or" close=")">
FIND_IN_SET('${item}',a.content_type) FIND_IN_SET('${item}',a.content_type)>0
</foreach> </foreach>
</if> </if>
<if test="map.content_description!=null"> <if test="map.content_description!=null">