Bladeren bron

fix 修改后台文档搜索功能

Administrator 3 jaren geleden
bovenliggende
commit
9f5d4cb329

+ 1 - 1
pcxm/ruoyi-xiaomai/src/main/java/com/ruoyi/xiaomai/controller/XmDocumentController.java

@@ -47,7 +47,7 @@ public class XmDocumentController extends BaseController
     public TableDataInfo list(XmArticle xmArticle)
     {
         startPage();
-        xmArticle.setArticleTypes( ListUtil.toList(2,3,4,5,6,21,22));
+        //xmArticle.setArticleTypes( ListUtil.toList(2,3,4,5,6,21,22));
         List<XmArticle> list = xmArticleService.selectXmArticleList(xmArticle);
         return getDataTable(list);
     }

+ 5 - 5
pcxm/ruoyi-xiaomai/src/main/resources/mapper/xiaomai/XmArticleMapper.xml

@@ -23,19 +23,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectXmArticleList" parameterType="XmArticle" resultMap="XmArticleResult">
         <include refid="selectXmArticleVo"/>
         <where>  
-            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
             <if test="brief != null  and brief != ''"> and brief = #{brief}</if>
             <if test="source != null  and source != ''"> and source = #{source}</if>
             <if test="detail != null  and detail != ''"> and detail = #{detail}</if>
-             <if test="articleType != null and articleType != ''"> and article_type = #{articleType}</if>
-            <if test="articleTypes != null and articleTypes.size()>0">
+            <if test="articleType != null and articleType != ''"> and article_type = #{articleType}</if>
+<!--            <if test="articleTypes != null and articleTypes.size()>0">
                 and article_type in
                 <foreach collection="articleTypes" item="articleType" index="index" open="(" close=")" separator=",">
                       #{articleType}
                 </foreach>
-            </if>
-            ORDER BY  create_time DESC
+            </if>-->
         </where>
+        ORDER BY  create_time DESC
     </select>
     
     <select id="selectXmArticleById" parameterType="Long" resultMap="XmArticleResult">