DeptCodeManager.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * @(#)file DeptCodeManager.java
  3. * @(#)author chj
  4. * @(#)version 1.0
  5. * @(#)date 2014-06-24
  6. * @(#)since JDK1.6
  7. *
  8. * Copyright (c) www.udapsoft.co.kr, Inc.
  9. */
  10. package kr.co.udapsoft.common.code;
  11. import kr.co.hsnc.common.base.WAFLogger;
  12. import kr.co.hsnc.common.sql.RowSet;
  13. import kr.co.hsnc.common.sql.search.Search;
  14. import kr.co.hsnc.common.sql.search.SearchImpl;
  15. import kr.co.hsnc.common.sql.util.RowSetUtility;
  16. import kr.co.hsnc.common.util.ValueObject;
  17. /**
  18. * 분류코드/품목코드 DB 접근 Beans.
  19. *
  20. * @version 1.0
  21. */
  22. public class DeptCodeManager {
  23. public static String getDeptName(String dept_cd) throws Exception {
  24. DeptCodeManager deptCodeManager = new DeptCodeManager();
  25. return deptCodeManager.getDeptValueObject(dept_cd).get("DEPT_NM");
  26. }
  27. public static String getDeptShortName(String dept_cd) throws Exception {
  28. DeptCodeManager deptCodeManager = new DeptCodeManager();
  29. return deptCodeManager.getDeptValueObject(dept_cd).get("DEPT_INI");
  30. }
  31. public ValueObject getDeptValueObject(String dept_cd) throws Exception {
  32. String sqlstr = " SELECT DEPT_CD, DEPT_NM, DEPT_INI "
  33. + " FROM ACZ10100V "
  34. + " WHERE DEPT_CD = ? ";
  35. Search search = new SearchImpl();
  36. search.setStatement(sqlstr);
  37. search.addParameter(dept_cd);
  38. RowSet rowSet = search.execute();
  39. ValueObject valueObject = new ValueObject();
  40. if( rowSet != null && rowSet.size() > 0 )
  41. valueObject = RowSetUtility.getValueObject(rowSet.getRow(0));
  42. return valueObject;
  43. }
  44. }