fe7b820883fbf2a845fe93ed1708ed6f120aa732.svn-base 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. package UIK.UIK05;
  2. import java.sql.SQLException;
  3. import java.text.SimpleDateFormat;
  4. import java.util.*;
  5. import CoreFS.SA01.CoreIComponent;
  6. import CoreFS.SA06.CoreReturnObject;
  7. public class UIK050001 extends CoreIComponent{
  8. public CoreReturnObject DoQuery() throws SQLException
  9. {
  10. CoreReturnObject cro = new CoreReturnObject();
  11. String str = "ROLLID,ROLL_STAT,ROLL_LOC,ROLL_DIAM,ROUGH,ROUGH_CL,YUAN_WC,ROLLSHA_WC,ROLL_WEAK,STAND_ID,ROLL_BUG,to_char(YARD_IN_TIME,'yyyy-mm-dd') YARD_IN_TIME,REG_MAN,to_char(LAST_DOWN_TIME,'yyyy-mm-dd') LAST_DOWN_TIME";
  12. String sqlQuery = "select " + str+" from C_TBK05_ROLL_STOCKWL ORDER BY ROLLID";
  13. cro = this.getDao("KgDao").ExcuteQuery(sqlQuery);
  14. return cro;
  15. }
  16. public CoreReturnObject DoInsert(ArrayList parms)
  17. {
  18. CoreReturnObject cro=new CoreReturnObject();
  19. String strSql="insert into C_TBK05_ROLL_STOCKWL(ROLLID,ROLL_STAT,ROLL_LOC,ROLL_DIAM,ROUGH,ROUGH_CL,YUAN_WC,ROLLSHA_WC,ROLL_WEAK,STAND_ID,ROLL_BUG,YARD_IN_TIME,REG_MAN,LAST_DOWN_TIME)values(?,?,?,?,?,?,?,?,?,?,?,to_date(?,'yyyy-mm-dd'),?,to_date(?,'yyyy-mm-dd'))";
  20. try {
  21. //服务执行普通的添加、修改、删除使用方法为ExcuteNonQuery
  22. cro=this.getDao("KgDao").ExcuteNonQuery(strSql, parms.toArray());//将ArrayList的parms转成Object[]的数组
  23. } catch (SQLException e) {
  24. // TODO Auto-generated catch block
  25. this.logAdapter.filelogger.logError(e.getMessage());
  26. cro=cro.SetErrInfo(e.getMessage());
  27. }
  28. return cro;
  29. }
  30. }