diff --git a/doc/db-mcms-mysql-4.7.0.sql b/doc/db-mcms-mysql-4.7.0.sql index 406cc166..559a9707 100644 --- a/doc/db-mcms-mysql-4.7.0.sql +++ b/doc/db-mcms-mysql-4.7.0.sql @@ -912,7 +912,7 @@ CREATE TABLE `mdiy_tag_sql` ( -- ---------------------------- INSERT INTO `mdiy_tag_sql` VALUES ('5', '3', 'SELECT\r\n basic_id AS id,\r\n LEFT (basic_title, ${titlelen ?default(40)}) AS title,\r\n basic_title AS fulltitle,\r\n article_author AS author,\r\n article_source AS source,\r\n article_content AS content,\r\n category.category_title AS typename,\r\n category.category_id AS typeid,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/list.do?typeid=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n \r\n basic.basic_thumbnails AS litpic,\r\n <#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mcms/view.do?id=\", basic_id) as link,\r\n <#else>\r\n cms_article.article_url AS link,\r\n \r\n basic_datetime AS date,<#if tableNname??>${tableNname}.*,\r\n basic_description AS descrip,\r\n basic_hit AS hit,\r\n article_type AS flag,\r\n category_title AS typetitle,\r\n cms_article.article_keyword AS keyword \r\nFROM\r\n basic\r\n LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n LEFT JOIN basic_column ON basic_column.column_category_id = basic.basic_categoryid \r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=cms_article.article_basicid \r\nWHERE <#--查询栏目-->\r\n 1 = 1 <#if typeid??> and (basic_categoryid=${typeid} or basic_categoryid in \r\n (select category_id FROM category where category.del=0 and find_in_set(${typeid},CATEGORY_PARENT_ID)))\r\n <#--标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")\r\n <#--作者-->\r\n <#if article_author??> and article_author like CONCAT(\"%\",\'${article_author}\',\"%\")\r\n <#--来源-->\r\n <#if article_source??> and article_source like CONCAT(\"%\",\'${article_source}\',\"%\")\r\n <#--属性-->\r\n <#if article_type??> and article_type like CONCAT(\"%\",\'${article_type}\',\"%\")\r\n <#--图片-->\r\n <#if basic_thumbnails??> and basic_thumbnails like CONCAT(\"%\",\'${basic_thumbnails}\',\"%\")\r\n <#--描述-->\r\n <#if basic_description??> and basic_description like CONCAT(\"%\",\'${basic_description}\',\"%\")\r\n <#--关键字-->\r\n <#if article_keyword??> and article_keyword like CONCAT(\"%\",\'${article_keyword}\',\"%\")\r\n <#--内容-->\r\n <#if article_content??> and article_content like CONCAT(\"%\",\'${article_content}\',\"%\")\r\n <#--自定义顺序-->\r\n <#if article_freeorder??> and article_freeorder=${article_freeorder}\r\n <#--文章属性-->\r\n <#if flag?? >\r\n and cms_article.article_type like CONCAT(\'%\',\'${flag}\',\'%\') \r\n \r\n <#if noflag?? >\r\n and cms_article.article_type not like CONCAT(\'%\',\'${noflag}\',\'%\') \r\n \r\n <#--字段排序-->\r\n <#if orderby?? >\r\n ORDER BY \r\n <#if orderby==\"date\"> basic.basic_datetime \r\n <#if orderby==\"hit\"> basic.basic_hit\r\n <#if orderby==\"sort\"> basic.basic_sort\r\n \r\n <#if order?? >\r\n <#if order==\"desc\"> desc\r\n <#if order==\"asc\"> asc\r\n \r\n LIMIT \r\n <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}', 1); INSERT INTO `mdiy_tag_sql` VALUES ('6', '4', 'select category_id as id,category_id as typeid,category_title as typetitle,\r\n<#--动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/list.do?typeid=\", category_id) as typelink,\r\n <#else>\r\nCONCAT(column_path,\"/index.html\") as typelink,\r\n column_keyword as typekeyword,column_descrip as typedescrip,category_smallimg as typelitpic from category \r\nLEFT JOIN basic_column bc on bc.column_category_id=category.category_id where \r\n<#if type?has_content>\r\n <#--顶级栏目-->\r\n <#if type==\"top\">\r\n <#if typeid??>\r\n category_categoryid=(select category_categoryid from category where category_id=(select category_categoryid from category where category_id=${typeid})) \r\n <#else>\r\n category_categoryid=0\r\n \r\n <#--同级栏目-->\r\n <#elseif type==\"level\">\r\n <#if typeid??>\r\n category_categoryid=(select category_categoryid from category where category_id=${typeid})\r\n <#else>\r\n 1=1\r\n \r\n <#--当前栏目-->\r\n <#elseif type==\"self\">\r\n <#if typeid??>\r\n category_id=${typeid}\r\n <#else>\r\n 1=1\r\n \r\n <#--子栏目-->\r\n <#elseif type==\"son\">\r\n <#if typeid??>\r\n category_categoryid=${typeid}\r\n <#else>\r\n 1=1\r\n \r\n \r\n<#else> <#--默认son-->\r\n <#if typeid??>\r\n category_categoryid=${typeid}\r\n <#else>\r\n category_categoryid=0\r\n \r\n', '1'); -INSERT INTO `mdiy_tag_sql` VALUES (7, 5, 'select \r\nAPP_NAME as name,\r\napp_logo as logo,\r\napp_keyword as keyword,\r\napp_description as descrip,\r\napp_copyright as copyright,\r\n<#--动态解析 -->\r\n<#if isDo?? && isDo>\r\n\"${url}\" as url,\r\n\"${url}\" as host,\r\n<#--使用地址栏的域名 -->\r\n<#elseif url??>\r\nCONCAT(\"${url}\",\"/${html}/\",app_id,\"/<#if m??>${m}\") as url,\r\n\"${url}\" as host,\r\n<#else>\r\nCONCAT(REPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\'),\"/html/\",app_id,\"/<#if m??>${m}\") as url,\r\nREPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\') as host,\r\n\r\nCONCAT(\"templets/\",app_id,\"/\",<#if m??>CONCAT(app_style,\"/${m}\")<#else>app_style) as style <#-- 判断是否为手机端 -->\r\nfrom app limit 1', 1); +INSERT INTO `mdiy_tag_sql` VALUES ('7', '5', 'select \r\nAPP_NAME as name,\r\napp_logo as logo,\r\napp_keyword as keyword,\r\napp_description as descrip,\r\napp_copyright as copyright,\r\n<#--动态解析 -->\r\n<#if isDo?? && isDo>\r\n\"${url}\" as url,\r\n\"${url}\" as host,\r\n<#--使用地址栏的域名 -->\r\n<#elseif url??>\r\nCONCAT(\"${url}\",\"/${html}/\",app_id,\"/<#if m??>${m}\") as url,\r\n\"${url}\" as host,\r\n<#else>\r\nCONCAT(REPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\'),\"/html/\",app_id,\"/<#if m??>${m}\") as url,\r\nREPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\') as host,\r\n\r\nCONCAT(\"templets/\",app_id,\"/\",<#if m??>CONCAT(app_style,\"/${m}\")<#else>app_style) as style <#-- 判断是否为手机端 -->\r\nfrom app limit 1', 1); INSERT INTO `mdiy_tag_sql` VALUES ('8', '7', 'SELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n<#--动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\"/${modelName}/list.do?typeid=\", category.category_id) as typelink,\r\n<#else>\r\n(SELECT \"index.html\") as typelink,\r\n\r\nbasic.basic_thumbnails as litpic,\r\n<#--内容页动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\"/mcms/view.do?id=\", basic_id) as link,\r\n<#else>\r\ncms_article.article_url AS link,\r\n\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nbasic_hit as hit,\r\narticle_type as flag,\r\ncategory_title as typetitle,\r\n<#if tableName??>${tableName}.*,\r\ncms_article.article_keyword as keyword\r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid\r\n<#--判断是否有自定义模型表-->\r\n<#if tableName??>left join ${tableName} on ${tableName}.basicId=cms_article.ARTICLE_BASICID\r\nWHERE \r\n1=1\r\n<#if id??> and basic_id=${id}', '1'); INSERT INTO `mdiy_tag_sql` VALUES ('9', '8', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if preId??>\r\nSELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \"index.html\") AS typelink,\r\nbasic.basic_thumbnails as litpic,\r\ncms_article.article_url as link,\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nbasic_hit as hit,\r\narticle_type as flag,\r\ncms_article.article_keyword as keyword \r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid \r\nWHERE basic_id=${preId}\r\n<#else><#--没有上一页返回空字符串-->\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as link,\r\n${select} as date,\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM basic\r\n', null); INSERT INTO `mdiy_tag_sql` VALUES ('10', '9', ' select\r\n <#if !(indexUrl??)>\r\n <#--判断是否有栏目对象,用于搜索不传栏目-->\r\n <#if column??>\r\n <#--顶级栏目处理-->\r\n <#if column.categoryCategoryId==0>\r\n <#assign path=column.columnPath/>\r\n <#else>\r\n <#assign path=column.columnPath/>\r\n \r\n <#else>\r\n <#assign path=\"\"/>\r\n \r\n <#--总记录数、总页数-->\r\n (SELECT ${total}) as total,\r\n <#--记录总数-->\r\n (SELECT ${rcount}) as rcount,\r\n <#--当前页码-->\r\n (SELECT ${pageNo}) as cur,\r\n <#--首页-->\r\n CONCAT(\"${path}\", \"/index.html\") as `index`,\r\n <#--上一页-->\r\n <#if (pageNo?eval-1) gt 1>\r\n CONCAT(\"${path}\",\"/list-${pageNo?eval-1}.html\") as pre,\r\n <#else>\r\n CONCAT(\"${path}\",\"/index.html\") as pre,\r\n \r\n <#--下一页-->\r\n <#if total==1>\r\n CONCAT(\"${path}\", \"/index.html\") as `next`,\r\n CONCAT(\"${path}\", \"/index.html\") as `last`\r\n <#else>\r\n <#if pageNo?eval gte total>\r\n CONCAT(\"${path}\",\"/list-${total}.html\") as next,\r\n <#else>\r\n CONCAT(\"${path}\",\"/list-${pageNo?eval+1}.html\") as next,\r\n \r\n \r\n <#--最后一页-->\r\n CONCAT(\"${path}\",\"/list-${total}.html\") as last\r\n<#else><#--判断是否是搜索页面-->\r\n \"${indexUrl}\" as `index`,\"${lastUrl}\" as `last`,\"${preUrl}\" as `pre`,\"${nextUrl}\" as `next`\r\n', NULL); diff --git a/src/main/java/net/mingsoft/cms/util/CmsParserUtil.java b/src/main/java/net/mingsoft/cms/util/CmsParserUtil.java index d254ef62..fe044a4d 100644 --- a/src/main/java/net/mingsoft/cms/util/CmsParserUtil.java +++ b/src/main/java/net/mingsoft/cms/util/CmsParserUtil.java @@ -8,10 +8,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.lang3.StringUtils; - import cn.hutool.core.io.FileUtil; -import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.PageUtil; import freemarker.cache.FileTemplateLoader; import freemarker.core.ParseException; @@ -23,7 +20,6 @@ import net.mingsoft.base.constant.Const; import net.mingsoft.basic.entity.ColumnEntity; import net.mingsoft.basic.util.BasicUtil; import net.mingsoft.basic.util.SpringUtil; -import net.mingsoft.basic.util.StringUtil; import net.mingsoft.cms.bean.ColumnArticleIdBean; import net.mingsoft.cms.constant.e.ColumnTypeEnum; import net.mingsoft.mdiy.biz.IContentModelBiz;