27,579
社区成员
发帖
与我相关
我的任务
分享
StringBuffer sql = new StringBuffer("select dt.billno,sr.USALBILLNO from ");
sql.append(" scm_ownerchg_idtoid@db_cmsgz sr left join scm_salbill_hdr@db_cmsgz dt on sr.LSALBILLID=dt.id "); sql.append(" where sr.usalbillno in ");
sql.append(" (select billno from INPUT_CARTON_DTL_SZ where QinghuoFlag='Y' and is_insert is null) ");
System.out.println(this.cb.getContrlID()+"开始清洗数据....");
StringBuffer sql = new StringBuffer("select dt.billno,sr.USALBILLNO from ");
sql.append(" scm_ownerchg_idtoid@db_cmsgz sr left join scm_salbill_hdr@db_cmsgz dt on sr.LSALBILLID=dt.id ");
// sql.append(" scm_ownerchg_idtoid sr left join scm_salbill_hdr dt on sr.LSALBILLID=dt.id ");
sql.append(" where sr.usalbillno in ");
sql.append(" (select billno from INPUT_CARTON_DTL_SZ where QinghuoFlag='Y' and is_insert is null) ");
//查询出新旧单号
pst = localcon.prepareStatement(sql.toString());
rs = pst.executeQuery();
//更新新旧单号用的
StringBuffer upsql = new StringBuffer("update INPUT_CARTON_DTL_SZ ");
upsql.append(" set billno=? where billno=? and QinghuoFlag='Y'");
psup = localcon.prepareStatement(upsql.toString());
localcon.setAutoCommit(true);
while(rs.next()){
psup.setString(1, rs.getString("billno"));
psup.setString(2, rs.getString("USALBILLNO"));
psup.execute();
}
System.out.println(this.cb.getContrlID()+"清洗数据结束....");