Shi Kejing 4 years ago
parent
commit
34abebf576

+ 1 - 1
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlArticleContentController.java

@ -182,7 +182,7 @@ public class ZjxlArticleContentController extends BaseController {
                                        // @ApiParam(name = "articleContentTitle", value = "文章标题", required = false) @RequestParam(value = "articleContentTitle", required = false)String articleContentTitle,
                                        // @ApiParam(name = "systemDictType", value = "内容类型 1-产品与服务  2-公司案例  3-新闻中心  4-关于我们", required = false, defaultValue = "3") @RequestParam(value = "systemDictType", required = false)Integer systemDictType,
                               @ApiParam(name = "articleContentClassify", value = "分类: 公司动态  媒体报道  参观交流", defaultValue = "公司动态") @RequestParam(value = "articleContentClassify") String articleContentClassify,
                               @ApiParam(name = "articleContentSubclassify", value = "子分类") @RequestParam(value = "articleContentSubclassify") String articleContentSubclassify,
                               @ApiParam(name = "articleContentSubclassify", value = "子分类") @RequestParam(value = "articleContentSubclassify", required = false) String articleContentSubclassify,
                               @ApiParam(name = "pageNo", value = "第几页", defaultValue = "1") @RequestParam(value = "pageNo", required = false) Integer pageNo,
                               @ApiParam(name = "pageSize", value = "分页大小", defaultValue = "10") @RequestParam(value = "pageSize", required = false) Integer pageSize){
        try {

+ 7 - 1
guns-main/src/main/java/cn/stylefeng/guns/zjxl/service/ZjxlArticleContentService.java

@ -105,7 +105,13 @@ public class ZjxlArticleContentService extends BaseService {
    }
    public int allNewsCount(String articleContentClassify,String articleContentSubclassify){
        String sql = "select count(*) from zjxl_article_content where article_content_type = 3  and article_content_classify = '"+articleContentClassify+"' and article_content_subclassify = '"+articleContentSubclassify+"'";
        String sql = "select count(*) from zjxl_article_content where article_content_type = 3 ";
        if (StringUtils.isNotEmpty(articleContentClassify)){
            sql += " and article_content_classify = '"+articleContentClassify+"'";
        }
        if (StringUtils.isNotEmpty(articleContentSubclassify)){
            sql += " and article_content_subclassify = '"+articleContentSubclassify+"'";
        }
        Integer allCount = jdbcTemplate.queryForObject(sql, Integer.class);;
        return allCount;
    }