From f01ab0dedaef5b303b6fd8f22396d6f0c6d5635c Mon Sep 17 00:00:00 2001 From: xierz Date: Tue, 15 Dec 2020 11:32:13 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=9B=B4=E6=94=B9find=5Fin=5Fset?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B9=E6=B3=95=202=E3=80=81=E4=B8=BA?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E3=80=81=E8=A7=92=E8=89=B2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?mybatis-plus=E9=80=82=E9=85=8D=203=E3=80=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8F=9C=E5=8D=95=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/net/mingsoft/cms/action/ContentAction.java | 1 + src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml | 6 +++--- src/main/java/net/mingsoft/cms/dao/IContentDao.xml | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/mingsoft/cms/action/ContentAction.java b/src/main/java/net/mingsoft/cms/action/ContentAction.java index 7a9cce3b..3ab11bbf 100755 --- a/src/main/java/net/mingsoft/cms/action/ContentAction.java +++ b/src/main/java/net/mingsoft/cms/action/ContentAction.java @@ -20,6 +20,7 @@ */ package net.mingsoft.cms.action; +import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; diff --git a/src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml b/src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml index fc6c4b2c..d13e711d 100755 --- a/src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml +++ b/src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml @@ -157,10 +157,10 @@ and ( - find_in_set(#{categoryParentIds},CATEGORY_PARENT_IDS) + find_in_set(#{categoryParentIds},CATEGORY_PARENT_IDS)>0 - find_in_set('${id}',CATEGORY_PARENT_IDS) + find_in_set('${id}',CATEGORY_PARENT_IDS)>0 or id=#{id} @@ -208,7 +208,7 @@ and dict_id=#{dictId} and category_flag=#{categoryFlag} and category_path=#{categoryPath} - and find_in_set(#{categoryParentIds},category_parent_ids) + and find_in_set(#{categoryParentIds},category_parent_ids)>0 and create_by=#{createBy} and create_date=#{createDate} and update_by=#{updateBy} diff --git a/src/main/java/net/mingsoft/cms/dao/IContentDao.xml b/src/main/java/net/mingsoft/cms/dao/IContentDao.xml index 45e4644a..e69506c0 100755 --- a/src/main/java/net/mingsoft/cms/dao/IContentDao.xml +++ b/src/main/java/net/mingsoft/cms/dao/IContentDao.xml @@ -218,7 +218,7 @@ ct.del=0 and content_title like CONCAT('%',#{contentTitle},'%') 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)) and content_type LIKE CONCAT('%',#{contentType},'%') and content_display=#{contentDisplay} and content_author=#{contentAuthor} @@ -250,7 +250,7 @@ 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)) and content_datetime >= #{beginTime} @@ -293,7 +293,7 @@ a.del=0 - and FIND_IN_SET(a.category_id,#{ids}) + and FIND_IN_SET(a.category_id,#{ids})>0 and a.content_title like CONCAT("%",#{map.content_title},"%") @@ -306,7 +306,7 @@ and - FIND_IN_SET('${item}',a.content_type) + FIND_IN_SET('${item}',a.content_type)>0