星伟
2018-09-27 cac35d6a8bbf37e49507741b9df82aaa9c318422
设备用电量统计分析查询
2个文件已修改
8 ■■■■ 已修改文件
gx_tieta/src/com/fgkj/dao/impl/Batt_DevdischargeImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dao/impl/Batt_electricityImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dao/impl/Batt_DevdischargeImpl.java
@@ -95,7 +95,7 @@
        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 " +
@@ -122,7 +122,7 @@
        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();
gx_tieta/src/com/fgkj/dao/impl/Batt_electricityImpl.java
@@ -144,14 +144,14 @@
        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();