| | |
| | | tb_batt_devdischarge_CU+".num,"+tb_batt_devdischarge_CU+".dev_id,"+tb_batt_devdischarge_CU+".dev_name,"+tb_batt_devdischarge_CU+".dev_recordtime,"+tb_batt_devdischarge_CU+".dev_vol,"+tb_batt_devdischarge_CU+".dev_curr,"+tb_batt_devdischarge_CU+".dev_power,"+tb_batt_devdischarge_CU+".note, " +
|
| | | "DISTINCTbattinf.FBSDeviceName ";
|
| | | //连表条件
|
| | | String conditionSql=" from "+ tb_batt_devdischarge_CM +",(select DISTINCT(FBSdeviceid),FBSDeviceName from db_battinf.tb_battinf where stationid like ? ) as DISTINCTbattinf,"+tb_batt_devdischarge_CT+","+tb_batt_devdischarge_CU;
|
| | | String conditionSql=" from "+ tb_batt_devdischarge_CM +",(select DISTINCT(FBSdeviceid),FBSDeviceName from db_battinf.tb_battinf where stationid like ? and stationname1 like ? and stationname2 like ? ) as DISTINCTbattinf,"+tb_batt_devdischarge_CT+","+tb_batt_devdischarge_CU;
|
| | |
|
| | | String whereSql=" where DISTINCTbattinf.FBSdeviceid=tb_batt_devdischarge_CM.dev_id and " +
|
| | | "tb_batt_devdischarge_CT.dev_id=tb_batt_devdischarge_CM.dev_id and " +
|
| | |
| | | String endSql=" ORDER BY "+tb_batt_devdischarge_CM+".dev_id ,"+tb_batt_devdischarge_CM+".dev_recordtime ";
|
| | | sql=basesql+conditionSql+whereSql+numSql+endSql;
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationId()+"%",binf.getBattProductDate(),binf.getBattProductDate1()
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationId()+"%","%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%",binf.getBattProductDate(),binf.getBattProductDate1()
|
| | | ,binf.getMonNum(),binf.getMonCount() }, new CallBack() {
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | 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();
|