当前位置: 首页>>代码示例>>Java>>正文


Java CmsArticleExample类代码示例

本文整理汇总了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");
}
 
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:26,代码来源:SearchController.java

示例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;
}
 
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:21,代码来源:CmsArticleController.java

示例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;
}
 
开发者ID:ChangyiHuang,项目名称:shuzheng,代码行数:21,代码来源:CmsArticleController.java

示例4: countByExample

import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
long countByExample(CmsArticleExample example); 
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:2,代码来源:CmsArticleMapper.java

示例5: deleteByExample

import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
int deleteByExample(CmsArticleExample example); 
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:2,代码来源:CmsArticleMapper.java

示例6: selectByExampleWithBLOBs

import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
List<CmsArticle> selectByExampleWithBLOBs(CmsArticleExample example); 
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:2,代码来源:CmsArticleMapper.java

示例7: selectByExample

import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
List<CmsArticle> selectByExample(CmsArticleExample example); 
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:2,代码来源:CmsArticleMapper.java

示例8: updateByExampleSelective

import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
int updateByExampleSelective(@Param("record") CmsArticle record, @Param("example") CmsArticleExample example); 
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:2,代码来源:CmsArticleMapper.java

示例9: updateByExampleWithBLOBs

import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
int updateByExampleWithBLOBs(@Param("record") CmsArticle record, @Param("example") CmsArticleExample example); 
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:2,代码来源:CmsArticleMapper.java

示例10: updateByExample

import com.zheng.cms.dao.model.CmsArticleExample; //导入依赖的package包/类
int updateByExample(@Param("record") CmsArticle record, @Param("example") CmsArticleExample example); 
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:2,代码来源:CmsArticleMapper.java


注:本文中的com.zheng.cms.dao.model.CmsArticleExample类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。