Commit b2b5db15 authored by unset's avatar unset

修改banner接口

parent 9ec7ac2b
...@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO; ...@@ -10,6 +10,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.uccn.dto.BannerDto; import com.xxfc.platform.uccn.dto.BannerDto;
import com.xxfc.platform.uccn.entity.Banner; import com.xxfc.platform.uccn.entity.Banner;
import com.xxfc.platform.uccn.mapper.BannerMapper; import com.xxfc.platform.uccn.mapper.BannerMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
...@@ -47,12 +48,15 @@ public class BannerBiz extends BaseBiz<BannerMapper, Banner> { ...@@ -47,12 +48,15 @@ public class BannerBiz extends BaseBiz<BannerMapper, Banner> {
* @param indexShow 是否首页展示 * @param indexShow 是否首页展示
* @return * @return
*/ */
public ObjectRestResponse<List<Banner>> getAll(Integer indexShow, Integer location) { public ObjectRestResponse<List<Banner>> getAll(Integer indexShow, Integer location, String title) {
Example example = new Example(Banner.class); Example example = new Example(Banner.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("location", location);
if (indexShow != null) { if (indexShow != null) {
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("indexShow",indexShow).andEqualTo("location", location); criteria.andEqualTo("indexShow", indexShow);
} else { }
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("location", location); if (StringUtils.isNotBlank(title)) {
criteria.andLike("title", "%" + title + "%");
} }
example.orderBy("rank"); example.orderBy("rank");
return ObjectRestResponse.succ(mapper.selectByExample(example)); return ObjectRestResponse.succ(mapper.selectByExample(example));
......
...@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
public class BannerWebController extends BaseController<BannerBiz, Banner> { public class BannerWebController extends BaseController<BannerBiz, Banner> {
@GetMapping(value = "/app/unauth/getAll") @GetMapping(value = "/app/unauth/getAll")
public ObjectRestResponse getAll(@RequestParam(value = "location", defaultValue = "1") Integer location) { public ObjectRestResponse getAll(@RequestParam(value = "location", defaultValue = "1") Integer location, String title) {
return baseBiz.getAll(1, location); return baseBiz.getAll(1, location, title);
} }
} }
\ No newline at end of file
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