當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。