| | |
| | | String sTemp; |
| | | List<String> arraySQLVals= new ArrayList<String>(); |
| | | boolean bActiveCheckDBSchedule=true; |
| | | |
| | | |
| | | if(!jobOnLine(postsql, "nddcanton")&& bActiveCheckDBSchedule) |
| | | { |
| | | |
| | | return; |
| | | } |
| | | String strStep0SQLNDD_rt="truncate table ndd.typhoon_tr"; |
| | | |
| | | logger.info("begin nddxml to postsql"); |
| | | logger.info("getftpfile..."); |
| | | String[] xmls= getNDDStrings(info, "neighbor_affect_customers.xml") ; |
| | | |
| | | |
| | | logger.info(String.format("total %d file(s)",xmls.length)); |
| | | for(int iRow=0;iRow<xmls.length;iRow++) |
| | |
| | | t1= t1.substring(t1.length()-2); |
| | | String insertDBSQL=" insert into ndd.nddcanton_history (project_id,department_id,county_id,district_id,neighbor_id,affectcustomers,affectcustomersever"+ |
| | | ",yy,mm,dd,tt,ts_ser) values "; |
| | | String strStep1SQLNDD_rt="insert into ndd.typhoon_tr(dts,county_id,district_id,neighbor_id,c0,c1)"; |
| | | |
| | | |
| | | sqlExec(postsql,strStep0SQLNDD_rt,new String[]{}); |
| | | |
| | | for(int j=0;j<arraySQLVals.size();j++) |
| | | { |
| | | sqlExec(postsql,strStep1SQLNDD_rt+ |
| | | String.format(" values('%s',%s,%s,%s,%s,%s )", |
| | | yy+mm+dd+"."+t0+t1,county,district,neighbor,affectCustomers,affectCustomersEver |
| | | ),new String[]{} |
| | | ); |
| | | sqlExec(postsql,insertDBSQL + arraySQLVals.get(j)+ |
| | | String.format(",%s,%s,%s,'%s%s',%s)", |
| | | yy,mm,dd,t0,t1, |