| | |
| | | String sql="";
|
| | | String basesql="select num,dev_id,dev_name,dev_recordtime,dev_electricity_CM,dev_electricity_CT,dev_electricity_CU,note ";
|
| | | String conditionSql=" from web_site.tb_batt_electricity " +
|
| | | ",(select DISTINCT(FBSdeviceid) from db_battinf.tb_battinf where stationid=? ) as DISTINCTbattinf " +
|
| | | ",(select DISTINCT(FBSdeviceid) from db_battinf.tb_battinf where stationid=? and stationname1 like ? and stationname2 like ? ) as DISTINCTbattinf " +
|
| | | "where DISTINCTbattinf.FBSdeviceid=tb_batt_electricity.dev_id " +
|
| | | "and to_days(tb_batt_electricity.dev_recordtime)>=to_days(?) and to_days(tb_batt_electricity.dev_recordtime)<=to_days(?) ";
|
| | | basesql+=conditionSql;//合连表条件
|
| | | String endSql=" ORDER BY dev_id ,dev_recordtime ";
|
| | | sql=basesql+endSql;//合成最后的sql
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationId(),binf.getBattProductDate(),binf.getBattProductDate1()}, new CallBack() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%",binf.getBattProductDate(),binf.getBattProductDate1()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|