public int addDepScope(DepScope deps) { // 重复的收发关系不添加 if ((depScopeDao.load(deps.getId())) == null) { return depScopeDao.add(deps); } else { return 0; } }
public int addDepScope(int depid, int scpDepId) { Department scpd = departmentDao.load(scpDepId); // 接收部门存在就添加该关系 if (scpd != null) { // 发送部门Id正确的情况下再添加 if (depid > 0) { DepScope ds = new DepScope(); ds.setOriDepId(depid); ds.setScopeDep(scpd); return depScopeDao.add(ds); } } return 0; }
public List<DepScope> list(int depId) { return depScopeDao.list("from DepScope ds where ds.oriDepId = ?", depId); }
public List<DepScope> list() { return depScopeDao.list("from DepScope"); }
public void deleteDepScope(int depid, int scpDepId) { String hql = "delete DepScope ds where ds.oriDepId = ? and ds.scopeDep.id = ? "; depScopeDao.executeByHql(hql, new Object[] {depid, scpDepId}); }
public void deleteDepInDepScope(int scpDepId) { String hql = "delete DepScope ds where ds.scopeDep.id = ? "; depScopeDao.executeByHql(hql, scpDepId); }
public void deleteReceiveDepScope(int depid) { String hql = "delete DepScope ds where ds.oriDepId = ? "; depScopeDao.executeByHql(hql, depid); }