package UIK.UIK09; import java.sql.SQLException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import CoreFS.SA01.CoreIComponent; import CoreFS.SA06.CoreReturnObject; public class UIK090020 extends CoreIComponent{ public CoreReturnObject DoSelect(String ireg_datetime ) throws SQLException { CoreReturnObject cro = new CoreReturnObject(); String sqlQuery = "select reg_id, reg_dtime, alter_dtime, sam_date, sam_time, sam_address, dis_fe, " + " dis_acid, reg_fe, reg_acid, new_cl, new_acid, acid_concent, fe_concent, cl_content, water " + " from tbs03_l2_inspection_snd where reg_dtime = '" + ireg_datetime + "'"; cro = this.getDao("KgDao").ExcuteQuery(sqlQuery); return cro; } public CoreReturnObject DoUpdate(String reg_id, String reg_dtime, String sam_date, String sam_time, String sam_address, String dis_fe, String dis_acid, String reg_fe, String reg_acid, String new_cl, String new_acid, String acid_concent, String fe_concent, String cl_content, String water) throws SQLException { CoreReturnObject cro = new CoreReturnObject(); String sqlQuery ="update tbs03_l2_inspection_snd set reg_id=?,alter_dtime=?,sam_date=?,sam_time=?,sam_address=?," + "dis_fe=?,dis_acid=?,reg_fe=?,reg_acid=?,new_cl=?," + "new_acid=?,acid_concent=?,fe_concent=?,cl_content=?,water=? where reg_dtime = '" + reg_dtime+ "'"; DateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); String alter_dtime = formatter.format(new Date()); Object[] obj = new Object[]{ reg_id, alter_dtime, sam_date, sam_time, sam_address, dis_fe, dis_acid, reg_fe, reg_acid, new_cl, new_acid, acid_concent, fe_concent, cl_content, water }; cro = this.getDao("KgDao").ExcuteNonQuery(sqlQuery,obj); return cro; } public CoreReturnObject DoInsert(String reg_id, String sam_date, String sam_time, String sam_address, String dis_fe, String dis_acid, String reg_fe, String reg_acid, String new_cl, String new_acid, String acid_concent, String fe_concent, String cl_content, String water) throws SQLException { CoreReturnObject cro = new CoreReturnObject(); String sqlQuery = "insert into tbs03_l2_inspection_snd(fid, reg_id, reg_dtime, sam_date, sam_time, sam_address," + " dis_fe, dis_acid, reg_fe, reg_acid, new_cl, " + " new_acid, acid_concent, fe_concent, cl_content, water )" + "values((select nvl(max(fid), 0) + 1 from tbs03_l2_inspection_snd),?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?)"; DateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); String reg_dtime = formatter.format(new Date()); Object[] obj = new Object[]{ reg_id, reg_dtime, sam_date, sam_time, sam_address, dis_fe, dis_acid, reg_fe, reg_acid, new_cl, new_acid, acid_concent, fe_concent, cl_content, water }; cro = this.getDao("KgDao").ExcuteNonQuery(sqlQuery,obj); return cro; } }