| | |
| | | import java.sql.Connection; |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fgkj.dao.BaseDAO; |
| | |
| | | @Override |
| | | public boolean add(Object obj) { |
| | | Batt_replace re=(Batt_replace) obj; |
| | | String sql=" insert into web_site.tb_batt_replace(stationid,replaced_producer,replaced_moncapstd,replaced_monvolstd,replaced_moncount,replaced_uid,replaced_time,replaced_reason,replace_date) values(?,?,?,?,?,?,?,?,?) "; |
| | | String sql=" insert into web_site.tb_batt_replace(stationid,replaced_producer,replaced_moncapstd,replaced_monvolstd,replaced_moncount,replaced_uid,replaced_time,replaced_reason,replace_date,GroupIndexInFBSDevice) values(?,?,?,?,?,?,?,?,?,?) "; |
| | | boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[] {re.getStationid(),re.getReplaced_producer(),re.getReplaced_moncapstd(),re.getReplaced_monvolstd(),re.getReplaced_moncount() |
| | | ,re.getReplaced_uid(),re.getReplaced_time(),re.getReplaced_reason(),re.getReplace_date()}); |
| | | ,re.getReplaced_uid(),re.getReplaced_time(),re.getReplaced_reason(),re.getReplace_date(),re.getGroupIndexInFBSDevice()}); |
| | | return bl; |
| | | } |
| | | //修改机房电池更改记录 |
| | |
| | | Connection conn=DBUtil.getConn(); |
| | | String sql=" select SQL_CALC_FOUND_ROWS distinct tb_batt_replace.num, tb_batt_replace.stationid,replaced_producer,replaced_moncapstd,replaced_monvolstd" |
| | | + ",replaced_moncount,replaced_uid,replaced_time,replaced_reason,replace_date " |
| | | + ",db_battinf.tb_battinf.stationname " |
| | | + ",db_battinf.tb_battinf.stationname,db_battinf.tb_battinf.battgroupid,db_battinf.tb_battinf.battgroupname,db_battinf.tb_battinf.GroupIndexInFBSDevice " |
| | | + " from db_battinf.tb_battinf,web_site.tb_batt_replace " |
| | | + " where db_battinf.tb_battinf.stationid=tb_batt_replace.stationid " |
| | | + " and db_battinf.tb_battinf.GroupIndexInFBSDevice=tb_batt_replace.GroupIndexInFBSDevice " |
| | | + " and stationname1 like ? and stationname2 like ? and stationname5 like ? and tb_batt_replace.stationid like ? " |
| | | + " and replace_date>=? and replace_date<=? " |
| | | + " order by stationid "; |
| | | String limitSql=" limit ?,? "; |
| | | sql+=limitSql; |
| | | //sssSystem.out.println(sql); |
| | | List<Batt_replace> list=DAOHelper.executeQueryLimit(sql, conn, new Object [] {"%"+breplace.getStationname1()+"%","%"+breplace.getStationname2()+"%","%"+breplace.getStationname5()+"%","%"+breplace.getStationid()+"%" |
| | | ,breplace.getReplace_date(),breplace.getReplace_date1(),(p.getPageCurr() - 1)* p.getPageSize(),p.getPageSize() }, new CallBack() { |
| | | |
| | |
| | | re.setReplaced_uname((new User_infImpl()).changeUidToUname(rs.getInt("replaced_uid"))); |
| | | re.setReplaced_reason(rs.getString("replaced_reason")); |
| | | re.setReplace_date(rs.getDate("replace_date")); |
| | | re.setBattgroupid(rs.getString("battgroupid")); |
| | | re.setBattgroupname(rs.getString("battgroupname")); |
| | | re.setGroupIndexInFBSDevice(rs.getInt("groupIndexInFBSDevice")); |
| | | Page p=new Page(); |
| | | re.setPage(p); |
| | | list.add(re); |
| | |
| | | // TODO Auto-generated method stub |
| | | return null; |
| | | } |
| | | public static void main(String[] args) { |
| | | public static void main(String[] args) throws ParseException { |
| | | Batt_replaceImpl bimpl=new Batt_replaceImpl(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date date1 = sdf.parse("2000-01-01"); |
| | | Date date2 = sdf.parse("2050-01-01"); |
| | | Batt_replace re=new Batt_replace(); |
| | | re.setStationid("42000603"); |
| | | re.setStationid(""); |
| | | re.setStationname1(""); |
| | | re.setStationname2(""); |
| | | re.setStationname5(""); |
| | | re.setReplace_date(date1); |
| | | re.setReplace_date1(date2); |
| | | Page p=new Page(); |
| | | p.setPageCurr(1); |
| | | p.setPageSize(10); |
| | |
| | | public class Batt_replace implements Serializable{ |
| | | private int num; |
| | | private String stationid; |
| | | private String battgroupid; |
| | | private String stationname; |
| | | private String stationname1; |
| | | private String stationname2; |
| | | private String stationname5; |
| | | private String battgroupname; |
| | | private int GroupIndexInFBSDevice; |
| | | private String replaced_producer; |
| | | private int replaced_moncapstd; |
| | | private float replaced_monvolstd; |
| | |
| | | public void setReplace_date1(Date replace_date1) { |
| | | this.replace_date1 = replace_date1; |
| | | } |
| | | |
| | | public String getBattgroupid() { |
| | | return battgroupid; |
| | | } |
| | | public void setBattgroupid(String battgroupid) { |
| | | this.battgroupid = battgroupid; |
| | | } |
| | | |
| | | public String getBattgroupname() { |
| | | return battgroupname; |
| | | } |
| | | public void setBattgroupname(String battgroupname) { |
| | | this.battgroupname = battgroupname; |
| | | } |
| | | public int getGroupIndexInFBSDevice() { |
| | | return GroupIndexInFBSDevice; |
| | | } |
| | | public void setGroupIndexInFBSDevice(int groupIndexInFBSDevice) { |
| | | GroupIndexInFBSDevice = groupIndexInFBSDevice; |
| | | } |
| | | @Override |
| | | public String toString() { |
| | | return "Batt_replace [num=" + num + ", stationid=" + stationid |
| | | + ", stationname=" + stationname + ", stationname1=" |
| | | + stationname1 + ", stationname2=" + stationname2 |
| | | + ", stationname5=" + stationname5 + ", replaced_producer=" |
| | | + replaced_producer + ", replaced_moncapstd=" |
| | | + replaced_moncapstd + ", replaced_monvolstd=" |
| | | + replaced_monvolstd + ", replaced_moncount=" |
| | | + replaced_moncount + ", replaced_uid=" + replaced_uid |
| | | + ", replaced_uname=" + replaced_uname + ", replaced_time=" |
| | | + replaced_time + ", replaced_time1=" + replaced_time1 |
| | | + ", replaced_reason=" + replaced_reason + ", note=" + note |
| | | + ", page=" + page + ", replace_date=" + replace_date |
| | | + ", replace_date1=" + replace_date1 + "]"; |
| | | + ", battgroupid=" + battgroupid + ", stationname=" |
| | | + stationname + ", stationname1=" + stationname1 |
| | | + ", stationname2=" + stationname2 + ", stationname5=" |
| | | + stationname5 + ", battgroupname=" + battgroupname |
| | | + ", GroupIndexInFBSDevice=" + GroupIndexInFBSDevice |
| | | + ", replaced_producer=" + replaced_producer |
| | | + ", replaced_moncapstd=" + replaced_moncapstd |
| | | + ", replaced_monvolstd=" + replaced_monvolstd |
| | | + ", replaced_moncount=" + replaced_moncount |
| | | + ", replaced_uid=" + replaced_uid + ", replaced_uname=" |
| | | + replaced_uname + ", replaced_time=" + replaced_time |
| | | + ", replaced_time1=" + replaced_time1 + ", replaced_reason=" |
| | | + replaced_reason + ", note=" + note + ", page=" + page |
| | | + ", replace_date=" + replace_date + ", replace_date1=" |
| | | + replace_date1 + "]"; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | |
| | | } |