use of com.github.liuweijw.business.admin.domain.QRole in project fw-cloud-framework by liuweijw.
the class RoleServiceImpl method getRoleListByDeptId.
@Override
public List<Role> getRoleListByDeptId(Integer deptId) {
if (null == deptId || deptId <= 0)
return null;
// load role
QRoleDept qRoleDept = QRoleDept.roleDept;
QRole qRole = QRole.role;
List<Role> rList = this.queryFactory.select(qRole).from(qRoleDept, qRole).where(qRoleDept.deptId.eq(deptId)).where(qRoleDept.roleId.eq(qRole.roleId)).fetch();
return rList;
}
use of com.github.liuweijw.business.admin.domain.QRole in project fw-cloud-framework by liuweijw.
the class RoleServiceImpl method findRoleListByDeptId.
@Override
@Cacheable(key = "'role_deptid_' + #deptId")
public List<Role> findRoleListByDeptId(Integer deptId) {
if (null == deptId || deptId <= 0)
return null;
// load role
QRoleDept qRoleDept = QRoleDept.roleDept;
QRole qRole = QRole.role;
List<Role> rList = this.queryFactory.select(qRole).from(qRoleDept, qRole).where(qRoleDept.deptId.eq(deptId)).where(qRoleDept.roleId.eq(qRole.roleId)).fetch();
return rList;
}
use of com.github.liuweijw.business.admin.domain.QRole in project fw-cloud-framework by liuweijw.
the class RoleServiceImpl method delById.
@Override
@Transactional
@CacheEvict(allEntries = true)
public boolean delById(Integer roleId) {
if (null == roleId || roleId <= 0)
return Boolean.FALSE;
QRole qRole = QRole.role;
long num = this.queryFactory.update(qRole).set(qRole.statu, // 0 正常 1删除
1).where(qRole.roleId.eq(roleId.intValue())).execute();
return num > 0;
}
use of com.github.liuweijw.business.admin.domain.QRole in project fw-cloud-framework by liuweijw.
the class UserServiceImpl method findRoleListByUserId.
public List<Role> findRoleListByUserId(Integer userId) {
if (null == userId)
return null;
// load role
QUserRole qUserRole = QUserRole.userRole;
QRole qRole = QRole.role;
List<Role> rList = this.queryFactory.select(qRole).from(qUserRole, qRole).where(qUserRole.userId.eq(userId)).where(qUserRole.roleId.eq(qRole.roleId)).fetch();
return rList;
}
Aggregations