<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.database.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%
//读取名字不符合的
String sql = " SELECT RYID,DLXM FROM SZXT_DL,SZLC_BZRYMB"
	   + " WHERE DLID=RYDLID AND DLXM<>RYDLXM AND RYZT=0 AND RYLX=0";
SzDataReader dataReader = new SzDataReader();
ResultSet rs = dataReader.readInfo(sql);
ArrayList list = new ArrayList();
int iColumnCount = 2;
String str_value[] = null;
  	try {  		
  		int i =0;
  
  		while (rs != null && rs.next()) {
  			str_value = new String[iColumnCount];
  			for (i = 0; i<iColumnCount; i++) {
  				str_value[i] = SzConvert.strReadData(rs.getString(i + 1));
  			}
  			list.add(str_value);
  		}
  		dataReader.closeAll();
  	} catch(Exception e) {  		
  	}

//更新
out.println("update counts ===" + list.size());
SzDataWriter dataWriter = new SzDataWriter();
for (int j = 0; j<list.size(); j++) {
  str_value = (String[])list.get(j);
  if (str_value == null || str_value[0].equals("")) {
    continue;
  }
  dataWriter.update("SZLC_BZRYMB","RYDLXM='" + str_value[1] + "'" ,"RYID=" + str_value[0]);
}

//用户删除的
dataWriter.update("delete from szlc_bzrymb where RYZT=0 AND RYLX=0 AND RYDLID NOT IN (SELECT DLID FROM SZXT_DL)");

dataWriter.closeAll();

out.println("<br>finish update ");

%>