src/main/java/com/zx/maintain/service/MroleService.java
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.zx.maintain.service;
import java.util.List;
import javacommon.base.BaseService;
import javacommon.base.EntityDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.zx.maintain.common.param.MroleQuery;
import com.zx.maintain.dao.MroleDao;
import com.zx.maintain.model.Mrole;
import cn.org.rapid_framework.page.Page;
@SuppressWarnings("unchecked")
@Service
@Transactional
public class MroleService extends BaseService<Mrole, Long> {
@Autowired
private MroleDao mroleDao;
public EntityDao getEntityDao() {
return this.mroleDao;
}
@Transactional(readOnly = true)
public Page findPage(MroleQuery query) {
return mroleDao.findPage(query);
}
/**
* 根据角色名称判断角色是否存在
*
* @param role
* @return
*/
public Boolean isExist(Mrole role) {
List<Mrole> mroleList = mroleDao.getByName(role.getRoleName());
if(mroleList.size() == 0){
return false;
}
if(mroleList.size() == 1 && role.getId()==null){
return true;
}
if(mroleList.size() == 1 && role.getId()!=null){
if (mroleList.get(0).getId().longValue() == role.getId().longValue()) {
return false;
}
else {
return true;
}
}
return true;
后面还有 11 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
