Пример #1
0
 public GenericVO findByPK(GenericVO vo) throws AppException, SysException {
   StaffWorkAreaSVO result = null;
   StaffWorkAreaSVO staffWorkArea = (StaffWorkAreaSVO) vo;
   StringBuffer sql = new StringBuffer("select");
   sql.append(
       " a.STAFF_WORK_AREA_ID,a.STAFF_ID,a.WORK_AREA_ID,a.GRANTOR,a.ADMIN_FLAG,a.STS,a.STS_DATE,a.CREATE_DATE");
   sql.append(" from STAFF_WORK_AREA a where 1=1");
   sql.append(" and STAFF_WORK_AREA_ID=?");
   Connection connection = null;
   PreparedStatement ps = null;
   ResultSet rs = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     ps.setString(1, staffWorkArea.getStaffWorkAreaId());
     rs = ps.executeQuery();
     result = (StaffWorkAreaSVO) ResultSetUtil.convertToVo(rs, StaffWorkAreaSVO.class);
   } catch (SQLException e) {
     throw new SysException("", "findByPK error..", e);
   } finally {
     try {
       if (rs != null) {
         rs.close();
       }
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
   return result;
 }
Пример #2
0
 public void add(GenericVO vo) throws AppException, SysException {
   StaffWorkAreaSVO staffWorkArea = (StaffWorkAreaSVO) vo;
   StringBuffer sql = new StringBuffer("insert into");
   sql.append(
       " STAFF_WORK_AREA(STAFF_WORK_AREA_ID,STAFF_ID,WORK_AREA_ID,GRANTOR,ADMIN_FLAG,STS,STS_DATE,CREATE_DATE) values(?,?,?,?,?,?,?,?)");
   Connection connection = null;
   PreparedStatement ps = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     ps.setString(1, staffWorkArea.getStaffWorkAreaId());
     ps.setString(2, staffWorkArea.getStaffId());
     ps.setString(3, staffWorkArea.getWorkAreaId());
     ps.setString(4, staffWorkArea.getGrantor());
     ps.setString(5, staffWorkArea.getAdminFlag());
     ps.setString(6, staffWorkArea.getSts());
     ps.setDate(7, staffWorkArea.getStsDate());
     ps.setDate(8, staffWorkArea.getCreateDate());
     ps.execute();
     connection.commit();
   } catch (SQLException e) {
     throw new SysException("", "add error..", e);
   } finally {
     try {
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
 }
Пример #3
0
 public GenericVO findByPK(GenericVO vo) throws AppException, SysException {
   ProvinceSVO result = null;
   ProvinceSVO province = (ProvinceSVO) vo;
   StringBuffer sql = new StringBuffer("select");
   sql.append(" a.PROV_ID,a.NAME");
   sql.append(" from PROVINCE a where 1=1");
   sql.append(" and PROV_ID=?");
   Connection connection = null;
   PreparedStatement ps = null;
   ResultSet rs = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     ps.setString(1, province.getProvId());
     rs = ps.executeQuery();
     result = (ProvinceSVO) ResultSetUtil.convertToVo(rs, ProvinceSVO.class);
   } catch (SQLException e) {
     throw new SysException("", "findByPK error..", e);
   } finally {
     try {
       if (rs != null) {
         rs.close();
       }
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
   return result;
 }
Пример #4
0
 public void delete(GenericVO vo) throws AppException, SysException {
   StaffWorkAreaSVO staffWorkArea = (StaffWorkAreaSVO) vo;
   if (vo == null) {
     throw new RuntimeException();
   }
   StringBuffer sql = new StringBuffer("delete from STAFF_WORK_AREA where 1=1");
   sql.append(" and STAFF_WORK_AREA_ID=?");
   Connection connection = null;
   PreparedStatement ps = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     ps.setString(1, staffWorkArea.getStaffWorkAreaId());
     ps.execute();
   } catch (SQLException e) {
     throw new SysException("", "delete error..", e);
   } finally {
     try {
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
 }
Пример #5
0
 public void update(GenericVO vo) throws AppException, SysException {
   ProvinceSVO province = (ProvinceSVO) vo;
   StringBuffer sql = new StringBuffer("update PROVINCE set");
   if (province.getName() != null) {
     sql.append(" NAME=?,");
   }
   sql = sql.delete(sql.length() - 1, sql.length());
   sql.append(" where 1=1");
   sql.append(" and PROV_ID=?");
   Connection connection = null;
   PreparedStatement ps = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     int index = 1;
     if (province.getName() != null) {
       ps.setString(index++, province.getName());
     }
     ps.setString(index++, province.getProvId());
     ps.execute();
   } catch (SQLException e) {
     throw new SysException("", "update error..", e);
   } finally {
     try {
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
 }
Пример #6
0
 public void delete(GenericVO vo) throws AppException, SysException {
   ProvinceSVO province = (ProvinceSVO) vo;
   if (vo == null) {
     throw new RuntimeException();
   }
   StringBuffer sql = new StringBuffer("delete from PROVINCE where 1=1");
   sql.append(" and PROV_ID=?");
   Connection connection = null;
   PreparedStatement ps = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     ps.setString(1, province.getProvId());
     ps.execute();
   } catch (SQLException e) {
     throw new SysException("", "delete error..", e);
   } finally {
     try {
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
 }
 public SysAreaConfigMVO findByPK(SysAreaConfigMVO mvo) throws AppException, SysException {
   SysAreaConfigMVO result = null;
   StringBuffer sql = new StringBuffer("select");
   sql.append(
       " a.SYS_AREA_CONFIG_ID,a.CONFIG_ID,a.SP_AREA_ID,a.CUR_VALUE,a.VALUE_DESC,b.name, b.system_name,b.config_type ");
   sql.append(" from SYS_AREA_CONFIG a,sys_config b where 1=1 and a.config_id=b.config_id ");
   sql.append(" and a.SYS_AREA_CONFIG_ID=?");
   Connection connection = null;
   PreparedStatement ps = null;
   ResultSet rs = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     ps.setString(1, mvo.getSysAreaConfigId());
     rs = ps.executeQuery();
     result = (SysAreaConfigMVO) ResultSetUtil.convertToVo(rs, SysAreaConfigMVO.class);
   } catch (SQLException e) {
     throw new SysException("", "findByPK error..", e);
   } finally {
     try {
       if (rs != null) {
         rs.close();
       }
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
   return result;
 }
Пример #8
0
 public List findByVO(GenericVO vo) throws AppException, SysException {
   List results = null;
   ProvinceSVO province = (ProvinceSVO) vo;
   StringBuffer sql = new StringBuffer();
   sql.append("select");
   sql.append(" a.PROV_ID,a.NAME");
   sql.append(" from PROVINCE a where 1=1");
   if (province.getProvId() != null) {
     sql.append(" and PROV_ID=?");
   }
   if (province.getName() != null) {
     sql.append(" and NAME=?");
   }
   Connection connection = null;
   PreparedStatement ps = null;
   ResultSet rs = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     int index = 1;
     if (province.getProvId() != null) {
       ps.setString(index++, province.getProvId());
     }
     if (province.getName() != null) {
       ps.setString(index++, province.getName());
     }
     rs = ps.executeQuery();
     results = (List) ResultSetUtil.convertToList(rs, ProvinceSVO.class);
   } catch (SQLException e) {
     throw new SysException("", "findByVO error..", e);
   } finally {
     try {
       if (rs != null) {
         rs.close();
       }
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
   return results;
 }
Пример #9
0
  public void add(GenericVO vo) throws AppException, SysException {

    ProvinceSVO province = (ProvinceSVO) vo;
    StringBuffer sql = new StringBuffer("insert into");
    sql.append(" PROVINCE(PROV_ID,NAME) values(?,?)");
    Connection connection = null;
    PreparedStatement ps = null;
    try {
      connection = ConnectionFactory.getConnection();
      ps = connection.prepareStatement(sql.toString());
      ps.setString(1, province.getProvId());
      ps.setString(2, province.getName());
      ps.execute();
    } catch (SQLException e) {
      throw new SysException("", "add error..", e);
    } finally {
      try {
        if (ps != null) {
          ps.close();
        }
      } catch (SQLException e) {
      }
    }
  }
Пример #10
0
 public void update(GenericVO vo) throws AppException, SysException {
   StaffWorkAreaSVO staffWorkArea = (StaffWorkAreaSVO) vo;
   StringBuffer sql = new StringBuffer("update STAFF_WORK_AREA set");
   if (staffWorkArea.getStaffId() != null) {
     sql.append(" STAFF_ID=?,");
   }
   if (staffWorkArea.getWorkAreaId() != null) {
     sql.append(" WORK_AREA_ID=?,");
   }
   if (staffWorkArea.getGrantor() != null) {
     sql.append(" GRANTOR=?,");
   }
   if (staffWorkArea.getAdminFlag() != null) {
     sql.append(" ADMIN_FLAG=?,");
   }
   if (staffWorkArea.getSts() != null) {
     sql.append(" STS=?,");
   }
   if (staffWorkArea.getStsDate() != null) {
     sql.append(" STS_DATE=?,");
   }
   if (staffWorkArea.getCreateDate() != null) {
     sql.append(" CREATE_DATE=?,");
   }
   sql = sql.delete(sql.length() - 1, sql.length());
   sql.append(" where 1=1");
   sql.append(" and STAFF_WORK_AREA_ID=?");
   Connection connection = null;
   PreparedStatement ps = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     int index = 1;
     if (staffWorkArea.getStaffId() != null) {
       ps.setString(index++, staffWorkArea.getStaffId());
     }
     if (staffWorkArea.getWorkAreaId() != null) {
       ps.setString(index++, staffWorkArea.getWorkAreaId());
     }
     if (staffWorkArea.getGrantor() != null) {
       ps.setString(index++, staffWorkArea.getGrantor());
     }
     if (staffWorkArea.getAdminFlag() != null) {
       ps.setString(index++, staffWorkArea.getAdminFlag());
     }
     if (staffWorkArea.getSts() != null) {
       ps.setString(index++, staffWorkArea.getSts());
     }
     if (staffWorkArea.getStsDate() != null) {
       ps.setDate(index++, staffWorkArea.getStsDate());
     }
     if (staffWorkArea.getCreateDate() != null) {
       ps.setDate(index++, staffWorkArea.getCreateDate());
     }
     ps.setString(index++, staffWorkArea.getStaffWorkAreaId());
     ps.execute();
   } catch (SQLException e) {
     throw new SysException("", "update error..", e);
   } finally {
     try {
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
 }
Пример #11
0
 public List findByVO(GenericVO vo) throws AppException, SysException {
   List results = null;
   StaffWorkAreaSVO staffWorkArea = (StaffWorkAreaSVO) vo;
   StringBuffer sql = new StringBuffer();
   sql.append("select");
   sql.append(
       " a.STAFF_WORK_AREA_ID,a.STAFF_ID,a.WORK_AREA_ID,a.GRANTOR,a.ADMIN_FLAG,a.STS,a.STS_DATE,a.CREATE_DATE");
   sql.append(" from STAFF_WORK_AREA a where 1=1");
   if (staffWorkArea.getStaffWorkAreaId() != null) {
     sql.append(" and STAFF_WORK_AREA_ID=?");
   }
   if (staffWorkArea.getStaffId() != null) {
     sql.append(" and STAFF_ID=?");
   }
   if (staffWorkArea.getWorkAreaId() != null) {
     sql.append(" and WORK_AREA_ID=?");
   }
   if (staffWorkArea.getGrantor() != null) {
     sql.append(" and GRANTOR=?");
   }
   if (staffWorkArea.getAdminFlag() != null) {
     sql.append(" and ADMIN_FLAG=?");
   }
   if (staffWorkArea.getSts() != null) {
     sql.append(" and STS=?");
   }
   if (staffWorkArea.getStsDate() != null) {
     sql.append(" and STS_DATE=?");
   }
   if (staffWorkArea.getCreateDate() != null) {
     sql.append(" and CREATE_DATE=?");
   }
   Connection connection = null;
   PreparedStatement ps = null;
   ResultSet rs = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     int index = 1;
     if (staffWorkArea.getStaffWorkAreaId() != null) {
       ps.setString(index++, staffWorkArea.getStaffWorkAreaId());
     }
     if (staffWorkArea.getStaffId() != null) {
       ps.setString(index++, staffWorkArea.getStaffId());
     }
     if (staffWorkArea.getWorkAreaId() != null) {
       ps.setString(index++, staffWorkArea.getWorkAreaId());
     }
     if (staffWorkArea.getGrantor() != null) {
       ps.setString(index++, staffWorkArea.getGrantor());
     }
     if (staffWorkArea.getAdminFlag() != null) {
       ps.setString(index++, staffWorkArea.getAdminFlag());
     }
     if (staffWorkArea.getSts() != null) {
       ps.setString(index++, staffWorkArea.getSts());
     }
     if (staffWorkArea.getStsDate() != null) {
       ps.setDate(index++, staffWorkArea.getStsDate());
     }
     if (staffWorkArea.getCreateDate() != null) {
       ps.setDate(index++, staffWorkArea.getCreateDate());
     }
     rs = ps.executeQuery();
     results = (List) ResultSetUtil.convertToList(rs, StaffWorkAreaSVO.class);
   } catch (SQLException e) {
     throw new SysException("", "findByVO error..", e);
   } finally {
     try {
       if (rs != null) {
         rs.close();
       }
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
   return results;
 }
 public PagView findSysAreaConfigsByPage(SysAreaConfigMVO vo, HashSet set, PagInfo pagInfo)
     throws Exception {
   List results = null;
   StringBuffer sql = new StringBuffer("select");
   sql.append(
       " a.SYS_AREA_CONFIG_ID,a.CONFIG_ID,a.SP_AREA_ID,a.CUR_VALUE,a.VALUE_DESC,b.name,b.system_name,b.config_type ");
   sql.append(" from SYS_AREA_CONFIG a,sys_config b where 1=1 and a.config_id=b.config_id ");
   if (vo == null && set != null) {
     sql.append("and ( ");
     sql.append(
         ReflectUtil.getLatestHqlWhereInt(set, "a", "sys_area_config_id", "sysAreaConfigId"));
     sql.append(" ) ");
   }
   if (vo != null && set == null) {
     if (vo.getSysAreaConfigId() != null) {
       sql.append(" and a.SYS_AREA_CONFIG_ID=" + vo.getSysAreaConfigId());
     }
     if (vo.getConfigId() != null) {
       sql.append(" and a.CONFIG_ID=" + vo.getConfigId());
     }
     if (vo.getSpAreaId() != null) {
       sql.append(" and a.SP_AREA_ID=" + vo.getSpAreaId());
     }
     if (vo.getCurValue() != null) {
       sql.append(" and a.CUR_VALUE='" + vo.getCurValue() + "'");
     }
     if (vo.getValueDesc() != null) {
       sql.append(" and a.VALUE_DESC='%" + vo.getValueDesc() + "%'");
     }
     if (vo.getName() != null) {
       sql.append(" and b.name like '%" + vo.getName() + "%'");
     }
     if (vo.getConfigType() != null) {
       sql.append(" and b.config_type='" + vo.getConfigType() + "'");
     }
   }
   sql.append(" order by sys_area_config_id");
   Connection connection = null;
   PreparedStatement ps = null;
   ResultSet rs = null;
   PagView pagView = null;
   try {
     connection = ConnectionFactory.getConnection();
     ps = connection.prepareStatement(sql.toString());
     Sql sql2 = new Sql();
     sql2.setSql(sql.toString());
     sql2.log(SysAreaConfigMDAOImpl.class);
     pagView = PagUtil.InitPagViewJDBC(connection, sql2, pagInfo);
     pagView.getPagCount();
     rs = PagUtil.queryOracle(connection, sql2, pagInfo);
     results = (List) ResultSetUtil.convertToList(rs, SysAreaConfigMVO.class);
     pagView.setViewList(results);
   } catch (SQLException e) {
     throw new SysException("", "findByVO error..", e);
   } finally {
     try {
       if (rs != null) {
         rs.close();
       }
       if (ps != null) {
         ps.close();
       }
     } catch (SQLException e) {
     }
   }
   return pagView;
 }
  public PagView findByLocalNet(GenericVO svo, String localNetId, PagInfo pagInfo)
      throws AppException, SysException {
    SysAreaConfigMVO vo = (SysAreaConfigMVO) svo;
    List results = null;
    Sql sql = new Sql("select");
    sql.append(
        " a.SYS_AREA_CONFIG_ID,a.CONFIG_ID,a.SP_AREA_ID,a.CUR_VALUE,a.VALUE_DESC,b.name,b.system_name,b.config_type ");
    sql.append(
        " from SYS_AREA_CONFIG a,sys_config b where 1=1 and a.config_id=b.config_id  and b.config_type='L'");

    //		if (vo.getSysAreaConfigId() != null) {
    //			sql.append(" and a.SYS_AREA_CONFIG_ID=:sysAreaConfigId");
    //			sql.setInteger("sysAreaConfigId", StringUtil.toString(vo.getSysAreaConfigId()).trim());
    //		}

    if (vo.getSysAreaConfigId() != null) {
      sql.append(" and a.SYS_AREA_CONFIG_ID like :sysAreaConfigId");
      sql.setString(
          "sysAreaConfigId", "%" + StringUtil.toString(vo.getSysAreaConfigId()).trim() + "%");
    }

    if (vo.getConfigId() != null) {
      sql.append(" and b.CONFIG_ID like :configId");
      sql.setString("configId", "%" + vo.getConfigId() + "%");
    }
    if (vo.getSpAreaId() != null) {
      sql.append(" and a.SP_AREA_ID=:spAreaId");
      sql.setString("spAreaId", vo.getSpAreaId());
    }
    if (vo.getCurValue() != null) {
      sql.append(" and a.CUR_VALUE=:curValue");
      sql.setString("curValue", vo.getCurValue());
    }
    if (vo.getValueDesc() != null) {
      sql.append(" and a.VALUE_DESC like :valueDesc");
      sql.setString("valueDesc", "%" + vo.getValueDesc() + "%");
    }
    if (vo.getName() != null) {
      sql.append(" and b.name like :name");
      sql.setString("name", "%" + vo.getName() + "%");
    }
    if (vo.getConfigType() != null) {
      sql.append(" and b.config_type=:configType");
      sql.setString("configType", vo.getConfigType());
    }
    if (localNetId != null) {
      sql.append(" and a.sp_area_id=:spId");
      sql.setString("spId", localNetId);
    }
    sql.append(" union select ");
    sql.append(
        " a.SYS_AREA_CONFIG_ID,a.CONFIG_ID,a.SP_AREA_ID,a.CUR_VALUE,a.VALUE_DESC,b.name,b.system_name,b.config_type ");
    sql.append(
        " from SYS_AREA_CONFIG a,sys_config b,AREA C where 1=1 and a.config_id=b.config_id  and b.config_type='A' ");
    sql.append(" and c.area_id=a.sp_area_id and c.sts='A' ");

    //		if (vo.getSysAreaConfigId() != null) {
    //			sql.append(" and a.SYS_AREA_CONFIG_ID=:sysAreaConfigId");
    //			sql.setInteger("sysAreaConfigId", StringUtil.toString(vo.getSysAreaConfigId()).trim());
    //		}

    if (vo.getSysAreaConfigId() != null) {
      sql.append(" and a.SYS_AREA_CONFIG_ID like :sysAreaConfigId");
      sql.setString(
          "sysAreaConfigId", "%" + StringUtil.toString(vo.getSysAreaConfigId()).trim() + "%");
    }

    //		if (vo.getConfigId() != null) {
    //			sql.append(" and a.CONFIG_ID=:configId");
    //			sql.setInteger("configId", vo.getConfigId());
    //		}

    if (vo.getConfigId() != null) {
      sql.append(" and b.CONFIG_ID like :configId");
      sql.setString("configId", "%" + vo.getConfigId() + "%");
    }
    if (vo.getSpAreaId() != null) {
      sql.append(" and a.SP_AREA_ID=:spAreaId");
      sql.setString("spAreaId", vo.getSpAreaId());
    }
    if (vo.getCurValue() != null) {
      sql.append(" and a.CUR_VALUE=:curValue");
      sql.setString("curValue", vo.getCurValue());
    }
    if (vo.getValueDesc() != null) {
      sql.append(" and a.VALUE_DESC like :valueDesc");
      sql.setString("valueDesc", "%" + vo.getValueDesc() + "%");
    }
    if (vo.getName() != null) {
      sql.append(" and b.name like :name");
      sql.setString("name", "%" + vo.getName() + "%");
    }
    if (vo.getConfigType() != null) {
      sql.append(" and b.config_type=:configType");
      sql.setString("configType", vo.getConfigType());
    }
    if (localNetId != null) {
      sql.append(" and c.local_NET_ID=:localNetId");
      sql.setString("localNetId", localNetId);
    }
    sql.append(" union select ");
    sql.append(
        " a.SYS_AREA_CONFIG_ID,a.CONFIG_ID,a.SP_AREA_ID,a.CUR_VALUE,a.VALUE_DESC,b.name,b.system_name,b.config_type ");
    sql.append(
        " from SYS_AREA_CONFIG a,sys_config b,exch c where 1=1 and a.config_id=b.config_id  and b.config_type='A' ");
    sql.append(" and c.exch_id=a.sp_area_id and c.sts='A' ");

    //		if (vo.getSysAreaConfigId() != null) {
    //			sql.append(" and a.SYS_AREA_CONFIG_ID=:sysAreaConfigId");
    //			sql.setInteger("sysAreaConfigId", StringUtil.toString(vo.getSysAreaConfigId()).trim());
    //		}
    if (vo.getSysAreaConfigId() != null) {
      sql.append(" and a.SYS_AREA_CONFIG_ID like :sysAreaConfigId");
      sql.setString(
          "sysAreaConfigId", "%" + StringUtil.toString(vo.getSysAreaConfigId()).trim() + "%");
    }
    //		if (vo.getConfigId() != null) {
    //			sql.append(" and a.CONFIG_ID=:configId");
    //			sql.setInteger("configId", vo.getConfigId());
    //		}
    if (vo.getConfigId() != null) {
      sql.append(" and b.CONFIG_ID like :configId");
      sql.setString("configId", "%" + vo.getConfigId() + "%");
    }
    if (vo.getSpAreaId() != null) {
      sql.append(" and a.SP_AREA_ID=:spAreaId");
      sql.setString("spAreaId", vo.getSpAreaId());
    }
    if (vo.getCurValue() != null) {
      sql.append(" and a.CUR_VALUE=:curValue");
      sql.setString("curValue", vo.getCurValue());
    }
    if (vo.getValueDesc() != null) {
      sql.append(" and a.VALUE_DESC like :valueDesc");
      sql.setString("valueDesc", "%" + vo.getValueDesc() + "%");
    }
    if (vo.getName() != null) {
      sql.append(" and b.name like :name");
      sql.setString("name", "%" + vo.getName() + "%");
    }
    if (vo.getConfigType() != null) {
      sql.append(" and b.config_type=:configType");
      sql.setString("configType", vo.getConfigType());
    }
    if (localNetId != null) {
      sql.append(" and c.local_NET_ID=:localNetId");
      sql.setString("localNetId", localNetId);
    }
    sql.append(" union select ");
    sql.append(
        " a.SYS_AREA_CONFIG_ID,a.CONFIG_ID,a.SP_AREA_ID,a.CUR_VALUE,a.VALUE_DESC,b.name,b.system_name,b.config_type ");
    sql.append(
        " from SYS_AREA_CONFIG a,sys_config b,work_area c where 1=1 and a.config_id=b.config_id  and b.config_type='A' ");
    sql.append(" and c.work_area_id=a.sp_area_id and c.sts='A' ");

    //		if (vo.getSysAreaConfigId() != null) {
    //			sql.append(" and a.SYS_AREA_CONFIG_ID=:sysAreaConfigId");
    //			sql.setInteger("sysAreaConfigId", StringUtil.toString(vo.getSysAreaConfigId()).trim());
    //		}

    if (vo.getSysAreaConfigId() != null) {
      sql.append(" and a.SYS_AREA_CONFIG_ID like :sysAreaConfigId");
      sql.setString(
          "sysAreaConfigId", "%" + StringUtil.toString(vo.getSysAreaConfigId()).trim() + "%");
    }

    //		if (vo.getConfigId() != null) {
    //			sql.append(" and a.CONFIG_ID=:configId");
    //			sql.setInteger("configId", vo.getConfigId());
    //		}
    if (vo.getConfigId() != null) {
      sql.append(" and b.CONFIG_ID like :configId");
      sql.setString("configId", "%" + vo.getConfigId() + "%");
    }
    if (vo.getSpAreaId() != null) {
      sql.append(" and a.SP_AREA_ID=:spAreaId");
      sql.setString("spAreaId", vo.getSpAreaId());
    }
    if (vo.getCurValue() != null) {
      sql.append(" and a.CUR_VALUE=:curValue");
      sql.setString("curValue", vo.getCurValue());
    }
    if (vo.getValueDesc() != null) {
      sql.append(" and a.VALUE_DESC like :valueDesc");
      sql.setString("valueDesc", "%" + vo.getValueDesc() + "%");
    }
    if (vo.getName() != null) {
      sql.append(" and b.name like :name");
      sql.setString("name", "%" + vo.getName() + "%");
    }
    if (vo.getConfigType() != null) {
      sql.append(" and b.config_type=:configType");
      sql.setString("configType", vo.getConfigType());
    }
    if (localNetId != null) {
      sql.append(" and c.local_NET_ID=:localNetId");
      sql.setString("localNetId", localNetId);
    }

    Connection connection = null;
    ResultSet rs = null;
    PagView pagView = null;
    try {
      connection = ConnectionFactory.getConnection();
      sql.logPartition(null, this.getClass());
      pagView = PagUtil.InitPagViewJDBC(connection, sql, pagInfo);
      pagView.getPagCount();
      rs = PagUtil.queryOracle(connection, sql, pagInfo);
      results = (List) ResultSetUtil.convertToList(rs, SysAreaConfigMVO.class);
      pagView.setViewList(results);
    } catch (Exception e) {
      throw new SysException("", "findByVO error..", e);
    } finally {
      try {
        if (rs != null) {
          rs.close();
        }
      } catch (SQLException e) {
      }
    }
    return pagView;
  }