Commit fc871e29 authored by unset's avatar unset

新增官网咨询和banner

parent e97282fc
...@@ -3,17 +3,16 @@ package com.xxfc.platform.uccn.biz; ...@@ -3,17 +3,16 @@ package com.xxfc.platform.uccn.biz;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.xxfc.platform.uccn.comstnt.UrlType; import com.xxfc.platform.uccn.comstnt.UrlType;
import com.xxfc.platform.uccn.entity.Article; import com.xxfc.platform.uccn.entity.Article;
import com.xxfc.platform.uccn.mapper.ArticleMapper; import com.xxfc.platform.uccn.mapper.ArticleMapper;
import com.xxfc.platform.uccn.vo.ArticleQuery; import com.xxfc.platform.uccn.vo.ArticleQuery;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls; import tk.mybatis.mapper.weekend.WeekendSqls;
import java.security.SecureRandom;
import java.util.*; import java.util.*;
...@@ -43,10 +42,23 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -43,10 +42,23 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
* @param type * @param type
* @return * @return
*/ */
public PageInfo getArticleList(Integer page, Integer limit, Integer type,String title) { public PageInfo getArticleList(Integer page, Integer limit, Integer type,String title, Integer typeId) {
PageHelper.startPage(page, limit); PageHelper.startPage(page, limit);
List articleList = mapper.getArticleList(type,null,null,title); Example example = new Example(Article.class);
return PageInfo.of(articleList); Example.Criteria criteria = example.createCriteria();
if (type != null) {
criteria.andEqualTo("type", type);
}
if (StringUtils.isNotBlank(title)) {
criteria.andEqualTo("title", "%" + title + "%");
}
if (typeId != null) {
criteria.andEqualTo("typeId", typeId);
}
criteria.andEqualTo("isDel", 0);
criteria.andEqualTo("status", 1);
example.orderBy("weight").asc();
return PageInfo.of(mapper.selectByExample(example));
} }
/** /**
......
...@@ -26,8 +26,9 @@ public class ArticleController extends BaseController<ArticleBiz, Article> { ...@@ -26,8 +26,9 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
@RequestParam(name = "page", defaultValue = "1") Integer page, @RequestParam(name = "page", defaultValue = "1") Integer page,
@RequestParam(name = "limit", defaultValue = "10") Integer limit, @RequestParam(name = "limit", defaultValue = "10") Integer limit,
@RequestParam(name = "type", defaultValue = "1") Integer type, @RequestParam(name = "type", defaultValue = "1") Integer type,
@RequestParam(value = "title",required = false) String title) { @RequestParam(value = "title",required = false) String title,
return ObjectRestResponse.succ(baseBiz.getArticleList(page, limit, type,title)); @RequestParam(value = "typeId",required = false) Integer typeId) {
return ObjectRestResponse.succ(baseBiz.getArticleList(page, limit, type,title, typeId));
} }
@GetMapping("/app/unauth/one") @GetMapping("/app/unauth/one")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment