修复动态解析

master
sgjj 6 years ago
parent 0fd4a57ae1
commit dfad56af46
  1. 22
      src/main/java/net/mingsoft/cms/action/BaseAction.java
  2. 85
      src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
  3. 133
      src/main/java/net/mingsoft/cms/biz/IArticleBiz.java
  4. 41
      src/main/java/net/mingsoft/cms/biz/impl/ArticleBizImpl.java
  5. 14
      src/main/java/net/mingsoft/cms/constant/Const.java
  6. 140
      src/main/java/net/mingsoft/cms/dao/IArticleDao.java
  7. 124
      src/main/java/net/mingsoft/cms/dao/IArticleDao.xml
  8. 9
      src/main/java/net/mingsoft/cms/resources/resources_zh_CN.properties

@ -0,0 +1,22 @@
package net.mingsoft.cms.action;
import java.util.MissingResourceException;
/**
* @Author: 铭飞开源团队--huise
* @Date: 2019/8/9 20:47
*/
public class BaseAction extends net.mingsoft.mdiy.action.BaseAction{
@Override
protected String getResString(String key) {
// TODO Auto-generated method stub
String str = "";
try {
str = super.getResString(key);
} catch (MissingResourceException e) {
str = net.mingsoft.cms.constant.Const.RESOURCES.getString(key);
}
return str;
}
}

@ -1,5 +1,5 @@
/** /**
The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
@ -21,13 +21,23 @@ The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
package net.mingsoft.cms.action.web; package net.mingsoft.cms.action.web;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.io.FileUtil;
import com.github.pagehelper.PageHelper;
import net.mingsoft.base.constant.Const;
import net.mingsoft.basic.util.SpringUtil;
import net.mingsoft.cms.constant.e.ColumnTypeEnum;
import net.mingsoft.mdiy.biz.IContentModelBiz;
import net.mingsoft.mdiy.entity.ContentModelEntity;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
@ -54,13 +64,13 @@ import net.mingsoft.mdiy.util.ParserUtil;
/** /**
* 动态生成页面需要后台配置自定义页数据 * 动态生成页面需要后台配置自定义页数据
* *
* @author 铭飞开源团队 * @author 铭飞开源团队
* @date 2018年12月17日 * @date 2018年12月17日
*/ */
@Controller("dynamicPageAction") @Controller("dynamicPageAction")
@RequestMapping("/mcms") @RequestMapping("/mcms")
public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction { public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
/** /**
* 自定义页面业务层 * 自定义页面业务层
@ -84,7 +94,7 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction {
// 如商城就为:/mall/{key}.do // 如商城就为:/mall/{key}.do
/** /**
* 前段会员中心所有页面都可以使用该方法 请求地址例如 {diy}.do,例如登陆界面与注册界面都可以使用 * 前段会员中心所有页面都可以使用该方法 请求地址例如 {diy}.do,例如登陆界面与注册界面都可以使用
* *
* @param key * @param key
*/ */
@RequestMapping("/{diy}.do") @RequestMapping("/{diy}.do")
@ -158,7 +168,7 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction {
//获取栏目编号 //获取栏目编号
int typeId = BasicUtil.getInt(ParserUtil.TYPE_ID,0); int typeId = BasicUtil.getInt(ParserUtil.TYPE_ID,0);
int size = BasicUtil.getInt(ParserUtil.SIZE,10); int size = BasicUtil.getInt(ParserUtil.SIZE,10);
//获取文章总数 //获取文章总数
List<ColumnArticleIdBean> columnArticles = articleBiz.queryIdsByCategoryIdForParser(typeId, null, null); List<ColumnArticleIdBean> columnArticles = articleBiz.queryIdsByCategoryIdForParser(typeId, null, null);
//判断栏目下是否有文章 //判断栏目下是否有文章
@ -175,7 +185,7 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction {
map.put(ParserUtil.TYPE_ID, typeId); map.put(ParserUtil.TYPE_ID, typeId);
//设置列表当前页 //设置列表当前页
map.put(ParserUtil.PAGE_NO, BasicUtil.getInt(ParserUtil.PAGE_NO,1)); map.put(ParserUtil.PAGE_NO, BasicUtil.getInt(ParserUtil.PAGE_NO,1));
map.put(ParserUtil.URL, BasicUtil.getUrl()); map.put(ParserUtil.URL, BasicUtil.getUrl());
map.put(ParserUtil.PAGE, page); map.put(ParserUtil.PAGE, page);
//动态解析 //动态解析
@ -198,19 +208,27 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction {
} }
this.outString(resp, content); this.outString(resp, content);
} }
/** /**
* 动态详情页 * 动态详情页
* @param id 文章编号 * @param id 文章编号
*/ */
@GetMapping("/view.do") @GetMapping("/view.do")
public void view(HttpServletRequest req, HttpServletResponse resp) { public void view(String orderby,String order,HttpServletRequest req, HttpServletResponse resp) {
//参数文章编号 //参数文章编号
ArticleEntity article = (ArticleEntity) articleBiz.getEntity(BasicUtil.getInt(ParserUtil.ID)); ArticleEntity article = (ArticleEntity) articleBiz.getEntity(BasicUtil.getInt(ParserUtil.ID));
if(ObjectUtil.isNull(article)){ if(ObjectUtil.isNull(article)){
this.outJson(resp, null,false,getResString("err.empty", this.getResString("id"))); this.outJson(resp, null,false,getResString("err.empty", this.getResString("id")));
return; return;
}
if(StringUtils.isNotBlank(order)){
//防注入
if(!order.toLowerCase().equals("asc")&&!order.toLowerCase().equals("desc")){
this.outJson(resp, null,false,getResString("err.error", this.getResString("order")));
return;
}
} }
PageBean page = new PageBean();
//根据文章编号查询栏目详情模版 //根据文章编号查询栏目详情模版
ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId()); ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId());
//解析后的内容 //解析后的内容
@ -221,6 +239,55 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction {
//设置动态请求的模块路径 //设置动态请求的模块路径
map.put(ParserUtil.MODEL_NAME, "mcms"); map.put(ParserUtil.MODEL_NAME, "mcms");
map.put(ParserUtil.URL, BasicUtil.getUrl()); map.put(ParserUtil.URL, BasicUtil.getUrl());
map.put(ParserUtil.PAGE, page);
map.put(ParserUtil.ID, article.getArticleID());
List<ColumnArticleIdBean> articleIdList = articleBiz.queryIdsByCategoryIdForParser(column.getCategoryCategoryId(), null, null,orderby,order);
Map<Object, Object> contentModelMap = new HashMap<Object, Object>();
ContentModelEntity contentModel = null;
for (int artId = 0; artId < articleIdList.size();) {
//如果不是当前文章则跳过
if(articleIdList.get(artId).getArticleId() != article.getArticleID()){
artId++;
continue;
}
// 文章的栏目路径
String articleColumnPath = articleIdList.get(artId).getColumnPath();
// 文章的栏目模型编号
int columnContentModelId = articleIdList.get(artId).getColumnContentModelId();
Map<String, Object> parserParams = new HashMap<String, Object>();
parserParams.put(ParserUtil.COLUMN, articleIdList.get(artId));
// 判断当前栏目是否有自定义模型
if (columnContentModelId > 0) {
// 通过当前栏目的模型编号获取,自定义模型表名
if (contentModelMap.containsKey(columnContentModelId)) {
parserParams.put(ParserUtil.TABLE_NAME, contentModel.getCmTableName());
} else {
// 通过栏目模型编号获取自定义模型实体
contentModel = (ContentModelEntity) SpringUtil.getBean(IContentModelBiz.class)
.getEntity(columnContentModelId);
// 将自定义模型编号设置为key值
contentModelMap.put(columnContentModelId, contentModel.getCmTableName());
parserParams.put(ParserUtil.TABLE_NAME, contentModel.getCmTableName());
}
}
// 第一篇文章没有上一篇
if (artId > 0) {
ColumnArticleIdBean preCaBean = articleIdList.get(artId - 1);
//判断当前文档是否与上一页文章在同一栏目下,并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if(articleColumnPath.contains(preCaBean.getCategoryId()+"")){
page.setPreId(preCaBean.getArticleId());
}
}
// 最后一篇文章没有下一篇
if (artId + 1 < articleIdList.size()) {
ColumnArticleIdBean nextCaBean = articleIdList.get(artId + 1);
//判断当前文档是否与下一页文章在同一栏目下并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if(articleColumnPath.contains(nextCaBean.getCategoryId()+"")){
page.setNextId(nextCaBean.getArticleId());
}
}
break;
}
try { try {
//根据模板路径,参数生成 //根据模板路径,参数生成
content = CmsParserUtil.generate(column.getColumnUrl(), map, isMobileDevice(req)); content = CmsParserUtil.generate(column.getColumnUrl(), map, isMobileDevice(req));

@ -1,43 +1,43 @@
/** /**
The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
package net.mingsoft.cms.biz; package net.mingsoft.cms.biz;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import net.mingsoft.basic.biz.IBasicBiz; import net.mingsoft.basic.biz.IBasicBiz;
import net.mingsoft.cms.bean.ColumnArticleIdBean; import net.mingsoft.cms.bean.ColumnArticleIdBean;
import net.mingsoft.cms.entity.ArticleEntity; import net.mingsoft.cms.entity.ArticleEntity;
import net.mingsoft.mdiy.entity.ContentModelEntity; import net.mingsoft.mdiy.entity.ContentModelEntity;
/** /**
* *
* @ClassName: IArticleBiz * @ClassName: IArticleBiz
* @Description:TODO(文章管理业务处理层 || 继承IBasicBiz业务处理层) * @Description:TODO(文章管理业务处理层 || 继承IBasicBiz业务处理层)
* @author: 铭飞开发团队 * @author: 铭飞开发团队
* @date: 2018年1月31日 下午2:53:32 * @date: 2018年1月31日 下午2:53:32
* *
* @Copyright: 2018 www.mingsoft.net Inc. All rights reserved. * @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
*/ */
public interface IArticleBiz extends IBasicBiz { public interface IArticleBiz extends IBasicBiz {
@ -52,14 +52,14 @@ public interface IArticleBiz extends IBasicBiz {
* @param article * @param article
* 文件实体 * 文件实体
* @return * @return
*/ */
@Deprecated @Deprecated
int count(int webId, int[] basicCategoryId, String flag, String noFlag, ArticleEntity article); int count(int webId, int[] basicCategoryId, String flag, String noFlag, ArticleEntity article);
/** /**
* 通过分类id获取文章内容 * 通过分类id获取文章内容
* *
* @param categoryId * @param categoryId
* 分类编号 * 分类编号
* @return * @return
@ -69,7 +69,7 @@ public interface IArticleBiz extends IBasicBiz {
/** /**
* 通过视图表来查询文章总数 * 通过视图表来查询文章总数
* *
* @param basicId * @param basicId
* 文章编号 * 文章编号
*/ */
@ -78,31 +78,31 @@ public interface IArticleBiz extends IBasicBiz {
/** /**
* 查找basicId下一篇文章 * 查找basicId下一篇文章
* *
* @param appId * @param appId
* 应用编号 * 应用编号
* @param basicId * @param basicId
* 文章编号 * 文章编号
* @return * @return
*/ */
@Deprecated @Deprecated
public ArticleEntity getNext(int appId, int basicId, Integer categoryId); public ArticleEntity getNext(int appId, int basicId, Integer categoryId);
/** /**
* 查找basicId上一篇文章 * 查找basicId上一篇文章
* *
* @param appId * @param appId
* 应用编号 * 应用编号
* @param basicId * @param basicId
* 文章编号 * 文章编号
* @return * @return
*/ */
@Deprecated @Deprecated
public ArticleEntity getPrevious(int appId, int basicId, Integer categoryId); public ArticleEntity getPrevious(int appId, int basicId, Integer categoryId);
/** /**
* 高级查询接口主要提供给有自定义模型的栏目返回總數 * 高级查询接口主要提供给有自定义模型的栏目返回總數
* *
* @param contentModel * @param contentModel
* 自定义模型 * 自定义模型
* @param whereMap * @param whereMap
@ -118,7 +118,7 @@ public interface IArticleBiz extends IBasicBiz {
/** /**
* 文章查询 * 文章查询
* *
* @para webId 网站编号 * @para webId 网站编号
* @param basicCategoryIds * @param basicCategoryIds
* 栏目编号集合 * 栏目编号集合
@ -129,28 +129,37 @@ public interface IArticleBiz extends IBasicBiz {
* @param orderBy * @param orderBy
* 排序字段 * 排序字段
* @param order * @param order
* true 升序 false 降序 排序方式 * true 升序 false 降序 排序方式
* @param beginTime 开始时间 * @param beginTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @param article * @param article
* 文章实体便于扩展查询 * 文章实体便于扩展查询
* @return 文章集合 * @return 文章集合
*/ */
List<ArticleEntity> query(int webId, int[] basicCategoryIds, String flag, String noFlag, String orderBy, List<ArticleEntity> query(int webId, int[] basicCategoryIds, String flag, String noFlag, String orderBy,
boolean order, String beginTime,String endTime, ArticleEntity article); boolean order, String beginTime,String endTime, ArticleEntity article);
/** /**
* 查询文章编号集合 * 查询文章编号集合
* @param categoryId 栏目编号 * @param categoryId 栏目编号
* @param beginTime 开始时间 * @param beginTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @return * @return
*/ */
public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime); public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime);
/**
* 查询文章编号集合
* @param categoryId 栏目编号
* @param beginTime 开始时间
* @param endTime 结束时间
* @param orderBy 排序字段
* @param order 排序方式
* @return
*/
public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime,String orderBy,String order);
/** /**
* 根据页面栏目的id获取与其绑定的文章实体 * 根据页面栏目的id获取与其绑定的文章实体
* *
* @param basicCategoryId * @param basicCategoryId
* @return 文章实体 * @return 文章实体
*/ */
@ -162,7 +171,7 @@ public interface IArticleBiz extends IBasicBiz {
/** /**
* 高级查询接口主要提供给有自定义模型的栏目 * 高级查询接口主要提供给有自定义模型的栏目
* *
* @param conntentModel * @param conntentModel
* 自定义模型 * 自定义模型
* @param whereMap * @param whereMap
@ -177,6 +186,6 @@ public interface IArticleBiz extends IBasicBiz {
*/ */
@Deprecated @Deprecated
public List<ArticleEntity> queryListForSearch(ContentModelEntity conntentModel, Map whereMap, public List<ArticleEntity> queryListForSearch(ContentModelEntity conntentModel, Map whereMap,
int appId, List ids, Map orders); int appId, List ids, Map orders);
} }

@ -1,5 +1,5 @@
/** /**
The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -42,43 +43,43 @@ import net.mingsoft.mdiy.biz.IContentModelBiz;
import net.mingsoft.mdiy.entity.ContentModelEntity; import net.mingsoft.mdiy.entity.ContentModelEntity;
/** /**
* *
* @ClassName: ArticleBizImpl * @ClassName: ArticleBizImpl
* @Description:TODO(文章管理业务层实现类 || 继承BasicBizImpl || 实现IArticleBiz) * @Description:TODO(文章管理业务层实现类 || 继承BasicBizImpl || 实现IArticleBiz)
* @author: 铭飞开发团队 * @author: 铭飞开发团队
* @date: 2018年1月31日 下午2:53:53 * @date: 2018年1月31日 下午2:53:53
* *
* @Copyright: 2018 www.mingsoft.net Inc. All rights reserved. * @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
*/ */
@Service("ArticleBizImpl") @Service("ArticleBizImpl")
public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz { public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz {
/** /**
* 文章持久化处理 * 文章持久化处理
*/ */
private IArticleDao articleDao; private IArticleDao articleDao;
/** /**
* 栏目业务处理 * 栏目业务处理
*/ */
@Autowired @Autowired
private ICategoryBiz categoryBiz; private ICategoryBiz categoryBiz;
/** /**
* 自定类型义业务处理 * 自定类型义业务处理
*/ */
@Autowired @Autowired
private IColumnBiz columnBiz; private IColumnBiz columnBiz;
/** /**
* 自定义模型 * 自定义模型
*/ */
@Autowired @Autowired
private IContentModelBiz contentModelBiz; private IContentModelBiz contentModelBiz;
/** /**
* 模块管理业务层 * 模块管理业务层
*/ */
@ -94,7 +95,7 @@ public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz {
/** /**
* 获取Article的持久化层 * 获取Article的持久化层
* *
* @return 返回持Article的久化对象 * @return 返回持Article的久化对象
*/ */
public IArticleDao getArticleDao() { public IArticleDao getArticleDao() {
@ -133,7 +134,7 @@ public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz {
/** /**
* 获取IBaseDao的持久化层 * 获取IBaseDao的持久化层
* *
* @return 返回持articleDao的久化对象 * @return 返回持articleDao的久化对象
*/ */
@Override @Override
@ -165,7 +166,7 @@ public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz {
@Override @Override
public List<ArticleEntity> query(int webId, int[] basicCategoryIds, String flag, String noFlag, String orderBy, public List<ArticleEntity> query(int webId, int[] basicCategoryIds, String flag, String noFlag, String orderBy,
boolean order,String beginTime,String endTime, ArticleEntity article) { boolean order,String beginTime,String endTime, ArticleEntity article) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if(article == null) { if(article == null) {
article = new ArticleEntity(); article = new ArticleEntity();
@ -175,7 +176,7 @@ public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz {
/** /**
* 根据页面栏目的id获取与其绑定的文章实体 * 根据页面栏目的id获取与其绑定的文章实体
* *
* @param basicCategoryId * @param basicCategoryId
* @return 文章实体 * @return 文章实体
*/ */
@ -201,7 +202,7 @@ public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz {
/** /**
* 设置Article的持久化层 * 设置Article的持久化层
* *
* @param articleDao * @param articleDao
*/ */
@Autowired @Autowired
@ -212,6 +213,10 @@ public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz {
@Override @Override
public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime) { public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime) {
return this.articleDao.queryIdsByCategoryIdForParser(categoryId,BasicUtil.getAppId(), beginTime, endTime); return this.articleDao.queryIdsByCategoryIdForParser(categoryId,BasicUtil.getAppId(), beginTime, endTime,null,null);
}
@Override
public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime,String orderBy,String order) {
return this.articleDao.queryIdsByCategoryIdForParser(categoryId,BasicUtil.getAppId(), beginTime, endTime,orderBy,order);
} }
} }

@ -0,0 +1,14 @@
package net.mingsoft.cms.constant;
import java.util.ResourceBundle;
/**
* @Author: 铭飞开源团队--huise
* @Date: 2019/8/9 20:51
*/
public class Const {
/**
* 资源文件
*/
public final static ResourceBundle RESOURCES = ResourceBundle.getBundle("net.mingsoft.cms.resources.resources");
}

@ -1,45 +1,45 @@
/** /**
The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
package net.mingsoft.cms.dao; package net.mingsoft.cms.dao;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import net.mingsoft.cms.bean.ColumnArticleIdBean; import net.mingsoft.cms.bean.ColumnArticleIdBean;
import net.mingsoft.cms.entity.ArticleEntity; import net.mingsoft.cms.entity.ArticleEntity;
import net.mingsoft.base.dao.IBaseDao; import net.mingsoft.base.dao.IBaseDao;
/** /**
* *
* @ClassName: IArticleDao * @ClassName: IArticleDao
* @Description:TODO(文章管理持久化层 || 继承IBaseDao持久化层) * @Description:TODO(文章管理持久化层 || 继承IBaseDao持久化层)
* @author: 铭飞开发团队 * @author: 铭飞开发团队
* @date: 2018年1月31日 下午2:55:33 * @date: 2018年1月31日 下午2:55:33
* *
* @Copyright: 2018 www.mingsoft.net Inc. All rights reserved. * @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
*/ */
public interface IArticleDao extends IBaseDao { public interface IArticleDao extends IBaseDao {
@ -54,24 +54,24 @@ public interface IArticleDao extends IBaseDao {
* @param article * @param article
* 文章实体便于扩展查询 * 文章实体便于扩展查询
* @return 文章总数 * @return 文章总数
*/ */
@Deprecated @Deprecated
int count(@Param("webId") int webId, @Param("basicCategoryIds") int[] basicCategoryIds, @Param("flag") String flag, int count(@Param("webId") int webId, @Param("basicCategoryIds") int[] basicCategoryIds, @Param("flag") String flag,
@Param("noFlag") String noFlag, @Param("article") ArticleEntity article); @Param("noFlag") String noFlag, @Param("article") ArticleEntity article);
/** /**
* 通过分类id获取文章内容 * 通过分类id获取文章内容
* *
* @param categoryId * @param categoryId
* 分类编号 * 分类编号
* @return 文章集合 * @return 文章集合
*/ */
@Deprecated @Deprecated
List getByCategoryId(@Param("categoryId") int categoryId); List getByCategoryId(@Param("categoryId") int categoryId);
/** /**
* 通过视图表来查询文章总数 * 通过视图表来查询文章总数
* *
* @param basicId * @param basicId
* 文章编号 * 文章编号
* @param contentModelTableName * @param contentModelTableName
@ -81,7 +81,7 @@ public interface IArticleDao extends IBaseDao {
/** /**
* 查找basicId上一篇文章 * 查找basicId上一篇文章
* *
* @param appId * @param appId
* 应用编号 * 应用编号
* @param basicId * @param basicId
@ -91,11 +91,11 @@ public interface IArticleDao extends IBaseDao {
* @return * @return
*/ */
ArticleEntity getNextOrPrevious(@Param("appId") int appId, @Param("basicId") int basicId, ArticleEntity getNextOrPrevious(@Param("appId") int appId, @Param("basicId") int basicId,
@Param("flag") boolean flag, @Param("categoryId") Integer categoryId); @Param("flag") boolean flag, @Param("categoryId") Integer categoryId);
/** /**
* 根据查询文章实体总数 * 根据查询文章实体总数
* *
* @param tableName * @param tableName
* :自定义生成的表名 * :自定义生成的表名
* @param map * @param map
@ -104,11 +104,11 @@ public interface IArticleDao extends IBaseDao {
* @return 文章实体总数 * @return 文章实体总数
*/ */
int getSearchCount(@Param("tableName") String tableName, @Param("map") Map<String, List> map, int getSearchCount(@Param("tableName") String tableName, @Param("map") Map<String, List> map,
@Param("websiteId") int websiteId, @Param("ids") String ids); @Param("websiteId") int websiteId, @Param("ids") String ids);
/** /**
* 文章查询 * 文章查询
* *
* @para webId 网站编号 * @para webId 网站编号
* @param basicCategoryIds * @param basicCategoryIds
* 栏目编号集合 * 栏目编号集合
@ -121,19 +121,19 @@ public interface IArticleDao extends IBaseDao {
* @param order * @param order
* true 升序 false 降序 排序方式 * true 升序 false 降序 排序方式
* @param article * @param article
* 文章实体便于扩展查询 * 文章实体便于扩展查询
* @param beginTime 开始时间 * @param beginTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @return 文章集合 * @return 文章集合
*/ */
List<ArticleEntity> query(@Param("webId") int webId, @Param("basicCategoryIds") int[] basicCategoryIds, List<ArticleEntity> query(@Param("webId") int webId, @Param("basicCategoryIds") int[] basicCategoryIds,
@Param("flag") String flag, @Param("noFlag") String noFlag, @Param("orderBy") String orderBy, @Param("flag") String flag, @Param("noFlag") String noFlag, @Param("orderBy") String orderBy,
@Param("order") boolean order, @Param("beginTime") String beginTime,@Param("endTime") String endTime, @Param("order") boolean order, @Param("beginTime") String beginTime,@Param("endTime") String endTime,
@Param("article") ArticleEntity article); @Param("article") ArticleEntity article);
/** /**
* 根据页面栏目的id获取与其绑定的文章实体 * 根据页面栏目的id获取与其绑定的文章实体
* *
* @param basicCategoryId * @param basicCategoryId
* @return 文章实体 * @return 文章实体
*/ */
@ -142,7 +142,7 @@ public interface IArticleDao extends IBaseDao {
/** /**
* 根据查询文章实体 * 根据查询文章实体
* *
* @param tableName * @param tableName
* :自定义生成的表名 * :自定义生成的表名
* @param map * @param map
@ -152,16 +152,18 @@ public interface IArticleDao extends IBaseDao {
*/ */
@Deprecated @Deprecated
List<ArticleEntity> queryListForSearch(@Param("tableName") String tableName, @Param("map") Map<String, List> map, List<ArticleEntity> queryListForSearch(@Param("tableName") String tableName, @Param("map") Map<String, List> map,
@Param("websiteId") int websiteId, @Param("ids") List ids, @Param("websiteId") int websiteId, @Param("ids") List ids,
@Param("sortMap") Map sortMap); @Param("sortMap") Map sortMap);
/** /**
* 查询文章编号集合 * 查询文章编号集合
* @param categoryId 栏目编号 * @param categoryId 栏目编号
* @param appId 站点编号 * @param appId 站点编号
* @param beginTime 开始时间 * @param beginTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @return * @return
*/ */
public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(@Param("categoryId")int categoryId,@Param("appId")int appId , @Param("beginTime") String beginTime,@Param("endTime") String endTime); public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(@Param("categoryId")int categoryId,@Param("appId")int appId , @Param("beginTime") String beginTime,@Param("endTime") String endTime,@Param("orderBy")String orderBy,@Param("order")String order);
} }

@ -36,7 +36,7 @@
<result column="BASIC_DISPLAY" property="basicDisplay" /> <result column="BASIC_DISPLAY" property="basicDisplay" />
<!-- 一对一关联栏目 --> <!-- 一对一关联栏目 -->
<association property="column" column="COLUMN_CATEGORY_ID" <association property="column" column="COLUMN_CATEGORY_ID"
javaType="net.mingsoft.basic.entity.ColumnEntity"> javaType="net.mingsoft.basic.entity.ColumnEntity">
<result property="columnPath" column="column_path" /> <result property="columnPath" column="column_path" />
<result property="categoryTitle" column="category_title" /> <result property="categoryTitle" column="category_title" />
<result property="categoryId" column="category_id" /> <result property="categoryId" column="category_id" />
@ -47,9 +47,10 @@
<!-- 获取表字段 结束 --> <!-- 获取表字段 结束 -->
<!-- 通过视图查询返回结果集 开始 --> <!-- 通过视图查询返回结果集 开始 -->
<resultMap type="net.mingsoft.cms.bean.ColumnArticleIdBean" id="resultMapBean"> <resultMap type="net.mingsoft.cms.bean.ColumnArticleIdBean" id="resultMapBean">
<result column="ARTICLE_BASICID" property="articleId" /> <result column="ARTICLE_BASICID" property="articleId" />
<result column="column_path" property="columnPath"/> <result column="column_path" property="columnPath"/>
<result column="column_url" property="columnUrl" /> <result column="column_url" property="columnUrl" />
<result column="column_listurl" property="columnListUrl" />
<result column="category_title" property="categoryTitle" /> <result column="category_title" property="categoryTitle" />
<result column="category_id" property="categoryId" /> <result column="category_id" property="categoryId" />
<result column="COLUMN_CM_ID" property="columnContentModelId" /> <result column="COLUMN_CM_ID" property="columnContentModelId" />
@ -68,13 +69,13 @@
<result column="ARTICLE_SOURCE" property="articleSource" /> <!-- 文章来源 --> <result column="ARTICLE_SOURCE" property="articleSource" /> <!-- 文章来源 -->
<result column="ARTICLE_URL" property="articleUrl" /> <!-- 文章跳转链接地址 --> <result column="ARTICLE_URL" property="articleUrl" /> <!-- 文章跳转链接地址 -->
<result column="ARTICLE_KEYWORD" property="articleKeyword" /> <!-- 文章关键字 --> <result column="ARTICLE_KEYWORD" property="articleKeyword" /> <!-- 文章关键字 -->
<result column="ARTICLE_FREEORDER" property="articleFreeOrder" /><!-- <result column="ARTICLE_FREEORDER" property="articleFreeOrder" /><!--
文章自定义显示顺序 --> 文章自定义显示顺序 -->
<result column="ARTICLE_WEBID" property="articleWebId" /> <!-- 站点id --> <result column="ARTICLE_WEBID" property="articleWebId" /> <!-- 站点id -->
<result column="BASIC_ID" property="basicId" /> <!-- 与表basic绑定 自增长ID --> <result column="BASIC_ID" property="basicId" /> <!-- 与表basic绑定 自增长ID -->
<result column="BASIC_TITLE" property="basicTitle" /> <!-- 文章标题 --> <result column="BASIC_TITLE" property="basicTitle" /> <!-- 文章标题 -->
<result column="BASIC_DESCRIPTION" property="basicDescription" /><!-- <result column="BASIC_DESCRIPTION" property="basicDescription" /><!--
文章描述 --> 文章描述 -->
<result column="BASIC_THUMBNAILS" property="basicThumbnails" /> <!-- 文章缩略图 --> <result column="BASIC_THUMBNAILS" property="basicThumbnails" /> <!-- 文章缩略图 -->
<result column="BASIC_HIT" property="basicHit" /> <!-- 文章点击次数 --> <result column="BASIC_HIT" property="basicHit" /> <!-- 文章点击次数 -->
@ -85,7 +86,7 @@
<result column="BASIC_DISPLAY" property="basicDisplay" /> <result column="BASIC_DISPLAY" property="basicDisplay" />
<!-- 一对一关联栏目 --> <!-- 一对一关联栏目 -->
<association property="column" <association property="column"
javaType="net.mingsoft.basic.entity.ColumnEntity"> javaType="net.mingsoft.basic.entity.ColumnEntity">
<result property="columnPath" column="column_path" /> <result property="columnPath" column="column_path" />
<result property="categoryTitle" column="category_title" /> <result property="categoryTitle" column="category_title" />
<result property="categoryId" column="category_id" /> <result property="categoryId" column="category_id" />
@ -101,7 +102,7 @@
BASIC_DISPLAY,BASIC_TITLE,BASIC_DESCRIPTION,BASIC_THUMBNAILS,BASIC_HIT,BASIC_DATETIME,BASIC_UPDATETIME,BASIC_PEOPLEID,BASIC_CATEGORYID,BASIC_SORT BASIC_DISPLAY,BASIC_TITLE,BASIC_DESCRIPTION,BASIC_THUMBNAILS,BASIC_HIT,BASIC_DATETIME,BASIC_UPDATETIME,BASIC_PEOPLEID,BASIC_CATEGORYID,BASIC_SORT
</sql> </sql>
<!-- 表栏目名结束 --> <!-- 表栏目名结束 -->
<!-- 文章基础数据返回数据列表 开始 --> <!-- 文章基础数据返回数据列表 开始 -->
<sql id="basic_data_list"> <sql id="basic_data_list">
BASIC_DISPLAY,BASIC_ID,BASIC_CATEGORYID,BASIC_TITLE,BASIC_DESCRIPTION,BASIC_THUMBNAILS,BASIC_HIT,BASIC_DATETIME,BASIC_UPDATETIME,BASIC_PEOPLEID,BASIC_SORT, BASIC_DISPLAY,BASIC_ID,BASIC_CATEGORYID,BASIC_TITLE,BASIC_DESCRIPTION,BASIC_THUMBNAILS,BASIC_HIT,BASIC_DATETIME,BASIC_UPDATETIME,BASIC_PEOPLEID,BASIC_SORT,
@ -186,10 +187,10 @@
where a.ARTICLE_BASICID=#{basicId} where a.ARTICLE_BASICID=#{basicId}
</select> </select>
<!-- 查找文章管理的信息 结束 --> <!-- 查找文章管理的信息 结束 -->
<!-- 标题字段query --> <!-- 标题字段query -->
<sql id="queryWhereBasicTitle" databaseId="mysql"> <sql id="queryWhereBasicTitle" databaseId="mysql">
CONCAT('%',#{article.basicTitle},'%') CONCAT('%',#{article.basicTitle},'%')
</sql> </sql>
<sql id="queryWhereBasicTitle" databaseId="oracle"> <sql id="queryWhereBasicTitle" databaseId="oracle">
'%'||#{ article.basicTitle}||'%' '%'||#{ article.basicTitle}||'%'
@ -199,7 +200,7 @@
</sql> </sql>
<!-- flag字段 --> <!-- flag字段 -->
<sql id="queryWhereFlag" databaseId="mysql"> <sql id="queryWhereFlag" databaseId="mysql">
CONCAT('%',#{flag},'%') CONCAT('%',#{flag},'%')
</sql> </sql>
<sql id="queryWhereFlag" databaseId="oracle"> <sql id="queryWhereFlag" databaseId="oracle">
'%'||#{ flag}||'%' '%'||#{ flag}||'%'
@ -209,7 +210,7 @@
</sql> </sql>
<!-- noFlag字段 --> <!-- noFlag字段 -->
<sql id="queryWhereNoFlag" databaseId="mysql"> <sql id="queryWhereNoFlag" databaseId="mysql">
CONCAT('%',#{noFlag},'%') CONCAT('%',#{noFlag},'%')
</sql> </sql>
<sql id="queryWhereNoFlag" databaseId="oracle"> <sql id="queryWhereNoFlag" databaseId="oracle">
'%'||#{ noFlag}||'%' '%'||#{ noFlag}||'%'
@ -237,7 +238,7 @@
<if test="basicCategoryIds != null"> <if test="basicCategoryIds != null">
and b.BASIC_CATEGORYID in and b.BASIC_CATEGORYID in
<foreach collection="basicCategoryIds" index="index" item="categoryId" <foreach collection="basicCategoryIds" index="index" item="categoryId"
open="(" separator="," close=")"> open="(" separator="," close=")">
#{categoryId} #{categoryId}
</foreach> </foreach>
</if> </if>
@ -250,15 +251,15 @@
</where> </where>
</select> </select>
<!-- 列表查询结束 --> <!-- 列表查询结束 -->
<!-- 列表查询开始 --> <!-- 列表查询开始 -->
<select id="query" resultMap="resultMap" > <select id="query" resultMap="resultMap" >
select select
<include refid="column_list" /> <include refid="column_list" />
,c.CATEGORY_TITLE,c.CATEGORY_ID ,c.CATEGORY_TITLE,c.CATEGORY_ID
,cl.COLUMN_PATH,cl.COLUMN_CM_ID,cl.COLUMN_TYPE,cl.COLUMN_CATEGORY_ID ,cl.COLUMN_PATH,cl.COLUMN_CM_ID,cl.COLUMN_TYPE,cl.COLUMN_CATEGORY_ID
FROM cms_article a LEFT JOIN basic b ON a.ARTICLE_BASICID = b.BASIC_ID FROM cms_article a LEFT JOIN basic b ON a.ARTICLE_BASICID = b.BASIC_ID
LEFT JOIN basic_column cl ON b.BASIC_CATEGORYID = cl.COLUMN_CATEGORY_ID LEFT JOIN basic_column cl ON b.BASIC_CATEGORYID = cl.COLUMN_CATEGORY_ID
JOIN category c ON c.CATEGORY_ID = cl.COLUMN_CATEGORY_ID JOIN category c ON c.CATEGORY_ID = cl.COLUMN_CATEGORY_ID
where a.ARTICLE_WEBID = #{webId} where a.ARTICLE_WEBID = #{webId}
<if test="article != null "> <if test="article != null ">
@ -270,7 +271,7 @@
<if test="basicCategoryIds != null"> <if test="basicCategoryIds != null">
and b.BASIC_CATEGORYID in and b.BASIC_CATEGORYID in
<foreach collection="basicCategoryIds" index="index" item="categoryId" <foreach collection="basicCategoryIds" index="index" item="categoryId"
open="(" separator="," close=")"> open="(" separator="," close=")">
#{categoryId} #{categoryId}
</foreach> </foreach>
</if> </if>
@ -321,23 +322,26 @@
<select id="queryIdsByCategoryIdForParser" resultMap="resultMapBean" > <select id="queryIdsByCategoryIdForParser" resultMap="resultMapBean" >
select select
ARTICLE_BASICID,cl.*,c.* ARTICLE_BASICID,cl.*,c.*
FROM cms_article a LEFT JOIN basic b ON a.ARTICLE_BASICID = b.BASIC_ID FROM cms_article a LEFT JOIN basic ON a.ARTICLE_BASICID = basic.BASIC_ID
LEFT JOIN basic_column cl ON b.BASIC_CATEGORYID = cl.COLUMN_CATEGORY_ID LEFT JOIN basic_column cl ON basic.BASIC_CATEGORYID = cl.COLUMN_CATEGORY_ID
JOIN category c ON c.CATEGORY_ID = cl.COLUMN_CATEGORY_ID JOIN category c ON c.CATEGORY_ID = cl.COLUMN_CATEGORY_ID
where where
<if test="appId &gt; 0"> <if test="appId &gt; 0">
a.ARTICLE_WEBID = #{appId} a.ARTICLE_WEBID = #{appId}
</if> </if>
<!-- 查询子栏目数据 --> <!-- 查询子栏目数据 -->
<if test="categoryId &gt; 0"> <if test="categoryId &gt; 0">
and (b.basic_categoryid=#{categoryId} or b.basic_categoryid in and (basic.basic_categoryid=#{categoryId} or basic.basic_categoryid in
(select category_id FROM category where <include refid="queryWhereCategoryId"></include>)) (select category_id FROM category where <include refid="queryWhereCategoryId"></include>))
</if> </if>
<if test="beginTime!=null and beginTime!=''"> <if test="beginTime!=null and beginTime!=''">
and b.basic_updatetime &gt;= #{beginTime} and basic.basic_updatetime &gt;= #{beginTime}
</if> </if>
<if test="endTime!=null and endTime!=''"> <if test="endTime!=null and endTime!=''">
and b.basic_updatetime &gt;= #{endTime} and basic.basic_updatetime &gt;= #{endTime}
</if>
<if test="orderBy!=null and order!=null and orderBy!='' and order!=''">
ORDER BY `${orderBy}` ${order}
</if> </if>
</select> </select>
@ -359,24 +363,24 @@
<!-- 根据字段条件查找文章实体开始 --> <!-- 根据字段条件查找文章实体开始 -->
<sql id="queryLike" databaseId="mysql"> <sql id="queryLike" databaseId="mysql">
like CONCAT("%", like CONCAT("%",
<foreach item="val" index="index" collection="item[3]"> <foreach item="val" index="index" collection="item[3]">
<if test="index==0">#{val}</if> <if test="index==0">#{val}</if>
</foreach> </foreach>
,"%") ,"%")
</sql> </sql>
<sql id="queryLike" databaseId="oracle"> <sql id="queryLike" databaseId="oracle">
like '%'|| like '%'||
<foreach item="val" index="index" collection="item[3]"> <foreach item="val" index="index" collection="item[3]">
<if test="index==0">#{val}</if> <if test="index==0">#{val}</if>
</foreach> </foreach>
||'%' ||'%'
</sql> </sql>
<sql id="queryLike" databaseId="sqlServer"> <sql id="queryLike" databaseId="sqlServer">
like '%'+ like '%'+
<foreach item="val" index="index" collection="item[3]"> <foreach item="val" index="index" collection="item[3]">
<if test="index==0">#{val}</if> <if test="index==0">#{val}</if>
</foreach> </foreach>
+'%' +'%'
</sql> </sql>
<!-- 已过期 --> <!-- 已过期 -->
<select id="queryListForSearch" resultMap="resultMap"> <select id="queryListForSearch" resultMap="resultMap">
@ -398,12 +402,12 @@
and and
b.BASIC_CATEGORYID in b.BASIC_CATEGORYID in
<foreach item="id" index="key" collection="ids" open="(" <foreach item="id" index="key" collection="ids" open="("
separator="," close=")"> separator="," close=")">
#{id.categoryId} #{id.categoryId}
</foreach> </foreach>
</if> </if>
<foreach item="item" index="key" collection="map" open="" <foreach item="item" index="key" collection="map" open=""
separator="" close=""> separator="" close="">
<if test=" item[0] == false"> <if test=" item[0] == false">
and ${key} and ${key}
</if> </if>
@ -421,7 +425,7 @@
<if test="item[2] == false"> <if test="item[2] == false">
between between
<foreach item="val" index="index" collection="item[3]" <foreach item="val" index="index" collection="item[3]"
separator="and"> separator="and">
#{val} #{val}
</foreach> </foreach>
</if> </if>
@ -460,12 +464,12 @@
cl.COLUMN_CATEGORY_ID cl.COLUMN_CATEGORY_ID
<if test="tableName!=null and tableName!=''">left join ${tableName} d on d.basicId=a.ARTICLE_BASICID <if test="tableName!=null and tableName!=''">left join ${tableName} d on d.basicId=a.ARTICLE_BASICID
</if> </if>
where a.ARTICLE_WEBID = #{websiteId} where a.ARTICLE_WEBID = #{websiteId}
<if test="ids!=null and ids!=''"> <if test="ids!=null and ids!=''">
and FIND_IN_SET(category_categoryid,'${ids}') and FIND_IN_SET(category_categoryid,'${ids}')
</if> </if>
<foreach item="item" index="key" collection="map" open="" <foreach item="item" index="key" collection="map" open=""
separator="" close=""> separator="" close="">
<if test=" item[0] == false"> <if test=" item[0] == false">
and ${key} and ${key}
</if> </if>
@ -483,7 +487,7 @@
<if test="item[2] == false"> <if test="item[2] == false">
between between
<foreach item="val" index="index" collection="item[3]" <foreach item="val" index="index" collection="item[3]"
separator="and"> separator="and">
#{val} #{val}
</foreach> </foreach>
</if> </if>
@ -505,12 +509,12 @@
<!-- 根据字段条件查找文章实体总数结束 --> <!-- 根据字段条件查找文章实体总数结束 -->
<select id="getById" resultMap="viewResultMap"> <select id="getById" resultMap="viewResultMap">
select select
<include refid="basic_data_list" /> <include refid="basic_data_list" />
from from
(((basic JOIN cms_article ON (BASIC_ID = ARTICLE_BASICID)) (((basic JOIN cms_article ON (BASIC_ID = ARTICLE_BASICID))
JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID)) JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID))
JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID)) JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID))
<if test="contentModelTableName!=null"> <if test="contentModelTableName!=null">
left join ${contentModelTableName} cmt on left join ${contentModelTableName} cmt on
cmt.basicid=basic_id cmt.basicid=basic_id
@ -531,12 +535,12 @@
<!-- 已过期 --> <!-- 已过期 -->
<!-- 查找上一篇下一篇 --> <!-- 查找上一篇下一篇 -->
<sql id="selectOne"> <sql id="selectOne">
from from
(((basic JOIN cms_article ON (BASIC_ID = ARTICLE_BASICID)) (((basic JOIN cms_article ON (BASIC_ID = ARTICLE_BASICID))
JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID)) JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID))
JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID)) JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID))
where category_appid=#{appId} where category_appid=#{appId}
<if test="flag==false"> <if test="flag==false">
and basic_id &lt; ${basicId} and basic_id &lt; ${basicId}
@ -551,7 +555,7 @@
</sql> </sql>
<!-- 已过期 --> <!-- 已过期 -->
<select id="getNextOrPrevious" resultMap="resultMap" databaseId="mysql"> <select id="getNextOrPrevious" resultMap="resultMap" databaseId="mysql">
select select
<include refid="basic_data_list" /> <include refid="basic_data_list" />
<include refid="selectOne"></include> <include refid="selectOne"></include>
<if test="flag==false"> <if test="flag==false">
@ -564,7 +568,7 @@
</select> </select>
<!-- 已过期 --> <!-- 已过期 -->
<select id="getNextOrPrevious" resultMap="resultMap" databaseId="oracle"> <select id="getNextOrPrevious" resultMap="resultMap" databaseId="oracle">
select select
<include refid="basic_data_list" /> <include refid="basic_data_list" />
<include refid="selectOne"></include> <include refid="selectOne"></include>
and rownum=1 and rownum=1
@ -598,13 +602,13 @@
</sql> </sql>
<!-- 已过期 --> <!-- 已过期 -->
<select id="getByCategoryId" resultMap="resultMap"> <select id="getByCategoryId" resultMap="resultMap">
select select
<include refid="basic_data_list" /> <include refid="basic_data_list" />
from from
(((basic JOIN cms_article ON (BASIC_ID = ARTICLE_BASICID)) (((basic JOIN cms_article ON (BASIC_ID = ARTICLE_BASICID))
JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID)) JOIN basic_column ON (BASIC_CATEGORYID = COLUMN_CATEGORY_ID))
JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID)) JOIN category ON (COLUMN_CATEGORY_ID = CATEGORY_ID))
where basic_categoryId=#{categoryId} order by basic_id desc where basic_categoryId=#{categoryId} order by basic_id desc
</select> </select>
<!-- 根据basicID删除开始 --> <!-- 根据basicID删除开始 -->
@ -613,7 +617,7 @@
<where> <where>
ARTICLE_BASICID in ARTICLE_BASICID in
<foreach collection="ids" item="item" index="index" open="(" <foreach collection="ids" item="item" index="index" open="("
separator="," close=")">#{item}</foreach> separator="," close=")">#{item}</foreach>
</where> </where>
</delete> </delete>

@ -1,5 +1,6 @@
#mcms\u7248\u672c #mcms\u7248\u672C
version=d3a98fefcb242db78da5fc31608ff247 version=d3a98fefcb242db78da5fc31608ff247
templet.file=\u6a21\u677f\u6587\u4ef6\u4e0d\u5b58\u5728 templet.file=\u6A21\u677F\u6587\u4EF6\u4E0D\u5B58\u5728
id=\u6587\u7ae0\u7f16\u53f7 id=\u6587\u7AE0\u7F16\u53F7
typeid=\u680f\u76ee\u7f16\u53f7 typeid=\u680F\u76EE\u7F16\u53F7
order=\u6392\u5E8F

Loading…
Cancel
Save