搜索修改
This commit is contained in:
parent
96b43ef853
commit
ccfedef9f6
|
@ -62,15 +62,15 @@ CREATE TABLE `mdiy_tag_sql` (
|
|||
-- ----------------------------
|
||||
-- Records of 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 </#if>\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 </#if>\r\n basic_datetime AS date,<#if tableNname??>${tableNname}.*,</#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 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 </#if>\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)))</#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 LIMIT \r\n <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', '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 </#if>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 </#if>\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 </#if>\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 </#if>\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 </#if>\r\n </#if>\r\n<#else> <#--默认son-->\r\n <#if typeid??>\r\n category_categoryid=${typeid}\r\n <#else>\r\n category_categoryid=0\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<#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\n</#if>\r\nREPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\') as host,\r\nCONCAT(\"templets/\",app_id,\"/\",<#if m??>CONCAT(app_style,\"/m\")<#else>app_style</#if>) 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</#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\nbasic_hit 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');
|
||||
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</#if>', null);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES ('10', '9', 'select\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 </#if>\r\n <#else>\r\n <#assign path=\"\"/>\r\n </#if>\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 </#if>\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 </#if>\r\n <#--最后一页-->\r\n CONCAT(\"${path}\",\"/list-${total}.html\") as last\r\n </#if>', null);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES ('11', '10', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if nextId??>\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=${nextId}\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</#if>', null);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES ('13', '12', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?typeid=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#--查询栏目-->\r\n <#if (typeid)??> and (basic_categoryid=${typeid} or basic_categoryid in \r\n (select category_id FROM category where find_in_set(${typeid},CATEGORY_PARENT_ID)))\r\n </#if>\r\n <#--模糊查询商品标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")</#if> \r\n LIMIT <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', null);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES ('14', '13', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?id=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_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=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#if id??> and basic_id=${id} </#if>', null);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES (5, 3, 'SELECT\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) as link,\r\n <#else>\r\n cms_article.article_url 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 <#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)))</#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</#if> \r\n <#if orderby==\"updatedate\"> basic.basic_updatetime</#if> \r\n <#if orderby==\"hit\"> basic.basic_hit</#if>\r\n <#if orderby==\"sort\"> basic.basic_sort</#if>\r\n <#if orderby==\"id\"> basic.basic_id</#if>\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?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', 1);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES (6, 4, 'select \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 <#--栏目选中的样式-->\r\n <#if class??>\r\n \'${class}\' as class,\r\n </#if>\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_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<#if type?has_content>\r\n <#--顶级栏目-->\r\n <#if type==\"top\">\r\n and\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 or category_categoryid=(select category_categoryid from category where category_id=${typeid})\r\n <#else>\r\n category_categoryid=0\r\n </#if>\r\n <#--顶级或同级栏目-->\r\n <#elseif type==\"topOrLevel\">\r\n and\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 </#if>\r\n <#--同级栏目-->\r\n <#elseif type==\"level\">\r\n and\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 </#if>\r\n <#--当前栏目-->\r\n <#elseif type==\"self\">\r\n and \r\n <#if typeid??>\r\n category_id=${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??>\r\n category_categoryid=${typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目或同级栏目-->\r\n <#elseif type==\"sonOrLevel\">\r\n and \r\n <#if typeid??>\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??>\r\n category_categoryid=${typeid}\r\n <#else>\r\n category_categoryid=0\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 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\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\nbasic_hit 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);
|
||||
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</#if>', 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 </#if>\r\n <#else>\r\n <#assign path=\"\"/>\r\n </#if>\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 </#if>\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 </#if>\r\n <#--最后一页-->\r\n CONCAT(\"${path}\",\"/list-${total}.html\") as last\r\n </#if>\r\n<#else><#--判断是否是搜索页面-->\r\n \"${indexUrl}\" as `index`,\"${lastUrl}\" as `last`,\"${preUrl}\" as `pre`,\"${nextUrl}\" as `next`\r\n</#if>', NULL);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES (11, 10, '<#assign select=\"(SELECT \'\')\"/>\r\n<#if nextId??>\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=${nextId}\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</#if>', NULL);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES (13, 12, 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?typeid=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#--查询栏目-->\r\n <#if (typeid)??> and (basic_categoryid=${typeid} or basic_categoryid in \r\n (select category_id FROM category where find_in_set(${typeid},CATEGORY_PARENT_ID)))\r\n </#if>\r\n <#--模糊查询商品标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")</#if> \r\n LIMIT <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', NULL);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES (14, 13, 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?id=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_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=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#if id??> and basic_id=${id} </#if>', NULL);
|
||||
|
||||
INSERT INTO `model` VALUES ('155', '自定义标签', '20060000', '104', 'mdiy/tag/index.do', '2017-09-04 11:18:51', '', '0', '0', '1', '104','');
|
||||
INSERT INTO `model` VALUES ('156', '新增', '20060001', '155', 'mdiy:tag:save', '2017-09-04 14:28:41', '', '0', '0', '0', '104,155','');
|
||||
|
|
|
@ -910,15 +910,15 @@ CREATE TABLE `mdiy_tag_sql` (
|
|||
-- ----------------------------
|
||||
-- Records of 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 </#if>\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 </#if>\r\n basic_datetime AS date,<#if tableNname??>${tableNname}.*,</#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 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 </#if>\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)))</#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 LIMIT \r\n <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', '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 </#if>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 </#if>\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 </#if>\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 </#if>\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 </#if>\r\n </#if>\r\n<#else> <#--默认son-->\r\n <#if typeid??>\r\n category_categoryid=${typeid}\r\n <#else>\r\n category_categoryid=0\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<#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\n</#if>\r\nREPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\') as host,\r\nCONCAT(\"templets/\",app_id,\"/\",<#if m??>CONCAT(app_style,\"/m\")<#else>app_style</#if>) 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</#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\nbasic_hit 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');
|
||||
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</#if>', null);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES ('10', '9', 'select\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 </#if>\r\n <#else>\r\n <#assign path=\"\"/>\r\n </#if>\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 </#if>\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 </#if>\r\n <#--最后一页-->\r\n CONCAT(\"${path}\",\"/list-${total}.html\") as last\r\n </#if>', null);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES ('11', '10', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if nextId??>\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=${nextId}\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</#if>', null);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES ('13', '12', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?typeid=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#--查询栏目-->\r\n <#if (typeid)??> and (basic_categoryid=${typeid} or basic_categoryid in \r\n (select category_id FROM category where find_in_set(${typeid},CATEGORY_PARENT_ID)))\r\n </#if>\r\n <#--模糊查询商品标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")</#if> \r\n LIMIT <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', null);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES ('14', '13', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?id=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_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=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#if id??> and basic_id=${id} </#if>', null);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES (5, 3, 'SELECT\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) as link,\r\n <#else>\r\n cms_article.article_url 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 <#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)))</#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</#if> \r\n <#if orderby==\"updatedate\"> basic.basic_updatetime</#if> \r\n <#if orderby==\"hit\"> basic.basic_hit</#if>\r\n <#if orderby==\"sort\"> basic.basic_sort</#if>\r\n <#if orderby==\"id\"> basic.basic_id</#if>\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?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', 1);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES (6, 4, 'select \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 <#--栏目选中的样式-->\r\n <#if class??>\r\n \'${class}\' as class,\r\n </#if>\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_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<#if type?has_content>\r\n <#--顶级栏目-->\r\n <#if type==\"top\">\r\n and\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 or category_categoryid=(select category_categoryid from category where category_id=${typeid})\r\n <#else>\r\n category_categoryid=0\r\n </#if>\r\n <#--顶级或同级栏目-->\r\n <#elseif type==\"topOrLevel\">\r\n and\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 </#if>\r\n <#--同级栏目-->\r\n <#elseif type==\"level\">\r\n and\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 </#if>\r\n <#--当前栏目-->\r\n <#elseif type==\"self\">\r\n and \r\n <#if typeid??>\r\n category_id=${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??>\r\n category_categoryid=${typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目或同级栏目-->\r\n <#elseif type==\"sonOrLevel\">\r\n and \r\n <#if typeid??>\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??>\r\n category_categoryid=${typeid}\r\n <#else>\r\n category_categoryid=0\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 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\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\nbasic_hit 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);
|
||||
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</#if>', 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 </#if>\r\n <#else>\r\n <#assign path=\"\"/>\r\n </#if>\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 </#if>\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 </#if>\r\n <#--最后一页-->\r\n CONCAT(\"${path}\",\"/list-${total}.html\") as last\r\n </#if>\r\n<#else><#--判断是否是搜索页面-->\r\n \"${indexUrl}\" as `index`,\"${lastUrl}\" as `last`,\"${preUrl}\" as `pre`,\"${nextUrl}\" as `next`\r\n</#if>', NULL);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES (11, 10, '<#assign select=\"(SELECT \'\')\"/>\r\n<#if nextId??>\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=${nextId}\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</#if>', NULL);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES (13, 12, 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?typeid=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#--查询栏目-->\r\n <#if (typeid)??> and (basic_categoryid=${typeid} or basic_categoryid in \r\n (select category_id FROM category where find_in_set(${typeid},CATEGORY_PARENT_ID)))\r\n </#if>\r\n <#--模糊查询商品标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")</#if> \r\n LIMIT <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', NULL);
|
||||
INSERT INTO `mdiy_tag_sql` VALUES (14, 13, 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?id=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_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=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#if id??> and basic_id=${id} </#if>', NULL);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for `model`
|
||||
|
|
|
@ -160,10 +160,11 @@ public class SearchAction extends BaseAction {
|
|||
ContentModelEntity contentModel = null; // 栏目对应模型
|
||||
List<ContentModelFieldEntity> fieldList = new ArrayList<ContentModelFieldEntity>(); // 栏目对应字段
|
||||
List<DiyModelMap> fieldValueList = new ArrayList<DiyModelMap>(); // 栏目对应字段的值
|
||||
int typeId = BasicUtil.getInt("categoryId",0);
|
||||
int typeId = BasicUtil.getInt("typeid",0);
|
||||
String categoryIds = BasicUtil.getString("categoryId");
|
||||
//记录自定义模型字段名
|
||||
List filedStr = new ArrayList<>();
|
||||
//根据栏目确定模版
|
||||
//根据栏目确定自定义模型
|
||||
if(typeId>0){
|
||||
column = (ColumnEntity) columnBiz.getEntity(Integer.parseInt(typeId+""));
|
||||
// 获取表单类型的id
|
||||
|
@ -222,8 +223,9 @@ public class SearchAction extends BaseAction {
|
|||
}
|
||||
//组织where查询条件
|
||||
Map whereMap = this.searchMap(articleFieldName, diyFieldName, fieldList);
|
||||
|
||||
// 获取符合条件的文章总数
|
||||
int count = articleBiz.getSearchCount(contentModel, whereMap, BasicUtil.getAppId(), null);
|
||||
int count = articleBiz.getSearchCount(contentModel, whereMap, BasicUtil.getAppId(), categoryIds);
|
||||
//设置分页类
|
||||
PageBean page = new PageBean();
|
||||
//读取模板的分页数量
|
||||
|
@ -240,8 +242,9 @@ public class SearchAction extends BaseAction {
|
|||
e1.printStackTrace();
|
||||
}
|
||||
int total = PageUtil.totalPage(count, size);
|
||||
int pageNo = BasicUtil.getInt(ParserUtil.PAGE_NO,1);
|
||||
if(pageNo >= total) {
|
||||
|
||||
int pageNo = BasicUtil.getInt(ParserUtil.PAGE_NO, 1);
|
||||
if(pageNo >= total && total!=0) {
|
||||
pageNo = total;
|
||||
}
|
||||
//获取总数
|
||||
|
@ -252,20 +255,19 @@ public class SearchAction extends BaseAction {
|
|||
|
||||
page.setPageNo(pageNo);
|
||||
|
||||
|
||||
|
||||
String str = ParserUtil.PAGE_NO+","+ParserUtil.SIZE;
|
||||
//设置分页的统一链接
|
||||
String url = request.getServletPath() +"?" + BasicUtil.assemblyRequestUrlParams(str.split(","));
|
||||
String url = BasicUtil.getUrl()+request.getServletPath() +"?" + BasicUtil.assemblyRequestUrlParams(str.split(","));
|
||||
String pageNoStr = "&"+ParserUtil.SIZE+"="+size+"&"+ParserUtil.PAGE_NO+"=";
|
||||
//下一页
|
||||
String nextUrl = url + pageNoStr+((pageNo+1 > total)?total:++pageNo);
|
||||
String nextUrl = url + pageNoStr+((pageNo+1 > total)?total:pageNo+1);
|
||||
//首页
|
||||
String indexUrl = url + pageNoStr + 1;
|
||||
//尾页
|
||||
String lastUrl = url + pageNoStr + total;
|
||||
//上一页
|
||||
String preUrl = url + pageNoStr + (--pageNo);
|
||||
//上一页 当前页为1时,上一页就是1
|
||||
String preUrl = url + pageNoStr + ((pageNo==1) ? 1:pageNo-1);
|
||||
|
||||
page.setIndexUrl(indexUrl);
|
||||
page.setNextUrl(nextUrl);
|
||||
page.setPreUrl(preUrl);
|
||||
|
@ -274,6 +276,8 @@ public class SearchAction extends BaseAction {
|
|||
Map<Object, Object> searchMap = new HashMap<>();
|
||||
searchMap.put(BASIC_TITLE, BasicUtil.getString(BASIC_TITLE));
|
||||
searchMap.put(ParserUtil.PAGE_NO, pageNo);
|
||||
//设置栏目集合
|
||||
searchMap.put("categoryIds", categoryIds);
|
||||
map.put(SEARCH, searchMap);
|
||||
map.put(ParserUtil.PAGE, page);
|
||||
//动态解析
|
||||
|
|
|
@ -114,8 +114,7 @@ public interface IArticleBiz extends IBasicBiz {
|
|||
* @return 记录数量
|
||||
* @see IArticleBiz.count
|
||||
*/
|
||||
@Deprecated
|
||||
public int getSearchCount(ContentModelEntity contentModel, Map whereMap, int appId, List ids);
|
||||
public int getSearchCount(ContentModelEntity contentModel, Map whereMap, int appId, String ids);
|
||||
|
||||
/**
|
||||
* 文章查询
|
||||
|
|
|
@ -28,10 +28,12 @@ import java.util.Map;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import net.mingsoft.base.dao.IBaseDao;
|
||||
import net.mingsoft.basic.biz.ICategoryBiz;
|
||||
import net.mingsoft.basic.biz.IColumnBiz;
|
||||
import net.mingsoft.basic.biz.IModelBiz;
|
||||
import net.mingsoft.basic.biz.impl.BasicBizImpl;
|
||||
import net.mingsoft.basic.util.BasicUtil;
|
||||
import net.mingsoft.cms.bean.ColumnArticleIdBean;
|
||||
import net.mingsoft.cms.biz.IArticleBiz;
|
||||
import net.mingsoft.cms.dao.IArticleDao;
|
||||
|
@ -39,9 +41,6 @@ import net.mingsoft.cms.entity.ArticleEntity;
|
|||
import net.mingsoft.mdiy.biz.IContentModelBiz;
|
||||
import net.mingsoft.mdiy.entity.ContentModelEntity;
|
||||
|
||||
import net.mingsoft.base.dao.IBaseDao;
|
||||
import net.mingsoft.basic.util.BasicUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ClassName: ArticleBizImpl
|
||||
|
@ -157,8 +156,7 @@ public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz {
|
|||
return articleDao.getNextOrPrevious(appId, basicId, false,categoryId);
|
||||
}
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getSearchCount(ContentModelEntity contentModel,Map wherMap, int websiteId,List ids) {
|
||||
public int getSearchCount(ContentModelEntity contentModel,Map wherMap, int websiteId,String ids) {
|
||||
if (contentModel!=null) {
|
||||
return articleDao.getSearchCount(contentModel.getCmTableName(),wherMap, websiteId,ids);
|
||||
}
|
||||
|
|
|
@ -103,9 +103,8 @@ public interface IArticleDao extends IBaseDao {
|
|||
* list[2]:是否是等值查询 list[3]:字段的值
|
||||
* @return 文章实体总数
|
||||
*/
|
||||
@Deprecated
|
||||
int getSearchCount(@Param("tableName") String tableName, @Param("map") Map<String, List> map,
|
||||
@Param("websiteId") int websiteId, @Param("ids") List ids);
|
||||
@Param("websiteId") int websiteId, @Param("ids") String ids);
|
||||
|
||||
/**
|
||||
* 文章查询
|
||||
|
|
|
@ -461,16 +461,9 @@
|
|||
<if test="tableName!=null">left join ${tableName} d on d.basicId=a.ARTICLE_BASICID
|
||||
</if>
|
||||
where a.ARTICLE_WEBID = #{websiteId}
|
||||
|
||||
<if test="ids!=null">
|
||||
and
|
||||
b.BASIC_CATEGORYID in
|
||||
<foreach item="id" index="key" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{id.categoryId}
|
||||
</foreach>
|
||||
and FIND_IN_SET(category_categoryid,'${ids}')
|
||||
</if>
|
||||
|
||||
<foreach item="item" index="key" collection="map" open=""
|
||||
separator="" close="">
|
||||
<if test=" item[0] == false">
|
||||
|
|
|
@ -42,8 +42,11 @@ public class CmsParserUtil extends ParserUtil {
|
|||
public static void generate(String templatePath, String targetPath) throws IOException {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put(IS_DO, false);
|
||||
ColumnEntity column = new ColumnEntity();
|
||||
//内容管理栏目编码
|
||||
column.setCategoryModelId(BasicUtil.getModelCodeId("02990000"));
|
||||
map.put(COLUMN, column);
|
||||
String content = CmsParserUtil.generate(templatePath, map, false);
|
||||
|
||||
FileUtil.writeString(content, ParserUtil.buildHtmlPath(targetPath), Const.UTF8);
|
||||
|
||||
// 生成移动页面
|
||||
|
|
|
@ -8,11 +8,12 @@ import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
|
|||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.web.context.request.RequestContextListener;
|
||||
import org.springframework.web.servlet.DispatcherServlet;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
|
@ -22,7 +23,6 @@ import com.alibaba.druid.support.spring.stat.BeanTypeAutoProxyCreator;
|
|||
import com.alibaba.druid.support.spring.stat.DruidStatInterceptor;
|
||||
|
||||
import net.mingsoft.basic.interceptor.ActionInterceptor;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
|
@ -51,7 +51,6 @@ public class WebConfig implements WebMvcConfigurer {
|
|||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/html/**").addResourceLocations("/html/");
|
||||
registry.addResourceHandler("/html/**").addResourceLocations("classpath:/html/");
|
||||
registry.addResourceHandler("/app/**").addResourceLocations("classpath:/app/");
|
||||
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
|
||||
registry.addResourceHandler("/api/**").addResourceLocations("classpath:/api/");
|
||||
|
@ -141,4 +140,13 @@ public class WebConfig implements WebMvcConfigurer {
|
|||
public ServletListenerRegistrationBean<RequestContextListener> requestContextListenerRegistration() {
|
||||
return new ServletListenerRegistrationBean<>(new RequestContextListener());
|
||||
}
|
||||
/**
|
||||
* 设置默认首页
|
||||
*/
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
registry.addViewController("/").setViewName("forward:/html/1/index.html");
|
||||
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
||||
WebMvcConfigurer.super.addViewControllers(registry);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue