package com.mingrisoft.dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.mingrisoft.Item;
public static TbKhinfo getKhInfo(Item item) {
String where ="khname="+item.getName()+"";
if(item.getId()!=null)
where ="id="+item.getId()+"";
TbKhinfo info=new TbKhinfo();
ResultSet set=findForResultSet("select*from tb_khinfo where"+where);
try {
if(set.next()) {
info.setId(set.getString("id").trim());
info.setKhname(set.getString("khname").trim());
info.setJian(set.getString("jian").trim());
info.setAddress(set.getString("address").trim());
info.setBianma(set.getString("blanma").trim());
info.setFax(set.getString("fax").trim());
info.setHao(set.getString("hao").trim());
info.setLian(set.getString("lian").trim());
info.setLtel(set.getString("ltel").trim());
info.setMail(set.getString("mail").trim());
info.setTel(set.getString("tel").trim());
info.setXinhang(set.getString("xihang").trim());
}
}catch(SQLException e) {
e.printStackTrace();
}
return info;
}
}