Skip to content

Commit

Permalink
Update 4.7.0-to-4.7.1-mysql.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
kmood authored Aug 12, 2019
1 parent d5bb5c1 commit b56c3e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/4.7.0-to-4.7.1-mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ CREATE TABLE `mdiy_tag_sql` (
-- ----------------------------
-- Records of mdiy_tag_sql
-- ----------------------------
INSERT INTO `mdiy_tag_sql` VALUES ('5', '3', '<#assign _typeid=\"\"/>\r\n<#assign _size=\"20\"/>\r\n<#if column?? && column.categoryId gt 0 >\r\n <#assign _typeid=\"${column.categoryId}\">\r\n</#if>\r\n<#if typeid??>\r\n <#assign _typeid=\"${typeid}\">\r\n</#if>\r\n<#if size??>\r\n <#assign _size=\"${size}\">\r\n</#if>\r\n<#if orderby?? >\r\n <#if orderby==\"date\"> \r\n <#assign _orderby=\"basic_datetime\">\r\n <#elseif orderby==\"updatedate\">\r\n <#assign _orderby=\"basic_updatetime\">\r\n <#elseif orderby==\"hit\"> \r\n <#assign _orderby=\"basic_hit\">\r\n <#elseif orderby==\"sort\">\r\n <#assign _orderby=\"basic_sort\">\r\n <#else><#assign _orderby=\"basic_id\"></#if>\r\n <#else>\r\n <#assign _orderby=\"basic_id\">\r\n </#if>\r\nSELECT\r\n basic_id AS id,\r\n @rownum := @rownum + 1 AS `index`,\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 category.category_smallimg AS typelitpic,\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 </#if>\r\n basic.basic_thumbnails AS litpic,\r\n <#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id,\"&orderby=${_orderby}\",\"&order=${order!\'ASC\'}\") as link,\r\n <#else>\r\n\r\n CONCAT(basic_column.column_path,\"/\",basic_id,\".html\") AS link,\r\n </#if>\r\n basic_datetime AS date,<#if tableName??>${tableName}.*,</#if>\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 (SELECT @rownum := 0) r,\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 tableName??>LEFT JOIN ${tableName} ON ${tableName}.basicId=cms_article.article_basicid </#if>\r\nWHERE \r\n basic.basic_display=0 \r\n <#--根据站点编号查询-->\r\n <#if appId?? >\r\n and (basic.basic_appid=${appId} or cms_article.ARTICLE_WEBID=${appId})\r\n and cms_article.article_basicid>0\r\n </#if>\r\n <#--根据模块编号查询分类-->\r\n <#if column?? && column.categoryModelId?has_content>\r\n and category_modelid=${column.categoryModelId}\r\n </#if>\r\n <#--判断是否有搜索分类集合-->\r\n <#if search??>\r\n <#if search.categoryIds??>and FIND_IN_SET(category_categoryid,\'${search.categoryIds}\')</#if>\r\n <#--标题-->\r\n <#if search.basic_title??> and basic_title like CONCAT(\"%\",\'${search.basic_title}\',\"%\")</#if>\r\n <#--作者-->\r\n <#if search.article_author??> and article_author like CONCAT(\"%\",\'${search.article_author}\',\"%\")</#if>\r\n <#--来源-->\r\n <#if search.article_source??> and article_source like CONCAT(\"%\",\'${search.article_source}\',\"%\")</#if>\r\n <#--属性-->\r\n <#if search.article_type??> and article_type like CONCAT(\"%\",\'${search.article_type}\',\"%\")</#if>\r\n <#--图片-->\r\n <#if search.basic_thumbnails??> and basic_thumbnails like CONCAT(\"%\",\'${search.basic_thumbnails}\',\"%\")</#if>\r\n <#--描述-->\r\n <#if search.basic_description??> and basic_description like CONCAT(\"%\",\'${search.basic_description}\',\"%\")</#if>\r\n <#--关键字-->\r\n <#if search.article_keyword??> and article_keyword like CONCAT(\"%\",\'${search.article_keyword}\',\"%\")</#if>\r\n <#--内容-->\r\n <#if search.article_content??> and article_content like CONCAT(\"%\",\'${search.article_content}\',\"%\")</#if>\r\n <#--自定义顺序-->\r\n <#if search.article_freeorder??> and article_freeorder=${search.article_freeorder}</#if>\r\n <#else><#--查询栏目-->\r\n <#if _typeid?has_content> 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))) </#if>\r\n </#if>\r\n <#--标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")</#if>\r\n <#--作者-->\r\n <#if article_author??> and article_author like CONCAT(\"%\",\'${article_author}\',\"%\")</#if>\r\n <#--来源-->\r\n <#if article_source??> and article_source like CONCAT(\"%\",\'${article_source}\',\"%\")</#if>\r\n <#--属性-->\r\n <#if article_type??> and article_type like CONCAT(\"%\",\'${article_type}\',\"%\")</#if>\r\n <#--图片-->\r\n <#if basic_thumbnails??> and basic_thumbnails like CONCAT(\"%\",\'${basic_thumbnails}\',\"%\")</#if>\r\n <#--描述-->\r\n <#if basic_description??> and basic_description like CONCAT(\"%\",\'${basic_description}\',\"%\")</#if>\r\n <#--关键字-->\r\n <#if article_keyword??> and article_keyword like CONCAT(\"%\",\'${article_keyword}\',\"%\")</#if>\r\n <#--内容-->\r\n <#if article_content??> and article_content like CONCAT(\"%\",\'${article_content}\',\"%\")</#if>\r\n <#--自定义顺序-->\r\n <#if article_freeorder??> and article_freeorder=${article_freeorder}</#if>\r\n <#--自定义模型-->\r\n <#if diyModel??> \r\n <#list diyModel as dm>\r\n and ${tableName}.${dm.key} = \"${dm.value}\" \r\n </#list>\r\n </#if>\r\n <#--文章属性-->\r\n <#if flag?? >\r\n and cms_article.article_type like CONCAT(\'%\',\'${flag}\',\'%\') \r\n </#if>\r\n <#if noflag?? >\r\n and cms_article.article_type not like CONCAT(\'%\',\'${noflag}\',\'%\') \r\n </#if>\r\n <#--字段排序-->\r\n <#if orderby?? >\r\n ORDER BY \r\n <#if orderby==\"date\"> basic.basic_datetime\r\n <#elseif orderby==\"updatedate\"> basic.basic_updatetime\r\n <#elseif orderby==\"hit\"> basic.basic_hit\r\n <#elseif orderby==\"sort\"> basic.basic_sort\r\n <#else>basic.basic_id</#if>\r\n <#else>\r\n ORDER BY basic.basic_id\r\n </#if>\r\n <#if order?? >\r\n <#if order==\"desc\"> desc</#if>\r\n <#if order==\"asc\"> asc</#if>\r\n </#if>\r\n LIMIT \r\n <#--判断是否分页-->\r\n <#if ispaging?? && (pageTag.pageNo)??>${((pageTag.pageNo-1)*size?eval)?c},${size?default(20)}\r\n <#else>${_size?default(20)}</#if>', '1');
INSERT INTO `mdiy_tag_sql` VALUES ('5', '3', '<#assign _typeid=\"\"/>\r\n<#assign _size=\"20\"/>\r\n<#if column?? && column.categoryId gt 0 >\r\n <#assign _typeid=\"${column.categoryId}\">\r\n</#if>\r\n<#if typeid??>\r\n <#assign _typeid=\"${typeid}\">\r\n</#if>\r\n<#if size??>\r\n <#assign _size=\"${size}\">\r\n</#if>\r\n<#if orderby?? >\r\n <#if orderby==\"date\"> \r\n <#assign _orderby=\"basic_datetime\">\r\n <#elseif orderby==\"updatedate\">\r\n <#assign _orderby=\"basic_updatetime\">\r\n <#elseif orderby==\"hit\"> \r\n <#assign _orderby=\"basic_hit\">\r\n <#elseif orderby==\"sort\">\r\n <#assign _orderby=\"basic_sort\">\r\n <#else><#assign _orderby=\"basic_id\"></#if>\r\n <#else>\r\n <#assign _orderby=\"basic_id\">\r\n </#if>\r\nSELECT\r\n basic_id AS id,\r\n @rownum := @rownum + 1 AS `index`,\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 category.category_smallimg AS typelitpic,\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 </#if>\r\n basic.basic_thumbnails AS litpic,\r\n <#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id,\"&orderby=${_orderby}\",\"&order=${order!\'ASC\'}\") as link,\r\n <#else>\r\n\r\n CONCAT(basic_column.column_path,\"/\",basic_id,\".html\") AS link,\r\n </#if>\r\n basic_datetime AS date,<#if tableName??>${tableName}.*,</#if>\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 (SELECT @rownum := 0) r,\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 tableName??>LEFT JOIN ${tableName} ON ${tableName}.basicId=cms_article.article_basicid </#if>\r\nWHERE \r\n basic.basic_display=0 \r\n <#--根据站点编号查询-->\r\n <#if appId?? >\r\n and (basic.basic_appid=${appId} or cms_article.ARTICLE_WEBID=${appId})\r\n and cms_article.article_basicid>0\r\n </#if>\r\n <#--根据模块编号查询分类-->\r\n <#if column?? && column.categoryModelId?has_content>\r\n and category_modelid=${column.categoryModelId}\r\n </#if>\r\n <#--判断是否有搜索分类集合-->\r\n <#if search??>\r\n <#if search.categoryIds??>and FIND_IN_SET(category_categoryid,\'${search.categoryIds}\')</#if>\r\n <#--标题-->\r\n <#if search.basic_title??> and basic_title like CONCAT(\"%\",\'${search.basic_title}\',\"%\")</#if>\r\n <#--作者-->\r\n <#if search.article_author??> and article_author like CONCAT(\"%\",\'${search.article_author}\',\"%\")</#if>\r\n <#--来源-->\r\n <#if search.article_source??> and article_source like CONCAT(\"%\",\'${search.article_source}\',\"%\")</#if>\r\n <#--属性-->\r\n <#if search.article_type??> and article_type like CONCAT(\"%\",\'${search.article_type}\',\"%\")</#if>\r\n <#--图片-->\r\n <#if search.basic_thumbnails??> and basic_thumbnails like CONCAT(\"%\",\'${search.basic_thumbnails}\',\"%\")</#if>\r\n <#--描述-->\r\n <#if search.basic_description??> and basic_description like CONCAT(\"%\",\'${search.basic_description}\',\"%\")</#if>\r\n <#--关键字-->\r\n <#if search.article_keyword??> and article_keyword like CONCAT(\"%\",\'${search.article_keyword}\',\"%\")</#if>\r\n <#--内容-->\r\n <#if search.article_content??> and article_content like CONCAT(\"%\",\'${search.article_content}\',\"%\")</#if>\r\n <#--自定义顺序-->\r\n <#if search.article_freeorder??> and article_freeorder=${search.article_freeorder}</#if>\r\n <#else><#--查询栏目-->\r\n <#if _typeid?has_content> 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))) </#if>\r\n </#if>\r\n <#--标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")</#if>\r\n <#--作者-->\r\n <#if article_author??> and article_author like CONCAT(\"%\",\'${article_author}\',\"%\")</#if>\r\n <#--来源-->\r\n <#if article_source??> and article_source like CONCAT(\"%\",\'${article_source}\',\"%\")</#if>\r\n <#--属性-->\r\n <#if article_type??> and article_type like CONCAT(\"%\",\'${article_type}\',\"%\")</#if>\r\n <#--图片-->\r\n <#if basic_thumbnails??> and basic_thumbnails like CONCAT(\"%\",\'${basic_thumbnails}\',\"%\")</#if>\r\n <#--描述-->\r\n <#if basic_description??> and basic_description like CONCAT(\"%\",\'${basic_description}\',\"%\")</#if>\r\n <#--关键字-->\r\n <#if article_keyword??> and article_keyword like CONCAT(\"%\",\'${article_keyword}\',\"%\")</#if>\r\n <#--内容-->\r\n <#if article_content??> and article_content like CONCAT(\"%\",\'${article_content}\',\"%\")</#if>\r\n <#--自定义顺序-->\r\n <#if article_freeorder??> and article_freeorder=${article_freeorder}</#if>\r\n <#--自定义模型-->\r\n <#if diyModel??> \r\n <#list diyModel as dm>\r\n and ${tableName}.${dm.key} = \"${dm.value}\" \r\n </#list>\r\n </#if>\r\n <#--文章属性-->\r\n <#if flag?? >\r\n and cms_article.article_type like CONCAT(\'%\',\'${flag}\',\'%\') \r\n </#if>\r\n <#if noflag?? >\r\n and cms_article.article_type not like CONCAT(\'%\',\'${noflag}\',\'%\') \r\n </#if>\r\n <#--字段排序-->\r\n <#if orderby?? >\r\n ORDER BY \r\n <#if orderby==\"date\"> basic.basic_datetime\r\n <#elseif orderby==\"updatedate\"> basic.basic_updatetime\r\n <#elseif orderby==\"hit\"> basic.basic_hit\r\n <#elseif orderby==\"sort\"> basic.basic_sort\r\n <#else>basic.basic_id</#if>\r\n <#else>\r\n ORDER BY basic.basic_id\r\n </#if>\r\n <#if order?? >\r\n <#if order==\"desc\"> desc</#if>\r\n <#if order==\"asc\"> asc</#if>\r\n </#if>\r\n LIMIT \r\n <#--判断是否分页-->\r\n <#if ispaging?? && (pageTag.pageNo)??>${((pageTag.pageNo-1)*_size?eval)?c},${_size?default(20)}\r\n <#else>${_size?default(20)}</#if>', '1');
INSERT INTO `mdiy_tag_sql` VALUES ('6', '4', '<#assign _typeid=\"\"/>\r\n<#if column?? && column.categoryId gt 0>\r\n <#assign _typeid=\"${column.categoryId}\">\r\n</#if>\r\n<#if typeid??>\r\n <#assign _typeid=\"${typeid}\">\r\n</#if>\r\nselect \r\n @rownum := @rownum + 1 AS typeindex,\r\n category_id as id,\r\n category_id as typeid,\r\n category_title as typetitle,\r\n <#--返回父id集合-->\r\n category_parent_id as pids,\r\n <#--栏目选中的样式-->\r\n IF(<#if _typeid?has_content>${_typeid}<#else>0</#if> = category_id ,\"${class!\'\'}\",\"\") as class,\r\n <#--动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/list.do?typeid=\", category_id) as typelink,\r\n <#else>\r\n CONCAT(column_path,\"/index.html\") as typelink,\r\n </#if>\r\n column_keyword as typekeyword,\r\n column_diy_url as typeurl,\r\n column_flag as flag,\r\n column_descrip as typedescrip,\r\n category_smallimg as typelitpic \r\n from (SELECT @rownum := 0) r,category \r\n LEFT JOIN basic_column bc on bc.column_category_id=category.category_id where \r\n category.del=0 \r\n <#--根据站点编号查询-->\r\n <#if appId?? >\r\n and category.category_appid=${appId}\r\n </#if>\r\n <#--根据模块编号查询分类-->\r\n <#if column?? && column.categoryModelId?has_content>\r\n and category_modelid=${column.categoryModelId}\r\n </#if>\r\n <#--栏目属性-->\r\n <#if flag?? >\r\n and bc.column_flag like CONCAT(\'%\',\'${flag}\',\'%\') \r\n </#if>\r\n <#if noflag?? >\r\n and bc.column_flag not like CONCAT(\'%\',\'${noflag}\',\'%\') \r\n </#if>\r\n<#if type?has_content>\r\n <#--顶级栏目(单个)-->\r\n <#if type==\"top\">\r\n and category_id=(select left(category_parent_id,LOCATE(\",\",category_parent_id)-1) from category where category_id = ${_typeid})\r\n <#elseif type==\"nav\">\r\n and(category_categoryid=0 or category_categoryid is null)\r\n <#--同级栏目(多个)-->\r\n <#elseif type==\"level\">\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=(select category_categoryid from category where category_id=${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目(单个)-->\r\n <#elseif type==\"self\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目的所属栏目(多个)-->\r\n <#elseif type==\"path\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id in (<#if column?? && column.categoryParentId??>${column.categoryParentId},</#if>${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目(多个)-->\r\n <#elseif type==\"son\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--上一级栏目没有则取当前栏目(单个)-->\r\n <#elseif type==\"parent\">\r\n and \r\n <#if _typeid?has_content>\r\n <#if column?? && column.categoryCategoryId?? && column.categoryCategoryId!=0>\r\n category_id=${column.categoryCategoryId}\r\n <#else>\r\n category_id=${_typeid}\r\n </#if>\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目或同级栏目(多个)-->\r\n <#elseif type==\"sonOrLevel\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid= if((SELECT count(*) FROM category\r\n LEFT JOIN basic_column bc ON bc.column_category_id = category.category_id \r\n WHERE category_categoryid=${_typeid})>0,${_typeid},(select category_categoryid from category where category_id=${_typeid}))\r\n <#else>\r\n 1=1\r\n </#if>\r\n </#if>\r\n<#else> <#--默认son-->\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n (category_categoryid=0 or category_categoryid is null)\r\n </#if>\r\n</#if>', '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}</#if>\") 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}</#if>\") as url,\r\nREPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\') as host,\r\n</#if>\r\nCONCAT(\"templets/\",app_id,\"/\",<#if m??>CONCAT(app_style,\"/${m}\")<#else>app_style</#if>) as style <#-- 判断是否为手机端 -->\r\nfrom app where app_id = ${appId} 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 typetitle,\r\ncategory.category_id as typeid,\r\ncategory.category_smallimg AS typelitpic,\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</#if>\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</#if>\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nCONCAT(\"<script type=\'text/javascript\' src=\'${url}/basic/\",basic_id,\"/hit.do\'></script>\") as hit,\r\narticle_type as flag,\r\ncategory_title as typetitle,\r\n<#if tableName??>${tableName}.*,</#if>\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</#if>\r\nWHERE \r\n1=1\r\n<#if id??> and basic_id=${id}</#if>', '1');
Expand Down

0 comments on commit b56c3e2

Please sign in to comment.