diff --git a/doc/5.3.3-up-5.3.4.sql b/doc/5.3.3-up-5.3.4.sql index 54567b4c..b5d423a6 100644 --- a/doc/5.3.3-up-5.3.4.sql +++ b/doc/5.3.3-up-5.3.4.sql @@ -6,26 +6,26 @@ SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- DROP TABLE IF EXISTS `mdiy_tag`; CREATE TABLE `mdiy_tag` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `tag_name` varchar(255) DEFAULT NULL COMMENT '标签名称', - `tag_type` varchar(255) DEFAULT NULL COMMENT '标签类型', - `tag_sql` text COMMENT '标签sql', - `tag_class` varchar(255) DEFAULT NULL COMMENT '标签类', - `tag_description` varchar(255) DEFAULT NULL COMMENT '描述', - `UPDATE_BY` varchar(11) DEFAULT NULL COMMENT '更新人', - `UPDATE_DATE` datetime DEFAULT NULL COMMENT '更新时间', - `CREATE_BY` varchar(11) DEFAULT NULL COMMENT '创建人', - `CREATE_DATE` datetime DEFAULT NULL COMMENT '创建时间', - `DEL` int(1) DEFAULT '0' COMMENT '删除标记', - `NOT_DEL` int(1) DEFAULT '0' COMMENT '1为不能删除,主要用于系统默认数据,0为一般数据,主要是前端控制', - PRIMARY KEY (`id`) USING BTREE + `id` int(11) NOT NULL AUTO_INCREMENT, + `tag_name` varchar(255) DEFAULT NULL COMMENT '标签名称', + `tag_type` varchar(255) DEFAULT NULL COMMENT '标签类型', + `tag_sql` text COMMENT '标签sql', + `tag_class` varchar(255) DEFAULT NULL COMMENT '标签类', + `tag_description` varchar(255) DEFAULT NULL COMMENT '描述', + `UPDATE_BY` varchar(11) DEFAULT NULL COMMENT '更新人', + `UPDATE_DATE` datetime DEFAULT NULL COMMENT '更新时间', + `CREATE_BY` varchar(11) DEFAULT NULL COMMENT '创建人', + `CREATE_DATE` datetime DEFAULT NULL COMMENT '创建时间', + `DEL` int(1) DEFAULT '0' COMMENT '删除标记', + `NOT_DEL` int(1) DEFAULT '0' COMMENT '1为不能删除,主要用于系统默认数据,0为一般数据,主要是前端控制', + PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='标签'; -- ---------------------------- -- Records of mdiy_tag -- ---------------------------- BEGIN; -INSERT INTO `mdiy_tag` (`id`, `tag_name`, `tag_type`, `tag_sql`, `tag_class`, `tag_description`, `UPDATE_BY`, `UPDATE_DATE`, `CREATE_BY`, `CREATE_DATE`, `DEL`, `NOT_DEL`) VALUES (3, 'arclist', 'list', '<#assign _typeid=\'\'/>\r\n<#assign _typetitle=\'\'/>\r\n<#-- 分页数,默认返回20条数据 -->\r\n<#assign _size=\'20\'/>\r\n<#if column?? && column.id?? && column.id?number gt 0>\r\n <#assign _typeid=\'${column.id}\'>\r\n\r\n<#if typeid??>\r\n <#assign _typeid=\'${typeid}\'>\r\n\r\n<#if typetitle??>\r\n <#assign _typetitle=\'${typetitle}\'>\r\n\r\n<#if size??>\r\n <#assign _size=\'${size}\'>\r\n\r\n\r\n<#if orderby?? >\r\n <#if orderby==\'date\'>\r\n <#assign _orderby=\'content_datetime\'>\r\n <#elseif orderby==\'updatedate\'>\r\n <#assign _orderby=\'cms_content.update_date\'>\r\n <#elseif orderby==\'hit\'>\r\n <#assign _orderby=\'content_hit\'>\r\n <#elseif orderby==\'sort\'>\r\n <#assign _orderby=\'content_sort\'>\r\n <#else>\r\n <#assign _orderby=\'cms_content.content_datetime\'>\r\n \r\n<#else>\r\n <#assign _orderby=\'cms_content.content_datetime\'>\r\n\r\n\r\nSELECT\r\n cms_content.id AS \"id\",\r\n content_title AS \"title\",\r\n content_short_title AS \"shorttitle\",\r\n content_author AS \"author\",\r\n content_source AS \"source\",\r\n content_out_link AS \"outlink\",\r\n content_tags AS \"tags\",\r\n\r\n category.category_title AS \"typetitle\",\r\n category.category_short_title AS \"typeshorttitle\",\r\n category.id AS \"typeid\",\r\n category.category_path AS \"typepath\",\r\n category.category_img AS \"typelitpic\",\r\n category.category_ico AS \"typeico\",\r\n category.category_keyword as \"typekeyword\",\r\n category.top_id as \"topid\",\r\n category.category_id as \"parentid\",\r\n category.category_parent_ids as \"parentids\",\r\n category.category_type AS \"type\",\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'${modelName}/list.do?style=${templateName!\"\"}&typeid=\', category.category_id) as \"typelink\",\r\n <#else>\r\n <#--栏目类型为链接-->\r\n <#if shortSwitch?? && shortSwitch>\r\n CONCAT(category.category_pinyin,\'.html\') AS \"typelink\",\r\n <#else>\r\n CONCAT(category.category_path,\'/index.html\') AS \"typelink\",\r\n \r\n \r\n content_description AS \"descrip\",\r\n content_hit AS \"hit\",\r\n content_type AS \"flag\",\r\n cms_content.content_keyword AS \"keyword\",\r\n content_img AS \"litpic\",\r\n <#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'${modelName}/view.do?style=${templateName!\"\"}&id=\', cms_content.id) as \"link\",\r\n <#else>\r\n <#if shortSwitch?? && shortSwitch>\r\n CONCAT(cms_content.id,\'.html\') AS \"link\",\r\n <#else>\r\n CONCAT(CONCAT( category.category_path, \'/\' ), CONCAT(CASE category_type WHEN \'2\' THEN \'index\' ELSE cms_content.id END , \'.html\' )) as \"link\",\r\n \r\n \r\n <#if tableName??>${tableName}.*,\r\n content_datetime AS \"date\"\r\nFROM\r\n cms_content\r\nLEFT JOIN\r\n cms_category as category\r\nON cms_content.category_id = category.id\r\n<#--判断是否有自定义模型表-->\r\n<#if tableName??>\r\n LEFT JOIN ${tableName} ON ${tableName}.link_id=cms_content.id\r\n\r\nWHERE\r\n content_display=0\r\n and category_display=\'enable\'\r\n and cms_content.del=0\r\n\r\n<#--文章审核-->\r\n<#if contentApprove?? && contentApprove>\r\n and cms_content.progress_status=\'终审通过\'\r\n\r\n<#--根据站点编号查询-->\r\n<#if appId?? >\r\n and cms_content.app_id=${appId}\r\n and cms_content.id>0\r\n\r\n<#--判断是否有搜索分类集合,暂时移除 _typeid=\"\" 条件-->\r\n<#if search??>\r\n and category_is_search=\'enable\'\r\n <#-- 文章标签 -->\r\n <#if search.content_tag??>and FIND_IN_SET(\'${search.content_tag}\',content_tags) > 0\r\n <#if search.categoryIds?has_content>\r\n and (\r\n <#list search.categoryIds?split(\",\") as item>\r\n <#if item?index gt 0>\r\n or\r\n \r\n (cms_content.category_id=${item}\r\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\r\n <#if _typetitle?has_content>\r\n and cms_category.category_title=\'${_typetitle}\'\r\n \r\n and FIND_IN_SET(${item},CATEGORY_PARENT_IDS) > 0)\r\n )\r\n \r\n )\r\n \r\n <#--标题-->\r\n <#if search.content_title??> and content_title like CONCAT(CONCAT(\'%\',\'${search.content_title}\'),\'%\')\r\n <#--作者-->\r\n <#if search.content_author??> and content_author like CONCAT(CONCAT(\'%\',\'${search.content_author}\'),\'%\')\r\n <#--来源-->\r\n <#if search.content_source??> and content_source like CONCAT(CONCAT(\'%\',\'${search.content_source}\'),\'%\')\r\n <#--属性-->\r\n <#if search.content_type??>\r\n and(<#list search.content_type?split(\',\') as item>\r\n <#if item?index gt 0> or\r\n FIND_IN_SET(\'${item}\',cms_content.content_type) > 0\r\n )\r\n \r\n <#--描述-->\r\n <#if search.content_description??>\r\n and content_description like CONCAT(CONCAT(\'%\',\'${search.content_description}\'),\'%\')\r\n \r\n <#--关键字-->\r\n <#if search.content_keyword??> and content_keyword like CONCAT(CONCAT(\'%\',\'${search.content_keyword}\'),\'%\')\r\n <#--内容-->\r\n <#if search.content_details??> and content_details like CONCAT(CONCAT(\'%\',\'${search.content_details}\'),\'%\')\r\n <#--自定义顺序-->\r\n <#if search.content_sort??> and content_sort=${search.content_sort}\r\n <#--时间范围-->\r\n <#if search.content_datetime_start??&&search.content_datetime_end??>\r\n and content_datetime between \'${search.content_datetime_start}\' and \'${search.content_datetime_end}\'\r\n \r\n<#else>\r\n <#--查询栏目-->\r\n <#if _typeid?has_content && _typeid?string != \'0\'>\r\n and (cms_content.category_id=${_typeid}\r\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\r\n <#if _typetitle?has_content>\r\n and cms_category.category_title=\'${_typetitle}\'\r\n \r\n and FIND_IN_SET(${_typeid},CATEGORY_PARENT_IDS) > 0))\r\n <#elseif typeids?has_content>\r\n and (\r\n <#list typeids?split(\",\") as item>\r\n <#if item?index gt 0>\r\n or\r\n \r\n (cms_content.category_id=${item}\r\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\r\n <#if _typetitle?has_content>\r\n and cms_category.category_title=\'${_typetitle}\'\r\n \r\n and FIND_IN_SET(${item},CATEGORY_PARENT_IDS) > 0)\r\n )\r\n \r\n )\r\n \r\n\r\n<#--判断搜索分类结束-->\r\n<#--标题-->\r\n<#if content_title??> and content_title like CONCAT(CONCAT(\'%\',\'${content_title}\'),\'%\')\r\n<#--作者-->\r\n<#if content_author??> and content_author like CONCAT(CONCAT(\'%\',\'${content_author}\'),\'%\')\r\n<#--来源-->\r\n<#if content_source??> and content_source like CONCAT(CONCAT(\'%\',\'${content_source}\'),\'%\')\r\n<#--属性-->\r\n<#if content_type??> and content_type like CONCAT(CONCAT(\'%\',\'${content_type}\'),\'%\')\r\n<#--描述-->\r\n<#if content_description??> and content_description like CONCAT(CONCAT(\'%\',\'${content_description}\'),\'%\')\r\n<#--关键字-->\r\n<#if content_keyword??> and content_keyword like CONCAT(CONCAT(\'%\',\'${content_keyword}\'),\'%\')\r\n<#--内容-->\r\n<#if content_details??> and content_details like CONCAT(CONCAT(\'%\',\'${content_details}\'),\'%\')\r\n<#--自定义顺序-->\r\n<#if content_sort??> and content_sort=${content_sort}\r\n<#--自定义模型-->\r\n<#if diyModel??>\r\n <#list diyModel as dm>\r\n <#assign json=\"${dm}\"?eval />\r\n and ${tableName}.${json.key} like CONCAT(CONCAT(\'%\',\'${json.value}\'),\'%\')\r\n \r\n\r\n<#--文章属性-->\r\n<#if flag?? >\r\n and(<#list flag?split(\',\') as item>\r\n <#if item?index gt 0> or\r\n FIND_IN_SET(\'${item}\',cms_content.content_type) > 0\r\n )\r\n\r\n<#if noflag??>\r\n and(<#list noflag?split(\',\') as item>\r\n <#if item?index gt 0> and\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)=0\r\n or cms_content.content_type is null)\r\n\r\n\r\n <#--字段排序-->\r\n ORDER BY\r\n <#if topflag??>\r\n CASE\r\n <#list topflag?split(\",\") as item>\r\n WHEN FIND_IN_SET(\'${item}\',cms_content.content_type)>0 THEN\r\n ${item?index}\r\n \r\n ELSE 100\r\n END,\r\n \r\n ${_orderby}\r\n <#if order?? >\r\n <#if order==\'desc\'> desc\r\n <#if order==\'asc\'> asc\r\n <#else>\r\n desc\r\n \r\n LIMIT\r\n <#--判断是否分页-->\r\n <#if ispaging?? && (pageTag.pageNo)??>\r\n ${((pageTag.pageNo-1)*_size?eval)?c},${_size?default(20)}\r\n <#else>\r\n ${_size?default(20)}\r\n \r\n', NULL, '文章列表', NULL, NULL, NULL, NULL, 0, 1); +INSERT INTO `mdiy_tag` (`id`, `tag_name`, `tag_type`, `tag_sql`, `tag_class`, `tag_description`, `UPDATE_BY`, `UPDATE_DATE`, `CREATE_BY`, `CREATE_DATE`, `DEL`, `NOT_DEL`) VALUES (3, 'arclist', 'list', '<#assign _typeid=\'\'/>\n<#assign _typetitle=\'\'/>\n<#-- 分页数,默认返回20条数据 -->\n<#assign _size=\'20\'/>\n<#if column?? && column.id?? && column.id?number gt 0>\n <#assign _typeid=\'${column.id}\'>\n\n<#if typeid??>\n <#assign _typeid=\'${typeid}\'>\n\n<#if typetitle??>\n <#assign _typetitle=\'${typetitle}\'>\n\n<#if size??>\n <#assign _size=\'${size}\'>\n\n\n<#if orderby?? >\n <#if orderby==\'date\'>\n <#assign _orderby=\'content_datetime\'>\n <#elseif orderby==\'updatedate\'>\n <#assign _orderby=\'cms_content.update_date\'>\n <#elseif orderby==\'hit\'>\n <#assign _orderby=\'content_hit\'>\n <#elseif orderby==\'sort\'>\n <#assign _orderby=\'content_sort\'>\n <#else>\n <#assign _orderby=\'cms_content.content_datetime\'>\n \n<#else>\n <#assign _orderby=\'cms_content.content_datetime\'>\n\n\nSELECT\n cms_content.id AS \"id\",\n content_title AS \"title\",\n content_short_title AS \"shorttitle\",\n content_author AS \"author\",\n content_source AS \"source\",\n content_out_link AS \"outlink\",\n content_tags AS \"tags\",\n\n category.category_title AS \"typetitle\",\n category.category_short_title AS \"typeshorttitle\",\n category.id AS \"typeid\",\n category.category_path AS \"typepath\",\n category.category_img AS \"typelitpic\",\n category.category_ico AS \"typeico\",\n category.category_keyword as \"typekeyword\",\n category.top_id as \"topid\",\n category.category_id as \"parentid\",\n category.category_parent_ids as \"parentids\",\n category.category_type AS \"type\",\n <#--列表页动态链接-->\n <#if isDo?? && isDo>\n CONCAT(\'${modelName}/list.do?style=${templateName!\"\"}&typeid=\', category.category_id) as \"typelink\",\n <#else>\n <#--栏目类型为链接-->\n <#if shortSwitch?? && shortSwitch>\n CONCAT(category.category_pinyin,\'.html\') AS \"typelink\",\n <#else>\n CONCAT(category.category_path,\'/index.html\') AS \"typelink\",\n \n \n content_description AS \"descrip\",\n content_hit AS \"hit\",\n content_type AS \"flag\",\n cms_content.content_keyword AS \"keyword\",\n content_img AS \"litpic\",\n <#--内容页动态链接-->\n <#if isDo?? && isDo>\n CONCAT(\'${modelName}/view.do?style=${templateName!\"\"}&id=\', cms_content.id) as \"link\",\n <#else>\n <#if shortSwitch?? && shortSwitch>\n CONCAT(cms_content.id,\'.html\') AS \"link\",\n <#else>\n CONCAT(CONCAT( category.category_path, \'/\' ), CONCAT(CASE category_type WHEN \'2\' THEN \'index\' ELSE cms_content.id END , \'.html\' )) as \"link\",\n \n \n <#if tableName??>${tableName}.*,\n content_datetime AS \"date\"\nFROM\n cms_content\nLEFT JOIN\n cms_category as category\nON cms_content.category_id = category.id\n<#--判断是否有自定义模型表-->\n<#if tableName??>\n LEFT JOIN ${tableName} ON ${tableName}.link_id=cms_content.id\n\nWHERE\n content_display=0\n and category_display=\'enable\'\n and cms_content.del=0\n\n<#--文章审核-->\n<#if contentApprove?? && contentApprove>\n and cms_content.progress_status=\'终审通过\'\n\n<#--根据站点编号查询-->\n<#if appId?? >\n and cms_content.app_id=${appId}\n and cms_content.id>0\n\n<#--判断是否有搜索分类集合,暂时移除 _typeid=\"\" 条件-->\n<#if search?? && !typeid??>\n and category_is_search=\'enable\'\n <#-- 文章标签 -->\n <#if search.content_tag??>and FIND_IN_SET(\'${search.content_tag}\',content_tags) > 0\n <#if search.categoryIds?has_content>\n and (\n <#list search.categoryIds?split(\",\") as item>\n <#if item?index gt 0>\n or\n \n (cms_content.category_id=${item}\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\n <#if _typetitle?has_content>\n and cms_category.category_title=\'${_typetitle}\'\n \n and FIND_IN_SET(${item},CATEGORY_PARENT_IDS) > 0)\n )\n \n )\n \n <#--标题-->\n <#if search.content_title??> and content_title like CONCAT(CONCAT(\'%\',\'${search.content_title}\'),\'%\')\n <#--作者-->\n <#if search.content_author??> and content_author like CONCAT(CONCAT(\'%\',\'${search.content_author}\'),\'%\')\n <#--来源-->\n <#if search.content_source??> and content_source like CONCAT(CONCAT(\'%\',\'${search.content_source}\'),\'%\')\n <#--属性-->\n <#if search.content_type??>\n and(<#list search.content_type?split(\',\') as item>\n <#if item?index gt 0> or\n FIND_IN_SET(\'${item}\',cms_content.content_type) > 0\n )\n \n <#--描述-->\n <#if search.content_description??>\n and content_description like CONCAT(CONCAT(\'%\',\'${search.content_description}\'),\'%\')\n \n <#--关键字-->\n <#if search.content_keyword??> and content_keyword like CONCAT(CONCAT(\'%\',\'${search.content_keyword}\'),\'%\')\n <#--内容-->\n <#if search.content_details??> and content_details like CONCAT(CONCAT(\'%\',\'${search.content_details}\'),\'%\')\n <#--自定义顺序-->\n <#if search.content_sort??> and content_sort=${search.content_sort}\n <#--时间范围-->\n <#if search.content_datetime_start??&&search.content_datetime_end??>\n and content_datetime between \'${search.content_datetime_start}\' and \'${search.content_datetime_end}\'\n \n<#else>\n <#--查询栏目-->\n <#if _typeid?has_content && _typeid?string != \'0\'>\n and (cms_content.category_id=${_typeid}\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\n <#if _typetitle?has_content>\n and cms_category.category_title=\'${_typetitle}\'\n \n and FIND_IN_SET(${_typeid},CATEGORY_PARENT_IDS) > 0))\n <#elseif typeids?has_content>\n and (\n <#list typeids?split(\",\") as item>\n <#if item?index gt 0>\n or\n \n (cms_content.category_id=${item}\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\n <#if _typetitle?has_content>\n and cms_category.category_title=\'${_typetitle}\'\n \n and FIND_IN_SET(${item},CATEGORY_PARENT_IDS) > 0)\n )\n \n )\n \n\n<#--判断搜索分类结束-->\n<#--标题-->\n<#if content_title??> and content_title like CONCAT(CONCAT(\'%\',\'${content_title}\'),\'%\')\n<#--作者-->\n<#if content_author??> and content_author like CONCAT(CONCAT(\'%\',\'${content_author}\'),\'%\')\n<#--来源-->\n<#if content_source??> and content_source like CONCAT(CONCAT(\'%\',\'${content_source}\'),\'%\')\n<#--属性-->\n<#if content_type??> and content_type like CONCAT(CONCAT(\'%\',\'${content_type}\'),\'%\')\n<#--描述-->\n<#if content_description??> and content_description like CONCAT(CONCAT(\'%\',\'${content_description}\'),\'%\')\n<#--关键字-->\n<#if content_keyword??> and content_keyword like CONCAT(CONCAT(\'%\',\'${content_keyword}\'),\'%\')\n<#--内容-->\n<#if content_details??> and content_details like CONCAT(CONCAT(\'%\',\'${content_details}\'),\'%\')\n<#--自定义顺序-->\n<#if content_sort??> and content_sort=${content_sort}\n<#--自定义模型-->\n<#if diyModel??>\n <#list diyModel as dm>\n <#assign json=\"${dm}\"?eval />\n and ${tableName}.${json.key} like CONCAT(CONCAT(\'%\',\'${json.value}\'),\'%\')\n \n\n<#--文章属性-->\n<#if flag?? >\n and(<#list flag?split(\',\') as item>\n <#if item?index gt 0> or\n FIND_IN_SET(\'${item}\',cms_content.content_type) > 0\n )\n\n<#if noflag??>\n and(<#list noflag?split(\',\') as item>\n <#if item?index gt 0> and\n FIND_IN_SET(\'${item}\',cms_content.content_type)=0\n or cms_content.content_type is null)\n\n\n <#--字段排序-->\n ORDER BY\n <#if topflag??>\n CASE\n <#list topflag?split(\",\") as item>\n WHEN FIND_IN_SET(\'${item}\',cms_content.content_type)>0 THEN\n ${item?index}\n \n ELSE 100\n END,\n \n ${_orderby}\n <#if order?? >\n <#if order==\'desc\'> desc\n <#if order==\'asc\'> asc\n <#else>\n desc\n \n LIMIT\n <#--判断是否分页-->\n <#if ispaging?? && (pageTag.pageNo)??>\n ${((pageTag.pageNo-1)*_size?eval)?c},${_size?default(20)}\n <#else>\n ${_size?default(20)}\n \n', NULL, '文章列表', NULL, NULL, NULL, NULL, 0, 1); INSERT INTO `mdiy_tag` (`id`, `tag_name`, `tag_type`, `tag_sql`, `tag_class`, `tag_description`, `UPDATE_BY`, `UPDATE_DATE`, `CREATE_BY`, `CREATE_DATE`, `DEL`, `NOT_DEL`) VALUES (4, 'channel', 'list', '<#assign _typeid=\'0\'/>\n<#assign _size=\'9999\'/>\n<#if column?? && column.id?? && column.id?number gt 0>\n <#assign _typeid=\'${column.id}\'>\n <#assign selfid=\'${column.id}\'>\n\n\n<#if typeid??>\n <#assign _typeid=\'${typeid}\'>\n\n<#if size??>\n <#assign _size=\'${size}\'>\n\n\nselect\n cms_category.id as \"id\",\n cms_category.id as \"typeid\",\n cms_category.category_title as \"typetitle\",\n cms_category.category_short_title as \"typeshorttitle\",\n <#--动态链接-->\n <#if isDo?? && isDo>\n IF(cms_category.category_type=2,CONCAT(\'${modelName}/view.do?style=${templateName!\"\"}&typeid=\', cms_category.id),CONCAT(\'${modelName}/list.do?style=${templateName!\"\"}&typeid=\', cms_category.id)) as \"typelink\",\n <#else>\n <#--栏目类型为链接-->\n <#if shortSwitch?? && shortSwitch>\n CONCAT(cms_category.category_pinyin,\'.html\') AS \"typelink\",\n <#else>\n CONCAT(cms_category.category_path,\'/index.html\') as \"typelink\",\n \n \n cms_category.category_keyword as \"typekeyword\",\n cms_category.category_diy_url as \"typeurl\",\n cms_category.category_flag as \"flag\",\n cms_category.category_id as \"parentid\",\n cms_category.category_parent_ids as \"parentids\",\n cms_category.category_descrip as \"typedescrip\",\n cms_category.category_type as \"type\",\n cms_category.category_path as \"typepath\",\n cms_category.leaf as \"typeleaf\",\n cms_category.category_img as \"typelitpic\" ,\n cms_category.category_ico as \"typeico\" ,\n <#if tableName??>${tableName}.*,\n ( SELECT count(*) FROM cms_category cc WHERE cc.category_id = cms_category.id AND cc.del = 0 ) AS \"childsize\"\nfrom\n cms_category\n <#--判断是否有自定义模型表-->\n <#if tableName??>LEFT JOIN ${tableName} ON ${tableName}.link_id=cms_category.id\nwhere\n cms_category.del=0\n and cms_category.category_display = \'enable\'\n <#--自定义模型-->\n <#if diyModel??>\n <#list diyModel as dm>\n <#assign json=\"${dm}\"?eval />\n and ${tableName}.${json.key} like CONCAT(\'%\',\'${json.value}\',\'%\')\n \n \n <#--根据站点编号查询-->\n <#if appId?? >\n and cms_category.app_id=${appId}\n \n\n <#--栏目属性-->\n <#if flag?? >\n and\n (<#list flag?split(\',\') as item>\n <#if item?index gt 0> or\n FIND_IN_SET(\'${item}\',cms_category.category_flag)\n )\n \n\n <#if noflag?? >\n and\n (<#list noflag?split(\',\') as item>\n <#if item?index gt 0> and\n FIND_IN_SET(\'${item}\',cms_category.category_flag)=0\n or cms_category.category_flag is null)\n \n\n <#--type默认son-->\n <#if !type??||!type?has_content>\n <#assign type=\'son\'/>\n \n\n <#if type?has_content>\n <#--顶级栏目(单个)-->\n <#if type==\'top\'>\n <#if _typeid != \'0\'>\n and (cms_category.id = cms_category.top_id or cms_category.top_id = 0)\n \n\n <#elseif type==\'nav\'>\n and(cms_category.category_id=0 or cms_category.category_id is null)\n\n <#--同级栏目(多个)-->\n <#elseif type==\'level\'>\n <#if _typeid != \'0\'>\n and cms_category.category_id=(select category_id from cms_category where id=${_typeid})\n \n\n <#--当前栏目(单个)-->\n <#elseif type==\'self\'>\n <#if _typeid != \'0\'>\n and cms_category.id=${_typeid}\n \n\n <#--当前栏目的所属栏目(多个)-->\n <#elseif type==\'path\'>\n <#if _typeid != \'0\'>\n and cms_category.id in\n (<#if column?? && column.categoryParentIds??>${column.categoryParentIds},${_typeid})\n \n\n <#--子栏目(多个)-->\n <#elseif type==\'son\'>\n <#if _typeid != \'0\'>\n and cms_category.category_id=${_typeid}\n \n\n <#--上一级栏目没有则取当前栏目(单个)-->\n <#elseif type==\'parent\'>\n <#if _typeid != \'0\'>\n and\n <#if column?? && column.categoryId??>\n cms_category.id=${column.categoryId}\n <#else>\n cms_category.id=${_typeid}\n \n \n \n\n <#else> <#--默认顶级栏目-->\n and\n <#if _typeid != \'0\'>\n cms_category.id=${_typeid}\n <#else>\n (cms_category.category_id=0 or cms_category.category_id is null)\n \n \n\n <#--字段排序-->\n <#if type == \'path\'>\n ORDER BY cms_category.category_path asc\n <#else>\n <#if orderby?? >\n ORDER BY\n <#if orderby==\'date\'> cms_category.create_date\n <#elseif orderby==\'sort\'> cms_category.category_sort\n <#else>cms_category.id\n \n \n\n <#if order?? >\n <#if order==\'desc\'> desc\n <#if order==\'asc\'> asc\n \n \n LIMIT\n ${_size?default(9999)}', NULL, '通用栏目', NULL, NULL, NULL, NULL, 0, 1); INSERT INTO `mdiy_tag` (`id`, `tag_name`, `tag_type`, `tag_sql`, `tag_class`, `tag_description`, `UPDATE_BY`, `UPDATE_DATE`, `CREATE_BY`, `CREATE_DATE`, `DEL`, `NOT_DEL`) VALUES (5, 'global', 'single', 'select\n APP_NAME as \"name\",\n app_logo as \"logo\",\n app_keyword as \"keyword\",\n app_description as \"descrip\",\n app_copyright as \"copyright\",\n \'${contextPath}\' as \"contextpath\",\n <#--动态解析 -->\n <#if isDo?? && isDo>\n \'${url}\' as \"url\",\n \'${url}\' as \"host\",\n \'/\' as \"html\",\n <#--使用地址栏的域名 -->\n <#else>\n <#if shortSwitch?? && shortSwitch>\n CONCAT(\'${url}\',\'${appDir}<#if appDir?has_content>/\') as \"url\",\n \'<#if appDir?has_content>/${appDir}/\' as \"html\",\n <#else>\n CONCAT(CONCAT(\'${url}\',\'${html}\'),\'<#if appDir?has_content>/${appDir}\') as \"url\",\n CONCAT(CONCAT(\'/${html}\',\'<#if appDir?has_content>/${appDir}\'),\'/\') as \"html\",\n \n \'${url}\' as \"host\",\n \n CONCAT(CONCAT(CONCAT(CONCAT(\'template/\',id),\'/\'),app_style),\'/\') as \"style\"\nfrom app\n <#--根据站点编号查询-->\n <#if appId?? >\n where id = ${appId}\n ', NULL, '全局', NULL, NULL, NULL, NULL, 0, 1); INSERT INTO `mdiy_tag` (`id`, `tag_name`, `tag_type`, `tag_sql`, `tag_class`, `tag_description`, `UPDATE_BY`, `UPDATE_DATE`, `CREATE_BY`, `CREATE_DATE`, `DEL`, `NOT_DEL`) VALUES (7, 'field', 'single', 'SELECT\r\n cms_content.id as \"id\",\r\n <#--这里会存在id覆盖的情况,所以需要在cms_content.id下面-->\r\n <#if tableName??>${tableName}.*,\r\n <#--查询站点编号-->\r\n <#if appId??>\r\n cms_content.app_id as \"appId\",\r\n \r\n content_title as \"title\",\r\n content_short_title AS \"shorttitle\",\r\n content_author as \"author\",\r\n content_source as \"source\",\r\n content_out_link as \"outlink\",\r\n content_details as \"content\",\r\n content_datetime as \"date\",\r\n content_description as \"descrip\",\r\n content_keyword as \"keyword\",\r\n <#if contextPath?? && contextPath != \"/\">\r\n CONCAT(CONCAT( \'\') as \"hit\",\r\n <#else>\r\n CONCAT(CONCAT( \'\') as \"hit\",\r\n \r\n content_type as \"flag\",\r\n content_tags as \"tags\",\r\n category_title as \"typetitle\",\r\n cms_content.content_img as \"litpic\",\r\n <#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/mcms/view.do?id=\', cms_content.id) as \"link\",\r\n <#else>\r\n <#if shortSwitch?? && shortSwitch>\r\n CONCAT(cms_content.id, \'.html\' ) as \"link\",\r\n <#else>\r\n CONCAT(CONCAT( cms_category.category_path, \'/\' ), CONCAT(cms_content.id, \'.html\' )) as \"link\",\r\n \r\n \r\n cms_category.id as \"typeid\",\r\n cms_category.leaf as \"typeleaf\",\r\n cms_category.category_title as \"typetitle\",\r\n cms_category.category_short_title AS \"typeshorttitle\",\r\n cms_category.category_img as \"typelitpic\",\r\n cms_category.category_ico as \"typeico\",\r\n cms_category.category_path as \"typepath\",\r\n cms_category.top_id as \"topid\",\r\n cms_category.category_flag as \"typeflag\",\r\n cms_category.category_id as \"parentid\",\r\n cms_category.category_parent_ids as \"parentids\",\r\n cms_category.category_keyword as \"typekeyword\",\r\n cms_category.category_descrip as \"typedescrip\",\r\n <#--动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/list.do?typeid=\', cms_category.id) as \"typelink\"\r\n <#else>\r\n <#if shortSwitch?? && shortSwitch>\r\n CONCAT(category_pinyin,\'.html\') AS \"typelink\"\r\n <#else>\r\n CONCAT(category_path,\'/index.html\') AS \"typelink\"\r\n \r\n \r\n\r\nFROM cms_content\r\n LEFT JOIN cms_category ON\r\n cms_category.id = cms_content.category_id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableName??>left join ${tableName} on ${tableName}.link_id=cms_content.id\r\nWHERE\r\n <#--如果是栏目列表页没有文章id所以只取栏目id-->\r\n <#if column??&&column.id??&&!id??>\r\n cms_category.id=${column.id} and\r\n \r\n <#--根据站点编号查询-->\r\n <#if appId??>\r\n cms_content.app_id = ${appId} and\r\n \r\n cms_content.del=0\r\n <#if id??> and cms_content.id=${id}\r\n', NULL, '文章内容', NULL, NULL, NULL, NULL, 0, 1); diff --git a/doc/mcms-5.3.4.sql b/doc/mcms-5.3.4.sql index ada468b5..07fe9e0c 100644 --- a/doc/mcms-5.3.4.sql +++ b/doc/mcms-5.3.4.sql @@ -406,26 +406,26 @@ COMMIT; -- ---------------------------- DROP TABLE IF EXISTS `mdiy_tag`; CREATE TABLE `mdiy_tag` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `tag_name` varchar(255) DEFAULT NULL COMMENT '标签名称', - `tag_type` varchar(255) DEFAULT NULL COMMENT '标签类型', - `tag_sql` text COMMENT '标签sql', - `tag_class` varchar(255) DEFAULT NULL COMMENT '标签类', - `tag_description` varchar(255) DEFAULT NULL COMMENT '描述', - `UPDATE_BY` varchar(11) DEFAULT NULL COMMENT '更新人', - `UPDATE_DATE` datetime DEFAULT NULL COMMENT '更新时间', - `CREATE_BY` varchar(11) DEFAULT NULL COMMENT '创建人', - `CREATE_DATE` datetime DEFAULT NULL COMMENT '创建时间', - `DEL` int(1) DEFAULT '0' COMMENT '删除标记', - `NOT_DEL` int(1) DEFAULT '0' COMMENT '1为不能删除,主要用于系统默认数据,0为一般数据,主要是前端控制', - PRIMARY KEY (`id`) USING BTREE + `id` int(11) NOT NULL AUTO_INCREMENT, + `tag_name` varchar(255) DEFAULT NULL COMMENT '标签名称', + `tag_type` varchar(255) DEFAULT NULL COMMENT '标签类型', + `tag_sql` text COMMENT '标签sql', + `tag_class` varchar(255) DEFAULT NULL COMMENT '标签类', + `tag_description` varchar(255) DEFAULT NULL COMMENT '描述', + `UPDATE_BY` varchar(11) DEFAULT NULL COMMENT '更新人', + `UPDATE_DATE` datetime DEFAULT NULL COMMENT '更新时间', + `CREATE_BY` varchar(11) DEFAULT NULL COMMENT '创建人', + `CREATE_DATE` datetime DEFAULT NULL COMMENT '创建时间', + `DEL` int(1) DEFAULT '0' COMMENT '删除标记', + `NOT_DEL` int(1) DEFAULT '0' COMMENT '1为不能删除,主要用于系统默认数据,0为一般数据,主要是前端控制', + PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='标签'; -- ---------------------------- -- Records of mdiy_tag -- ---------------------------- BEGIN; -INSERT INTO `mdiy_tag` (`id`, `tag_name`, `tag_type`, `tag_sql`, `tag_class`, `tag_description`, `UPDATE_BY`, `UPDATE_DATE`, `CREATE_BY`, `CREATE_DATE`, `DEL`, `NOT_DEL`) VALUES (3, 'arclist', 'list', '<#assign _typeid=\'\'/>\r\n<#assign _typetitle=\'\'/>\r\n<#-- 分页数,默认返回20条数据 -->\r\n<#assign _size=\'20\'/>\r\n<#if column?? && column.id?? && column.id?number gt 0>\r\n <#assign _typeid=\'${column.id}\'>\r\n\r\n<#if typeid??>\r\n <#assign _typeid=\'${typeid}\'>\r\n\r\n<#if typetitle??>\r\n <#assign _typetitle=\'${typetitle}\'>\r\n\r\n<#if size??>\r\n <#assign _size=\'${size}\'>\r\n\r\n\r\n<#if orderby?? >\r\n <#if orderby==\'date\'>\r\n <#assign _orderby=\'content_datetime\'>\r\n <#elseif orderby==\'updatedate\'>\r\n <#assign _orderby=\'cms_content.update_date\'>\r\n <#elseif orderby==\'hit\'>\r\n <#assign _orderby=\'content_hit\'>\r\n <#elseif orderby==\'sort\'>\r\n <#assign _orderby=\'content_sort\'>\r\n <#else>\r\n <#assign _orderby=\'cms_content.content_datetime\'>\r\n \r\n<#else>\r\n <#assign _orderby=\'cms_content.content_datetime\'>\r\n\r\n\r\nSELECT\r\n cms_content.id AS \"id\",\r\n content_title AS \"title\",\r\n content_short_title AS \"shorttitle\",\r\n content_author AS \"author\",\r\n content_source AS \"source\",\r\n content_out_link AS \"outlink\",\r\n content_tags AS \"tags\",\r\n\r\n category.category_title AS \"typetitle\",\r\n category.category_short_title AS \"typeshorttitle\",\r\n category.id AS \"typeid\",\r\n category.category_path AS \"typepath\",\r\n category.category_img AS \"typelitpic\",\r\n category.category_ico AS \"typeico\",\r\n category.category_keyword as \"typekeyword\",\r\n category.top_id as \"topid\",\r\n category.category_id as \"parentid\",\r\n category.category_parent_ids as \"parentids\",\r\n category.category_type AS \"type\",\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'${modelName}/list.do?style=${templateName!\"\"}&typeid=\', category.category_id) as \"typelink\",\r\n <#else>\r\n <#--栏目类型为链接-->\r\n <#if shortSwitch?? && shortSwitch>\r\n CONCAT(category.category_pinyin,\'.html\') AS \"typelink\",\r\n <#else>\r\n CONCAT(category.category_path,\'/index.html\') AS \"typelink\",\r\n \r\n \r\n content_description AS \"descrip\",\r\n content_hit AS \"hit\",\r\n content_type AS \"flag\",\r\n cms_content.content_keyword AS \"keyword\",\r\n content_img AS \"litpic\",\r\n <#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'${modelName}/view.do?style=${templateName!\"\"}&id=\', cms_content.id) as \"link\",\r\n <#else>\r\n <#if shortSwitch?? && shortSwitch>\r\n CONCAT(cms_content.id,\'.html\') AS \"link\",\r\n <#else>\r\n CONCAT(CONCAT( category.category_path, \'/\' ), CONCAT(CASE category_type WHEN \'2\' THEN \'index\' ELSE cms_content.id END , \'.html\' )) as \"link\",\r\n \r\n \r\n <#if tableName??>${tableName}.*,\r\n content_datetime AS \"date\"\r\nFROM\r\n cms_content\r\nLEFT JOIN\r\n cms_category as category\r\nON cms_content.category_id = category.id\r\n<#--判断是否有自定义模型表-->\r\n<#if tableName??>\r\n LEFT JOIN ${tableName} ON ${tableName}.link_id=cms_content.id\r\n\r\nWHERE\r\n content_display=0\r\n and category_display=\'enable\'\r\n and cms_content.del=0\r\n\r\n<#--文章审核-->\r\n<#if contentApprove?? && contentApprove>\r\n and cms_content.progress_status=\'终审通过\'\r\n\r\n<#--根据站点编号查询-->\r\n<#if appId?? >\r\n and cms_content.app_id=${appId}\r\n and cms_content.id>0\r\n\r\n<#--判断是否有搜索分类集合,暂时移除 _typeid=\"\" 条件-->\r\n<#if search??>\r\n and category_is_search=\'enable\'\r\n <#-- 文章标签 -->\r\n <#if search.content_tag??>and FIND_IN_SET(\'${search.content_tag}\',content_tags) > 0\r\n <#if search.categoryIds?has_content>\r\n and (\r\n <#list search.categoryIds?split(\",\") as item>\r\n <#if item?index gt 0>\r\n or\r\n \r\n (cms_content.category_id=${item}\r\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\r\n <#if _typetitle?has_content>\r\n and cms_category.category_title=\'${_typetitle}\'\r\n \r\n and FIND_IN_SET(${item},CATEGORY_PARENT_IDS) > 0)\r\n )\r\n \r\n )\r\n \r\n <#--标题-->\r\n <#if search.content_title??> and content_title like CONCAT(CONCAT(\'%\',\'${search.content_title}\'),\'%\')\r\n <#--作者-->\r\n <#if search.content_author??> and content_author like CONCAT(CONCAT(\'%\',\'${search.content_author}\'),\'%\')\r\n <#--来源-->\r\n <#if search.content_source??> and content_source like CONCAT(CONCAT(\'%\',\'${search.content_source}\'),\'%\')\r\n <#--属性-->\r\n <#if search.content_type??>\r\n and(<#list search.content_type?split(\',\') as item>\r\n <#if item?index gt 0> or\r\n FIND_IN_SET(\'${item}\',cms_content.content_type) > 0\r\n )\r\n \r\n <#--描述-->\r\n <#if search.content_description??>\r\n and content_description like CONCAT(CONCAT(\'%\',\'${search.content_description}\'),\'%\')\r\n \r\n <#--关键字-->\r\n <#if search.content_keyword??> and content_keyword like CONCAT(CONCAT(\'%\',\'${search.content_keyword}\'),\'%\')\r\n <#--内容-->\r\n <#if search.content_details??> and content_details like CONCAT(CONCAT(\'%\',\'${search.content_details}\'),\'%\')\r\n <#--自定义顺序-->\r\n <#if search.content_sort??> and content_sort=${search.content_sort}\r\n <#--时间范围-->\r\n <#if search.content_datetime_start??&&search.content_datetime_end??>\r\n and content_datetime between \'${search.content_datetime_start}\' and \'${search.content_datetime_end}\'\r\n \r\n<#else>\r\n <#--查询栏目-->\r\n <#if _typeid?has_content && _typeid?string != \'0\'>\r\n and (cms_content.category_id=${_typeid}\r\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\r\n <#if _typetitle?has_content>\r\n and cms_category.category_title=\'${_typetitle}\'\r\n \r\n and FIND_IN_SET(${_typeid},CATEGORY_PARENT_IDS) > 0))\r\n <#elseif typeids?has_content>\r\n and (\r\n <#list typeids?split(\",\") as item>\r\n <#if item?index gt 0>\r\n or\r\n \r\n (cms_content.category_id=${item}\r\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\r\n <#if _typetitle?has_content>\r\n and cms_category.category_title=\'${_typetitle}\'\r\n \r\n and FIND_IN_SET(${item},CATEGORY_PARENT_IDS) > 0)\r\n )\r\n \r\n )\r\n \r\n\r\n<#--判断搜索分类结束-->\r\n<#--标题-->\r\n<#if content_title??> and content_title like CONCAT(CONCAT(\'%\',\'${content_title}\'),\'%\')\r\n<#--作者-->\r\n<#if content_author??> and content_author like CONCAT(CONCAT(\'%\',\'${content_author}\'),\'%\')\r\n<#--来源-->\r\n<#if content_source??> and content_source like CONCAT(CONCAT(\'%\',\'${content_source}\'),\'%\')\r\n<#--属性-->\r\n<#if content_type??> and content_type like CONCAT(CONCAT(\'%\',\'${content_type}\'),\'%\')\r\n<#--描述-->\r\n<#if content_description??> and content_description like CONCAT(CONCAT(\'%\',\'${content_description}\'),\'%\')\r\n<#--关键字-->\r\n<#if content_keyword??> and content_keyword like CONCAT(CONCAT(\'%\',\'${content_keyword}\'),\'%\')\r\n<#--内容-->\r\n<#if content_details??> and content_details like CONCAT(CONCAT(\'%\',\'${content_details}\'),\'%\')\r\n<#--自定义顺序-->\r\n<#if content_sort??> and content_sort=${content_sort}\r\n<#--自定义模型-->\r\n<#if diyModel??>\r\n <#list diyModel as dm>\r\n <#assign json=\"${dm}\"?eval />\r\n and ${tableName}.${json.key} like CONCAT(CONCAT(\'%\',\'${json.value}\'),\'%\')\r\n \r\n\r\n<#--文章属性-->\r\n<#if flag?? >\r\n and(<#list flag?split(\',\') as item>\r\n <#if item?index gt 0> or\r\n FIND_IN_SET(\'${item}\',cms_content.content_type) > 0\r\n )\r\n\r\n<#if noflag??>\r\n and(<#list noflag?split(\',\') as item>\r\n <#if item?index gt 0> and\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)=0\r\n or cms_content.content_type is null)\r\n\r\n\r\n <#--字段排序-->\r\n ORDER BY\r\n <#if topflag??>\r\n CASE\r\n <#list topflag?split(\",\") as item>\r\n WHEN FIND_IN_SET(\'${item}\',cms_content.content_type)>0 THEN\r\n ${item?index}\r\n \r\n ELSE 100\r\n END,\r\n \r\n ${_orderby}\r\n <#if order?? >\r\n <#if order==\'desc\'> desc\r\n <#if order==\'asc\'> asc\r\n <#else>\r\n desc\r\n \r\n LIMIT\r\n <#--判断是否分页-->\r\n <#if ispaging?? && (pageTag.pageNo)??>\r\n ${((pageTag.pageNo-1)*_size?eval)?c},${_size?default(20)}\r\n <#else>\r\n ${_size?default(20)}\r\n \r\n', NULL, '文章列表', NULL, NULL, NULL, NULL, 0, 1); +INSERT INTO `mdiy_tag` (`id`, `tag_name`, `tag_type`, `tag_sql`, `tag_class`, `tag_description`, `UPDATE_BY`, `UPDATE_DATE`, `CREATE_BY`, `CREATE_DATE`, `DEL`, `NOT_DEL`) VALUES (3, 'arclist', 'list', '<#assign _typeid=\'\'/>\n<#assign _typetitle=\'\'/>\n<#-- 分页数,默认返回20条数据 -->\n<#assign _size=\'20\'/>\n<#if column?? && column.id?? && column.id?number gt 0>\n <#assign _typeid=\'${column.id}\'>\n\n<#if typeid??>\n <#assign _typeid=\'${typeid}\'>\n\n<#if typetitle??>\n <#assign _typetitle=\'${typetitle}\'>\n\n<#if size??>\n <#assign _size=\'${size}\'>\n\n\n<#if orderby?? >\n <#if orderby==\'date\'>\n <#assign _orderby=\'content_datetime\'>\n <#elseif orderby==\'updatedate\'>\n <#assign _orderby=\'cms_content.update_date\'>\n <#elseif orderby==\'hit\'>\n <#assign _orderby=\'content_hit\'>\n <#elseif orderby==\'sort\'>\n <#assign _orderby=\'content_sort\'>\n <#else>\n <#assign _orderby=\'cms_content.content_datetime\'>\n \n<#else>\n <#assign _orderby=\'cms_content.content_datetime\'>\n\n\nSELECT\n cms_content.id AS \"id\",\n content_title AS \"title\",\n content_short_title AS \"shorttitle\",\n content_author AS \"author\",\n content_source AS \"source\",\n content_out_link AS \"outlink\",\n content_tags AS \"tags\",\n\n category.category_title AS \"typetitle\",\n category.category_short_title AS \"typeshorttitle\",\n category.id AS \"typeid\",\n category.category_path AS \"typepath\",\n category.category_img AS \"typelitpic\",\n category.category_ico AS \"typeico\",\n category.category_keyword as \"typekeyword\",\n category.top_id as \"topid\",\n category.category_id as \"parentid\",\n category.category_parent_ids as \"parentids\",\n category.category_type AS \"type\",\n <#--列表页动态链接-->\n <#if isDo?? && isDo>\n CONCAT(\'${modelName}/list.do?style=${templateName!\"\"}&typeid=\', category.category_id) as \"typelink\",\n <#else>\n <#--栏目类型为链接-->\n <#if shortSwitch?? && shortSwitch>\n CONCAT(category.category_pinyin,\'.html\') AS \"typelink\",\n <#else>\n CONCAT(category.category_path,\'/index.html\') AS \"typelink\",\n \n \n content_description AS \"descrip\",\n content_hit AS \"hit\",\n content_type AS \"flag\",\n cms_content.content_keyword AS \"keyword\",\n content_img AS \"litpic\",\n <#--内容页动态链接-->\n <#if isDo?? && isDo>\n CONCAT(\'${modelName}/view.do?style=${templateName!\"\"}&id=\', cms_content.id) as \"link\",\n <#else>\n <#if shortSwitch?? && shortSwitch>\n CONCAT(cms_content.id,\'.html\') AS \"link\",\n <#else>\n CONCAT(CONCAT( category.category_path, \'/\' ), CONCAT(CASE category_type WHEN \'2\' THEN \'index\' ELSE cms_content.id END , \'.html\' )) as \"link\",\n \n \n <#if tableName??>${tableName}.*,\n content_datetime AS \"date\"\nFROM\n cms_content\nLEFT JOIN\n cms_category as category\nON cms_content.category_id = category.id\n<#--判断是否有自定义模型表-->\n<#if tableName??>\n LEFT JOIN ${tableName} ON ${tableName}.link_id=cms_content.id\n\nWHERE\n content_display=0\n and category_display=\'enable\'\n and cms_content.del=0\n\n<#--文章审核-->\n<#if contentApprove?? && contentApprove>\n and cms_content.progress_status=\'终审通过\'\n\n<#--根据站点编号查询-->\n<#if appId?? >\n and cms_content.app_id=${appId}\n and cms_content.id>0\n\n<#--判断是否有搜索分类集合,暂时移除 _typeid=\"\" 条件-->\n<#if search?? && !typeid??>\n and category_is_search=\'enable\'\n <#-- 文章标签 -->\n <#if search.content_tag??>and FIND_IN_SET(\'${search.content_tag}\',content_tags) > 0\n <#if search.categoryIds?has_content>\n and (\n <#list search.categoryIds?split(\",\") as item>\n <#if item?index gt 0>\n or\n \n (cms_content.category_id=${item}\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\n <#if _typetitle?has_content>\n and cms_category.category_title=\'${_typetitle}\'\n \n and FIND_IN_SET(${item},CATEGORY_PARENT_IDS) > 0)\n )\n \n )\n \n <#--标题-->\n <#if search.content_title??> and content_title like CONCAT(CONCAT(\'%\',\'${search.content_title}\'),\'%\')\n <#--作者-->\n <#if search.content_author??> and content_author like CONCAT(CONCAT(\'%\',\'${search.content_author}\'),\'%\')\n <#--来源-->\n <#if search.content_source??> and content_source like CONCAT(CONCAT(\'%\',\'${search.content_source}\'),\'%\')\n <#--属性-->\n <#if search.content_type??>\n and(<#list search.content_type?split(\',\') as item>\n <#if item?index gt 0> or\n FIND_IN_SET(\'${item}\',cms_content.content_type) > 0\n )\n \n <#--描述-->\n <#if search.content_description??>\n and content_description like CONCAT(CONCAT(\'%\',\'${search.content_description}\'),\'%\')\n \n <#--关键字-->\n <#if search.content_keyword??> and content_keyword like CONCAT(CONCAT(\'%\',\'${search.content_keyword}\'),\'%\')\n <#--内容-->\n <#if search.content_details??> and content_details like CONCAT(CONCAT(\'%\',\'${search.content_details}\'),\'%\')\n <#--自定义顺序-->\n <#if search.content_sort??> and content_sort=${search.content_sort}\n <#--时间范围-->\n <#if search.content_datetime_start??&&search.content_datetime_end??>\n and content_datetime between \'${search.content_datetime_start}\' and \'${search.content_datetime_end}\'\n \n<#else>\n <#--查询栏目-->\n <#if _typeid?has_content && _typeid?string != \'0\'>\n and (cms_content.category_id=${_typeid}\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\n <#if _typetitle?has_content>\n and cms_category.category_title=\'${_typetitle}\'\n \n and FIND_IN_SET(${_typeid},CATEGORY_PARENT_IDS) > 0))\n <#elseif typeids?has_content>\n and (\n <#list typeids?split(\",\") as item>\n <#if item?index gt 0>\n or\n \n (cms_content.category_id=${item}\n or cms_content.category_id in (select id FROM cms_category where cms_category.del=0\n <#if _typetitle?has_content>\n and cms_category.category_title=\'${_typetitle}\'\n \n and FIND_IN_SET(${item},CATEGORY_PARENT_IDS) > 0)\n )\n \n )\n \n\n<#--判断搜索分类结束-->\n<#--标题-->\n<#if content_title??> and content_title like CONCAT(CONCAT(\'%\',\'${content_title}\'),\'%\')\n<#--作者-->\n<#if content_author??> and content_author like CONCAT(CONCAT(\'%\',\'${content_author}\'),\'%\')\n<#--来源-->\n<#if content_source??> and content_source like CONCAT(CONCAT(\'%\',\'${content_source}\'),\'%\')\n<#--属性-->\n<#if content_type??> and content_type like CONCAT(CONCAT(\'%\',\'${content_type}\'),\'%\')\n<#--描述-->\n<#if content_description??> and content_description like CONCAT(CONCAT(\'%\',\'${content_description}\'),\'%\')\n<#--关键字-->\n<#if content_keyword??> and content_keyword like CONCAT(CONCAT(\'%\',\'${content_keyword}\'),\'%\')\n<#--内容-->\n<#if content_details??> and content_details like CONCAT(CONCAT(\'%\',\'${content_details}\'),\'%\')\n<#--自定义顺序-->\n<#if content_sort??> and content_sort=${content_sort}\n<#--自定义模型-->\n<#if diyModel??>\n <#list diyModel as dm>\n <#assign json=\"${dm}\"?eval />\n and ${tableName}.${json.key} like CONCAT(CONCAT(\'%\',\'${json.value}\'),\'%\')\n \n\n<#--文章属性-->\n<#if flag?? >\n and(<#list flag?split(\',\') as item>\n <#if item?index gt 0> or\n FIND_IN_SET(\'${item}\',cms_content.content_type) > 0\n )\n\n<#if noflag??>\n and(<#list noflag?split(\',\') as item>\n <#if item?index gt 0> and\n FIND_IN_SET(\'${item}\',cms_content.content_type)=0\n or cms_content.content_type is null)\n\n\n <#--字段排序-->\n ORDER BY\n <#if topflag??>\n CASE\n <#list topflag?split(\",\") as item>\n WHEN FIND_IN_SET(\'${item}\',cms_content.content_type)>0 THEN\n ${item?index}\n \n ELSE 100\n END,\n \n ${_orderby}\n <#if order?? >\n <#if order==\'desc\'> desc\n <#if order==\'asc\'> asc\n <#else>\n desc\n \n LIMIT\n <#--判断是否分页-->\n <#if ispaging?? && (pageTag.pageNo)??>\n ${((pageTag.pageNo-1)*_size?eval)?c},${_size?default(20)}\n <#else>\n ${_size?default(20)}\n \n', NULL, '文章列表', NULL, NULL, NULL, NULL, 0, 1); INSERT INTO `mdiy_tag` (`id`, `tag_name`, `tag_type`, `tag_sql`, `tag_class`, `tag_description`, `UPDATE_BY`, `UPDATE_DATE`, `CREATE_BY`, `CREATE_DATE`, `DEL`, `NOT_DEL`) VALUES (4, 'channel', 'list', '<#assign _typeid=\'0\'/>\n<#assign _size=\'9999\'/>\n<#if column?? && column.id?? && column.id?number gt 0>\n <#assign _typeid=\'${column.id}\'>\n <#assign selfid=\'${column.id}\'>\n\n\n<#if typeid??>\n <#assign _typeid=\'${typeid}\'>\n\n<#if size??>\n <#assign _size=\'${size}\'>\n\n\nselect\n cms_category.id as \"id\",\n cms_category.id as \"typeid\",\n cms_category.category_title as \"typetitle\",\n cms_category.category_short_title as \"typeshorttitle\",\n <#--动态链接-->\n <#if isDo?? && isDo>\n IF(cms_category.category_type=2,CONCAT(\'${modelName}/view.do?style=${templateName!\"\"}&typeid=\', cms_category.id),CONCAT(\'${modelName}/list.do?style=${templateName!\"\"}&typeid=\', cms_category.id)) as \"typelink\",\n <#else>\n <#--栏目类型为链接-->\n <#if shortSwitch?? && shortSwitch>\n CONCAT(cms_category.category_pinyin,\'.html\') AS \"typelink\",\n <#else>\n CONCAT(cms_category.category_path,\'/index.html\') as \"typelink\",\n \n \n cms_category.category_keyword as \"typekeyword\",\n cms_category.category_diy_url as \"typeurl\",\n cms_category.category_flag as \"flag\",\n cms_category.category_id as \"parentid\",\n cms_category.category_parent_ids as \"parentids\",\n cms_category.category_descrip as \"typedescrip\",\n cms_category.category_type as \"type\",\n cms_category.category_path as \"typepath\",\n cms_category.leaf as \"typeleaf\",\n cms_category.category_img as \"typelitpic\" ,\n cms_category.category_ico as \"typeico\" ,\n <#if tableName??>${tableName}.*,\n ( SELECT count(*) FROM cms_category cc WHERE cc.category_id = cms_category.id AND cc.del = 0 ) AS \"childsize\"\nfrom\n cms_category\n <#--判断是否有自定义模型表-->\n <#if tableName??>LEFT JOIN ${tableName} ON ${tableName}.link_id=cms_category.id\nwhere\n cms_category.del=0\n and cms_category.category_display = \'enable\'\n <#--自定义模型-->\n <#if diyModel??>\n <#list diyModel as dm>\n <#assign json=\"${dm}\"?eval />\n and ${tableName}.${json.key} like CONCAT(\'%\',\'${json.value}\',\'%\')\n \n \n <#--根据站点编号查询-->\n <#if appId?? >\n and cms_category.app_id=${appId}\n \n\n <#--栏目属性-->\n <#if flag?? >\n and\n (<#list flag?split(\',\') as item>\n <#if item?index gt 0> or\n FIND_IN_SET(\'${item}\',cms_category.category_flag)\n )\n \n\n <#if noflag?? >\n and\n (<#list noflag?split(\',\') as item>\n <#if item?index gt 0> and\n FIND_IN_SET(\'${item}\',cms_category.category_flag)=0\n or cms_category.category_flag is null)\n \n\n <#--type默认son-->\n <#if !type??||!type?has_content>\n <#assign type=\'son\'/>\n \n\n <#if type?has_content>\n <#--顶级栏目(单个)-->\n <#if type==\'top\'>\n <#if _typeid != \'0\'>\n and (cms_category.id = cms_category.top_id or cms_category.top_id = 0)\n \n\n <#elseif type==\'nav\'>\n and(cms_category.category_id=0 or cms_category.category_id is null)\n\n <#--同级栏目(多个)-->\n <#elseif type==\'level\'>\n <#if _typeid != \'0\'>\n and cms_category.category_id=(select category_id from cms_category where id=${_typeid})\n \n\n <#--当前栏目(单个)-->\n <#elseif type==\'self\'>\n <#if _typeid != \'0\'>\n and cms_category.id=${_typeid}\n \n\n <#--当前栏目的所属栏目(多个)-->\n <#elseif type==\'path\'>\n <#if _typeid != \'0\'>\n and cms_category.id in\n (<#if column?? && column.categoryParentIds??>${column.categoryParentIds},${_typeid})\n \n\n <#--子栏目(多个)-->\n <#elseif type==\'son\'>\n <#if _typeid != \'0\'>\n and cms_category.category_id=${_typeid}\n \n\n <#--上一级栏目没有则取当前栏目(单个)-->\n <#elseif type==\'parent\'>\n <#if _typeid != \'0\'>\n and\n <#if column?? && column.categoryId??>\n cms_category.id=${column.categoryId}\n <#else>\n cms_category.id=${_typeid}\n \n \n \n\n <#else> <#--默认顶级栏目-->\n and\n <#if _typeid != \'0\'>\n cms_category.id=${_typeid}\n <#else>\n (cms_category.category_id=0 or cms_category.category_id is null)\n \n \n\n <#--字段排序-->\n <#if type == \'path\'>\n ORDER BY cms_category.category_path asc\n <#else>\n <#if orderby?? >\n ORDER BY\n <#if orderby==\'date\'> cms_category.create_date\n <#elseif orderby==\'sort\'> cms_category.category_sort\n <#else>cms_category.id\n \n \n\n <#if order?? >\n <#if order==\'desc\'> desc\n <#if order==\'asc\'> asc\n \n \n LIMIT\n ${_size?default(9999)}', NULL, '通用栏目', NULL, NULL, NULL, NULL, 0, 1); INSERT INTO `mdiy_tag` (`id`, `tag_name`, `tag_type`, `tag_sql`, `tag_class`, `tag_description`, `UPDATE_BY`, `UPDATE_DATE`, `CREATE_BY`, `CREATE_DATE`, `DEL`, `NOT_DEL`) VALUES (5, 'global', 'single', 'select\n APP_NAME as \"name\",\n app_logo as \"logo\",\n app_keyword as \"keyword\",\n app_description as \"descrip\",\n app_copyright as \"copyright\",\n \'${contextPath}\' as \"contextpath\",\n <#--动态解析 -->\n <#if isDo?? && isDo>\n \'${url}\' as \"url\",\n \'${url}\' as \"host\",\n \'/\' as \"html\",\n <#--使用地址栏的域名 -->\n <#else>\n <#if shortSwitch?? && shortSwitch>\n CONCAT(\'${url}\',\'${appDir}<#if appDir?has_content>/\') as \"url\",\n \'<#if appDir?has_content>/${appDir}/\' as \"html\",\n <#else>\n CONCAT(CONCAT(\'${url}\',\'${html}\'),\'<#if appDir?has_content>/${appDir}\') as \"url\",\n CONCAT(CONCAT(\'/${html}\',\'<#if appDir?has_content>/${appDir}\'),\'/\') as \"html\",\n \n \'${url}\' as \"host\",\n \n CONCAT(CONCAT(CONCAT(CONCAT(\'template/\',id),\'/\'),app_style),\'/\') as \"style\"\nfrom app\n <#--根据站点编号查询-->\n <#if appId?? >\n where id = ${appId}\n ', NULL, '全局', NULL, NULL, NULL, NULL, 0, 1); INSERT INTO `mdiy_tag` (`id`, `tag_name`, `tag_type`, `tag_sql`, `tag_class`, `tag_description`, `UPDATE_BY`, `UPDATE_DATE`, `CREATE_BY`, `CREATE_DATE`, `DEL`, `NOT_DEL`) VALUES (7, 'field', 'single', 'SELECT\r\n cms_content.id as \"id\",\r\n <#--这里会存在id覆盖的情况,所以需要在cms_content.id下面-->\r\n <#if tableName??>${tableName}.*,\r\n <#--查询站点编号-->\r\n <#if appId??>\r\n cms_content.app_id as \"appId\",\r\n \r\n content_title as \"title\",\r\n content_short_title AS \"shorttitle\",\r\n content_author as \"author\",\r\n content_source as \"source\",\r\n content_out_link as \"outlink\",\r\n content_details as \"content\",\r\n content_datetime as \"date\",\r\n content_description as \"descrip\",\r\n content_keyword as \"keyword\",\r\n <#if contextPath?? && contextPath != \"/\">\r\n CONCAT(CONCAT( \'\') as \"hit\",\r\n <#else>\r\n CONCAT(CONCAT( \'\') as \"hit\",\r\n \r\n content_type as \"flag\",\r\n content_tags as \"tags\",\r\n category_title as \"typetitle\",\r\n cms_content.content_img as \"litpic\",\r\n <#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/mcms/view.do?id=\', cms_content.id) as \"link\",\r\n <#else>\r\n <#if shortSwitch?? && shortSwitch>\r\n CONCAT(cms_content.id, \'.html\' ) as \"link\",\r\n <#else>\r\n CONCAT(CONCAT( cms_category.category_path, \'/\' ), CONCAT(cms_content.id, \'.html\' )) as \"link\",\r\n \r\n \r\n cms_category.id as \"typeid\",\r\n cms_category.leaf as \"typeleaf\",\r\n cms_category.category_title as \"typetitle\",\r\n cms_category.category_short_title AS \"typeshorttitle\",\r\n cms_category.category_img as \"typelitpic\",\r\n cms_category.category_ico as \"typeico\",\r\n cms_category.category_path as \"typepath\",\r\n cms_category.top_id as \"topid\",\r\n cms_category.category_flag as \"typeflag\",\r\n cms_category.category_id as \"parentid\",\r\n cms_category.category_parent_ids as \"parentids\",\r\n cms_category.category_keyword as \"typekeyword\",\r\n cms_category.category_descrip as \"typedescrip\",\r\n <#--动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/list.do?typeid=\', cms_category.id) as \"typelink\"\r\n <#else>\r\n <#if shortSwitch?? && shortSwitch>\r\n CONCAT(category_pinyin,\'.html\') AS \"typelink\"\r\n <#else>\r\n CONCAT(category_path,\'/index.html\') AS \"typelink\"\r\n \r\n \r\n\r\nFROM cms_content\r\n LEFT JOIN cms_category ON\r\n cms_category.id = cms_content.category_id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableName??>left join ${tableName} on ${tableName}.link_id=cms_content.id\r\nWHERE\r\n <#--如果是栏目列表页没有文章id所以只取栏目id-->\r\n <#if column??&&column.id??&&!id??>\r\n cms_category.id=${column.id} and\r\n \r\n <#--根据站点编号查询-->\r\n <#if appId??>\r\n cms_content.app_id = ${appId} and\r\n \r\n cms_content.del=0\r\n <#if id??> and cms_content.id=${id}\r\n', NULL, '文章内容', NULL, NULL, NULL, NULL, 0, 1);