package UIL.UIL01; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import UIB.COM.XmlSqlParsersFactory; import CoreFS.SA01.CoreIComponent; import CoreFS.SA06.CoreReturnObject; /** * 服务器进程监控 * * @author Administrator * */ public class UIL010010 extends CoreIComponent { /** * 查询服务器进程状态 * * @return * @throws SQLException */ public CoreReturnObject queryServerProgramStatus() throws SQLException { CoreReturnObject cro = new CoreReturnObject(); StringBuffer sqlBuffer = new StringBuffer(); sqlBuffer.append("select s.program,\n"); sqlBuffer.append(" status,CHANNELNAME,\n"); sqlBuffer .append(" decode(s.status, 0,'网络断开', 1,'网络正常', 2,'应用正常','') status_name,\n"); sqlBuffer .append(" s.srcnode,s.DESTNODE,round(s.modify_time - s.trans_dtime) DURATION,\n"); sqlBuffer.append(" s.curtel,\n"); sqlBuffer.append(" s.sndbytes,s.rcvbytes\n"); sqlBuffer.append(" from tbs01_com_status s\n"); cro = this.getDao("KgDao").ExcuteQuery(sqlBuffer.toString()); return cro; } public CoreReturnObject queryprinter() throws SQLException { CoreReturnObject cro = new CoreReturnObject(); StringBuffer sqlBuffer = new StringBuffer(); sqlBuffer.append("select t.OLD_SAMPL_NO,t.STL_GRD,t.T_K, T.ORD_NO,O.FAC_STL_GRD,t.ACT_WGT,t.SPEC_ABBSYM,SUBSTR(T3.SLAB_NO, 1, 10) CHARGE_NO," + "T3.MILL_DTIME,(SELECT A.CUST_NM FROM TBZ00_CUSTOMER A WHERE A.CUST_CD = T1.ORDCUST_CD) ORDCUST_CD," + "PKG_QUALITY_COMM.FZ00_COMM('A01007', t2.ORD_USE_TP) ORD_USE_TP " + "from tbh06_l1_send_mark t,tbb01_ord_head t2,tbe02_ord_prc t1,tba01_ord_line O,TBH02_COIL_COMM T3 " + "where t.MSG_FLAG = 'N' and t3.ORD_NO = t1.ORD_NO and t1.ORD_NO=O.ord_no and T1.ORD_SEQ = O.ORD_SEQ and t3.ORD_NO = t2.ORD_NO AND T3.ORD_SEQ = T1.ORD_SEQ" + " AND T3.ORD_SEQ = T2.ORD_SEQ " + "AND T.OLD_SAMPL_NO = T3.OLD_SAMPL_NO " + " ORDER BY T.SEQ_NO DESC"); //sqlBuffer.append(" COILTHICK\n"); //sqlBuffer.append(" from L2_CALTHKDATA WHERE FLAG='4'\n"); cro = this.getDao("KgDao").ExcuteQuery(sqlBuffer.toString()); return cro; } public CoreReturnObject queryprintING() throws SQLException { CoreReturnObject cro = new CoreReturnObject(); StringBuffer sqlBuffer = new StringBuffer(); sqlBuffer.append("select t.OLD_SAMPL_NO,t.STL_GRD,t.T_K, T.ORD_NO,O.FAC_STL_GRD,t.ACT_WGT,t.SPEC_ABBSYM,SUBSTR(T3.SLAB_NO, 1, 10) CHARGE_NO," + "T3.MILL_DTIME,(SELECT A.CUST_NM FROM TBZ00_CUSTOMER A WHERE A.CUST_CD = T1.ORDCUST_CD) ORDCUST_CD," + "PKG_QUALITY_COMM.FZ00_COMM('A01007', t2.ORD_USE_TP) ORD_USE_TP " + "from tbh06_l1_send_mark t,tbb01_ord_head t2,tbe02_ord_prc t1,tba01_ord_line O,TBH02_COIL_COMM T3 " + "where t.MSG_FLAG = 'C' and t3.ORD_NO = t1.ORD_NO and t1.ORD_NO=O.ord_no and T1.ORD_SEQ = O.ORD_SEQ and t3.ORD_NO = t2.ORD_NO AND T3.ORD_SEQ = T1.ORD_SEQ" + " AND T3.ORD_SEQ = T2.ORD_SEQ " + "AND T.OLD_SAMPL_NO = T3.OLD_SAMPL_NO " + "AND SYSDATE - TO_DATE(SUBSTR(T.MILL_DTIME, 1, 8), 'YYYY-mm-dd') < 3" + " ORDER BY T.SEQ_NO DESC"); //sqlBuffer.append(" COILTHICK\n"); //sqlBuffer.append(" from L2_CALTHKDATA WHERE FLAG='4'\n"); cro = this.getDao("KgDao").ExcuteQuery(sqlBuffer.toString()); return cro; } public CoreReturnObject updateprinter(String COILNO) throws SQLException { CoreReturnObject cro = new CoreReturnObject(); StringBuffer sqlQuery = new StringBuffer(); sqlQuery.append("update tbh06_l1_send_mark t set t.MSG_FLAG='C' WHERE T.OLD_SAMPL_NO=?"); //String sqlQuery ="update tbh06_l1_send_mark t set t.MSG_FLAG='C' WHERE T.OLD_SAMPL_NO=?"; cro = this.getDao("KgDao").ExcuteNonQuery(sqlQuery.toString(), new Object[]{ COILNO }); return cro; } }