IArticleDao.java 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /**
  2. The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  4. * this software and associated documentation files (the "Software"), to deal in
  5. * the Software without restriction, including without limitation the rights to
  6. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  7. * the Software, and to permit persons to whom the Software is furnished to do so,
  8. * subject to the following conditions:
  9. * The above copyright notice and this permission notice shall be included in all
  10. * copies or substantial portions of the Software.
  11. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  13. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  14. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  15. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. */
  18. package net.mingsoft.cms.dao;
  19. import java.util.List;
  20. import java.util.Map;
  21. import org.apache.ibatis.annotations.Param;
  22. import net.mingsoft.cms.bean.ColumnArticleIdBean;
  23. import net.mingsoft.cms.entity.ArticleEntity;
  24. import net.mingsoft.base.dao.IBaseDao;
  25. /**
  26. *
  27. * @ClassName: IArticleDao
  28. * @Description:TODO(文章管理持久化层 || 继承IBaseDao持久化层)
  29. * @author: 铭飞开发团队
  30. * @date: 2018年1月31日 下午2:55:33
  31. *
  32. * @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
  33. */
  34. public interface IArticleDao extends IBaseDao {
  35. /**
  36. * @para webId 网站编号
  37. * @param basicCategoryIds
  38. * 栏目编号集合
  39. * @param flag
  40. * 文章属性
  41. * @param noFlag
  42. * 文章不存在的属性
  43. * @param article
  44. * 文章实体,便于扩展查询
  45. * @return 文章总数
  46. */
  47. @Deprecated
  48. int count(@Param("webId") int webId, @Param("basicCategoryIds") int[] basicCategoryIds, @Param("flag") String flag,
  49. @Param("noFlag") String noFlag, @Param("article") ArticleEntity article);
  50. /**
  51. * 通过分类id获取文章内容
  52. *
  53. * @param categoryId
  54. * 分类编号
  55. * @return 文章集合
  56. */
  57. @Deprecated
  58. List getByCategoryId(@Param("categoryId") int categoryId);
  59. /**
  60. * 通过视图表来查询文章总数
  61. *
  62. * @param basicId
  63. * 文章编号
  64. * @param contentModelTableName
  65. * 对应模块表名称
  66. */
  67. List getById(@Param("basicId") int basicId, @Param("contentModelTableName") String contentModelTableName);
  68. /**
  69. * 查找basicId上一篇文章
  70. *
  71. * @param appId
  72. * 应用编号
  73. * @param basicId
  74. * 文章编号
  75. * @param flag
  76. * true:上一条 false:下一条
  77. * @return
  78. */
  79. ArticleEntity getNextOrPrevious(@Param("appId") int appId, @Param("basicId") int basicId,
  80. @Param("flag") boolean flag, @Param("categoryId") Integer categoryId);
  81. /**
  82. * 根据查询文章实体总数
  83. *
  84. * @param tableName
  85. * :自定义生成的表名
  86. * @param map
  87. * key:字段名 value:List 字段的各种判断值 list[0]:是否为自定义字段 list[1]:是否为整形
  88. * list[2]:是否是等值查询 list[3]:字段的值
  89. * @return 文章实体总数
  90. */
  91. int getSearchCount(@Param("tableName") String tableName, @Param("map") Map<String, List> map,
  92. @Param("websiteId") int websiteId, @Param("ids") String ids);
  93. /**
  94. * 文章查询
  95. *
  96. * @para webId 网站编号
  97. * @param basicCategoryIds
  98. * 栏目编号集合
  99. * @param flag
  100. * 文章属性
  101. * @param noFlag
  102. * 文章不存在的属性
  103. * @param orderBy
  104. * 排序字段
  105. * @param order
  106. * true 升序 false 降序 排序方式
  107. * @param article
  108. * 文章实体,便于扩展查询
  109. * @param beginTime 开始时间
  110. * @param endTime 结束时间
  111. * @return 文章集合
  112. */
  113. List<ArticleEntity> query(@Param("webId") int webId, @Param("basicCategoryIds") int[] basicCategoryIds,
  114. @Param("flag") String flag, @Param("noFlag") String noFlag, @Param("orderBy") String orderBy,
  115. @Param("order") boolean order, @Param("beginTime") String beginTime,@Param("endTime") String endTime,
  116. @Param("article") ArticleEntity article);
  117. /**
  118. * 根据页面栏目的id获取与其绑定的文章实体
  119. *
  120. * @param basicCategoryId
  121. * @return 文章实体
  122. */
  123. @Deprecated
  124. List<ArticleEntity> queryListByColumnId(@Param("basicCategoryId") int basicCategoryId);
  125. /**
  126. * 根据查询文章实体
  127. *
  128. * @param tableName
  129. * :自定义生成的表名
  130. * @param map
  131. * 获取查询条件的Map key:字段名 value:List 字段的各种判断值 list[0]:是否为自定义字段
  132. * list[1]:是否为整形 list[2]:是否是等值查询 list[3]:字段的值
  133. * @return 文章实体
  134. */
  135. @Deprecated
  136. List<ArticleEntity> queryListForSearch(@Param("tableName") String tableName, @Param("map") Map<String, List> map,
  137. @Param("websiteId") int websiteId, @Param("ids") List ids,
  138. @Param("sortMap") Map sortMap);
  139. /**
  140. * 查询文章编号集合
  141. * @param categoryId 栏目编号
  142. * @param appId 站点编号
  143. * @param beginTime 开始时间
  144. * @param endTime 结束时间
  145. * @return
  146. */
  147. 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);
  148. }