use of com.github.liuweijw.business.admin.domain.QDept in project fw-cloud-framework by liuweijw.
the class DeptServiceImpl method delById.
@Override
@Transactional
@CacheEvict(allEntries = true)
public boolean delById(Integer id) {
if (null == id || id < 0)
return false;
QDept qDept = QDept.dept;
Long num = this.queryFactory.update(qDept).set(qDept.statu, 1).where(qDept.deptId.eq(id)).execute();
return null != num && num > 0;
}
use of com.github.liuweijw.business.admin.domain.QDept in project fw-cloud-framework by liuweijw.
the class DeptServiceImpl method getDeptTreeList.
@Override
@Cacheable(key = "'dept_tree_list'", unless = "#result eq null")
public List<DeptTree> getDeptTreeList() {
QDept dept = QDept.dept;
List<Dept> list = this.queryFactory.selectFrom(dept).where(dept.statu.eq(0)).fetch();
if (null == list || list.size() == 0)
return new ArrayList<DeptTree>();
return getDeptTree(list, 0);
}
use of com.github.liuweijw.business.admin.domain.QDept in project fw-cloud-framework by liuweijw.
the class DeptServiceImpl method findAll.
@Override
@Cacheable(key = "'page_dept_' + #p0.currentPage + '_' + #p0.pageSize + '_' + #p1.type + '_' + #p1.label")
public PageBean<Dept> findAll(PageParams pageParams, Dept dept) {
QDept qDept = QDept.dept;
Predicate qNamePredicate = null;
if (null != dept) {
if (StringHelper.isNotBlank(dept.getDeptName())) {
qNamePredicate = qDept.deptName.like("%" + dept.getDeptName().trim() + "%");
}
}
Predicate predicate = qDept.deptId.goe(0).and(qNamePredicate);
Sort sort = new Sort(new Sort.Order(Sort.Direction.DESC, "deptId"));
PageRequest pageRequest = PageUtils.of(pageParams, sort);
Page<Dept> pageList = deptRepository.findAll(predicate, pageRequest);
return PageUtils.of(pageList);
}
Aggregations