本文整理汇总了Java中com.zheng.cms.dao.model.CmsArticleExample类的典型用法代码示例。如果您正苦于以下问题:Java CmsArticleExample类的具体用法?Java CmsArticleExample怎么用?Java CmsArticleExample使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CmsArticleExample类属于com.zheng.cms.dao.model包,在下文中一共展示了CmsArticleExample类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: index
import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
@RequestMapping(value = "/{keyword}", method = RequestMethod.GET)
public String index(@PathVariable("keyword") String keyword,
@RequestParam(required = false, defaultValue = "1", value = "page") int page,
@RequestParam(required = false, defaultValue = "orders", value = "sort") String sort,
@RequestParam(required = false, defaultValue = "desc", value = "order") String order,
HttpServletRequest request,
Model model) {
// 该关键字文章列表
int rows = 10;
CmsArticleExample cmsArticleExample = new CmsArticleExample();
cmsArticleExample.createCriteria()
.andStatusEqualTo((byte) 1)
.andTitleLike(keyword);
if (!StringUtils.isBlank(sort) && !StringUtils.isBlank(order)) {
cmsArticleExample.setOrderByClause(sort + " " + order);
}
List<CmsArticle> articles = cmsArticleService.selectByExampleForOffsetPage(cmsArticleExample, (page - 1) * rows, rows);
model.addAttribute("articles", articles);
// 文章总数
long total = cmsArticleService.countByExample(cmsArticleExample);
// 分页
Paginator paginator = new Paginator(total, page, rows, request);
model.addAttribute("paginator", paginator);
return thymeleaf("/search/index");
}
示例2: list
import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
@ApiOperation(value = "文章列表")
@RequiresPermissions("cms:article:read")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(
@RequestParam(required = false, defaultValue = "0", value = "offset") int offset,
@RequestParam(required = false, defaultValue = "10", value = "limit") int limit,
@RequestParam(required = false, value = "sort") String sort,
@RequestParam(required = false, value = "order") String order) {
CmsArticleExample cmsArticleExample = new CmsArticleExample();
if (!StringUtils.isBlank(sort) && !StringUtils.isBlank(order)) {
cmsArticleExample.setOrderByClause(sort + " " + order);
}
List<CmsArticle> rows = cmsArticleService.selectByExampleForOffsetPage(cmsArticleExample, offset, limit);
long total = cmsArticleService.countByExample(cmsArticleExample);
Map<String, Object> result = new HashMap<>();
result.put("rows", rows);
result.put("total", total);
return result;
}
示例3: list
import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
@ApiOperation(value = "文章列表")
@RequiresPermissions("cms:article:read")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(
@RequestParam(required = false, defaultValue = "0", value = "offset") int offset,
@RequestParam(required = false, defaultValue = "10", value = "limit") int limit,
@RequestParam(required = false, value = "sort") String sort,
@RequestParam(required = false, value = "order") String order) {
CmsArticleExample cmsArticleExample = new CmsArticleExample();
if (!StringUtils.isBlank(sort) && !StringUtils.isBlank(order)) {
cmsArticleExample.setOrderByClause(sort + " " + order);
}
List<CmsArticle> rows = cmsArticleService.selectByExampleForOffsetPage(cmsArticleExample, offset, limit);
long total = cmsArticleService.countByExample(cmsArticleExample);
Map<String, Object> result = new HashMap<>(2);
result.put("rows", rows);
result.put("total", total);
return result;
}
示例4: countByExample
import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
long countByExample(CmsArticleExample example);
示例5: deleteByExample
import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
int deleteByExample(CmsArticleExample example);
示例6: selectByExampleWithBLOBs
import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
List<CmsArticle> selectByExampleWithBLOBs(CmsArticleExample example);
示例7: selectByExample
import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
List<CmsArticle> selectByExample(CmsArticleExample example);
示例8: updateByExampleSelective
import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
int updateByExampleSelective(@Param("record") CmsArticle record, @Param("example") CmsArticleExample example);
示例9: updateByExampleWithBLOBs
import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
int updateByExampleWithBLOBs(@Param("record") CmsArticle record, @Param("example") CmsArticleExample example);
示例10: updateByExample
import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
int updateByExample(@Param("record") CmsArticle record, @Param("example") CmsArticleExample example);