use of com.ngtesting.platform.vo.Page in project ngtesting-platform by aaronchen2k.
the class ChatServiceImpl method listByEvent.
@Override
public List<TestThread> listByEvent(Long eventId) {
DetachedCriteria dc = DetachedCriteria.forClass(TestThread.class);
dc.add(Restrictions.eq("eventId", eventId));
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
dc.addOrder(Order.asc("id"));
Page page = findPage(dc, 0, 10);
return page.getItems();
}
use of com.ngtesting.platform.vo.Page in project ngtesting-platform by aaronchen2k.
the class OrgGroupServiceImpl method search.
@Override
public List search(Long orgId, String keywords, JSONArray exceptIds) {
DetachedCriteria dc = DetachedCriteria.forClass(TestOrgGroup.class);
dc.add(Restrictions.eq("orgId", orgId));
List<Long> ids = new ArrayList();
for (Object json : exceptIds.toArray()) {
ids.add(Long.valueOf(json.toString()));
}
if (exceptIds.size() > 0) {
dc.add(Restrictions.not(Restrictions.in("id", ids)));
}
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
if (StringUtil.isNotEmpty(keywords)) {
dc.add(Restrictions.like("name", "%" + keywords + "%"));
}
dc.addOrder(Order.asc("id"));
Page page = findPage(dc, 0, 20);
return page.getItems();
}
use of com.ngtesting.platform.vo.Page in project ngtesting-platform by aaronchen2k.
the class SysRoleServiceImpl method listByPage.
@Override
public Page listByPage(Long orgId, String keywords, String disabled, Integer currentPage, Integer itemsPerPage) {
DetachedCriteria dc = DetachedCriteria.forClass(SysRole.class);
dc.add(Restrictions.eq("orgId", orgId));
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
if (StringUtil.isNotEmpty(keywords)) {
dc.add(Restrictions.like("name", "%" + keywords + "%"));
}
if (StringUtil.isNotEmpty(disabled)) {
dc.add(Restrictions.eq("disabled", Boolean.valueOf(disabled)));
}
dc.addOrder(Order.asc("id"));
Page page = findPage(dc, currentPage * itemsPerPage, itemsPerPage);
return page;
}
use of com.ngtesting.platform.vo.Page in project ngtesting-platform by aaronchen2k.
the class UserServiceImpl method search.
@Override
public List<TestUser> search(Long orgId, String keywords, JSONArray exceptIds) {
DetachedCriteria dc = DetachedCriteria.forClass(TestUser.class);
dc.createAlias("orgSet", "orgs");
dc.add(Restrictions.eq("orgs.id", orgId));
if (exceptIds != null && exceptIds.size() > 0) {
List<Long> ids = new ArrayList();
for (Object json : exceptIds.toArray()) {
ids.add(Long.valueOf(json.toString()));
}
dc.add(Restrictions.not(Restrictions.in("id", ids)));
}
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
if (StringUtil.isNotEmpty(keywords)) {
dc.add(Restrictions.or(Restrictions.like("name", "%" + keywords + "%"), Restrictions.like("email", "%" + keywords + "%"), Restrictions.like("phone", "%" + keywords + "%")));
}
dc.addOrder(Order.asc("id"));
Page page = findPage(dc, 0, 20);
return page.getItems();
}
use of com.ngtesting.platform.vo.Page in project ngtesting-platform by aaronchen2k.
the class MsgServiceImpl method listByPage.
@Override
public Page listByPage(Long userId, String isRead, String keywords, Integer currentPage, Integer itemsPerPage) {
DetachedCriteria dc = DetachedCriteria.forClass(TestMsg.class);
dc.add(Restrictions.eq("userId", userId));
if (StringUtil.isNotEmpty(keywords)) {
dc.add(Restrictions.like("name", "%" + keywords + "%"));
}
if (StringUtils.isNotEmpty(isRead)) {
dc.add(Restrictions.eq("isRead", Boolean.valueOf(isRead)));
}
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
dc.addOrder(Order.desc("createTime"));
Page page = findPage(dc, currentPage * itemsPerPage, itemsPerPage);
return page;
}
Aggregations