Example #1
0
  public int addDepScope(DepScope deps) {

    // 重复的收发关系不添加
    if ((depScopeDao.load(deps.getId())) == null) {
      return depScopeDao.add(deps);
    } else {
      return 0;
    }
  }
Example #2
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;
  }
Example #3
0
 public List<DepScope> list(int depId) {
   return depScopeDao.list("from DepScope ds where ds.oriDepId = ?", depId);
 }
Example #4
0
 public List<DepScope> list() {
   return depScopeDao.list("from DepScope");
 }
Example #5
0
 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});
 }
Example #6
0
 public void deleteDepInDepScope(int scpDepId) {
   String hql = "delete DepScope ds where ds.scopeDep.id = ? ";
   depScopeDao.executeByHql(hql, scpDepId);
 }
Example #7
0
 public void deleteReceiveDepScope(int depid) {
   String hql = "delete DepScope ds where ds.oriDepId = ? ";
   depScopeDao.executeByHql(hql, depid);
 }