use of com.itrus.portal.db.RaAccountExample in project portal by ixinportal.
the class RaAccountController method list.
// 列表所有信息
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "message", required = false) Integer message, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) throws Exception {
// page,size
if (page == null || page < 1)
page = 1;
if (size == null || size < 1)
size = 10;
// count,pages
Integer count = sqlSession.selectOne("com.itrus.portal.db.RaAccountMapper.countByExample", null);
uiModel.addAttribute("count", count);
uiModel.addAttribute("pages", (count + size - 1) / size);
// page, size
if (page > 1 && size * (page - 1) >= count) {
page = (count + size - 1) / size;
}
uiModel.addAttribute("page", page);
uiModel.addAttribute("size", size);
// query data
Integer offset = size * (page - 1);
RaAccountExample raAccountex = new RaAccountExample();
// projectex.or().andIdIsNotNull();
raAccountex.setOffset(offset);
raAccountex.setLimit(size);
List raaccountall = sqlSession.selectList("com.itrus.portal.db.RaAccountMapper.selectByExample", raAccountex);
uiModel.addAttribute("raaccounts", raaccountall);
// itemcount
uiModel.addAttribute("itemcount", raaccountall.size());
uiModel.addAttribute("message", message == null ? "" : "要删除的RA配置存在关联,无法删除");
return "raaccount/list";
}
use of com.itrus.portal.db.RaAccountExample in project portal by ixinportal.
the class RaAccountServiceImpl method getRaByAccountHash.
public RaAccount getRaByAccountHash(String accountHash) {
RaAccountExample example = new RaAccountExample();
RaAccountExample.Criteria criteria = example.or();
criteria.andAccountHashEqualTo(accountHash);
example.setLimit(1);
RaAccount raAccount = sqlSession.selectOne("com.itrus.portal.db.RaAccountMapper.selectByExample", example);
return raAccount;
}
Aggregations