本文整理匯總了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);