deb02698c1f175a2027e47ea3a9d9a6f31c89883.svn-base 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package UIK.UIK09;
  2. import java.sql.SQLException;
  3. import java.text.DateFormat;
  4. import java.text.SimpleDateFormat;
  5. import java.util.Date;
  6. import CoreFS.SA01.CoreIComponent;
  7. import CoreFS.SA06.CoreReturnObject;
  8. public class UIK090020 extends CoreIComponent{
  9. public CoreReturnObject DoSelect(String ireg_datetime ) throws SQLException
  10. {
  11. CoreReturnObject cro = new CoreReturnObject();
  12. String sqlQuery = "select reg_id, reg_dtime, alter_dtime, sam_date, sam_time, sam_address, dis_fe, "
  13. + " dis_acid, reg_fe, reg_acid, new_cl, new_acid, acid_concent, fe_concent, cl_content, water "
  14. + " from tbs03_l2_inspection_snd where reg_dtime = '" + ireg_datetime + "'";
  15. cro = this.getDao("KgDao").ExcuteQuery(sqlQuery);
  16. return cro;
  17. }
  18. public CoreReturnObject DoUpdate(String reg_id, String reg_dtime, String sam_date, String sam_time, String sam_address,
  19. String dis_fe, String dis_acid, String reg_fe, String reg_acid, String new_cl,
  20. String new_acid, String acid_concent, String fe_concent, String cl_content, String water) throws SQLException
  21. {
  22. CoreReturnObject cro = new CoreReturnObject();
  23. String sqlQuery ="update tbs03_l2_inspection_snd set reg_id=?,alter_dtime=?,sam_date=?,sam_time=?,sam_address=?,"
  24. + "dis_fe=?,dis_acid=?,reg_fe=?,reg_acid=?,new_cl=?,"
  25. + "new_acid=?,acid_concent=?,fe_concent=?,cl_content=?,water=? where reg_dtime = '" + reg_dtime+ "'";
  26. DateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
  27. String alter_dtime = formatter.format(new Date());
  28. Object[] obj = new Object[]{ reg_id, alter_dtime, sam_date, sam_time, sam_address,
  29. dis_fe, dis_acid, reg_fe, reg_acid, new_cl,
  30. new_acid, acid_concent, fe_concent, cl_content, water };
  31. cro = this.getDao("KgDao").ExcuteNonQuery(sqlQuery,obj);
  32. return cro;
  33. }
  34. public CoreReturnObject DoInsert(String reg_id, String sam_date, String sam_time, String sam_address,
  35. String dis_fe, String dis_acid, String reg_fe, String reg_acid, String new_cl,
  36. String new_acid, String acid_concent, String fe_concent, String cl_content, String water) throws SQLException
  37. {
  38. CoreReturnObject cro = new CoreReturnObject();
  39. String sqlQuery = "insert into tbs03_l2_inspection_snd(fid, reg_id, reg_dtime, sam_date, sam_time, sam_address,"
  40. + " dis_fe, dis_acid, reg_fe, reg_acid, new_cl, "
  41. + " new_acid, acid_concent, fe_concent, cl_content, water )"
  42. + "values((select nvl(max(fid), 0) + 1 from tbs03_l2_inspection_snd),?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?)";
  43. DateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
  44. String reg_dtime = formatter.format(new Date());
  45. Object[] obj = new Object[]{ reg_id, reg_dtime, sam_date, sam_time, sam_address,
  46. dis_fe, dis_acid, reg_fe, reg_acid, new_cl,
  47. new_acid, acid_concent, fe_concent, cl_content, water };
  48. cro = this.getDao("KgDao").ExcuteNonQuery(sqlQuery,obj);
  49. return cro;
  50. }
  51. }