lxw
2023-10-30 145cab72eb66d59e951f542fcf97fd2ec74f8fe9
中-//32-BattTestDataStopMapper.xml;26行
6个文件已修改
48 ■■■■ 已修改文件
src/main/java/com/whyc/mapper/BattTestDataStopMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattTestDataStopService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/StandardFeatureCurveService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/SubTablePageInfoService.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattResDataMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattTestDataStopMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattTestDataStopMapper.java
@@ -14,7 +14,7 @@
    //查询最近一笔放电记录
    List<BattTestDataStop> getTestDataStop(Integer battGroupId, Date testStarttime);
    List<BattTestDataStop> getList(int battGroupId,int testRecordCount);
    //List<BattTestDataStop> getList(int battGroupId,int testRecordCount);
    Float calcAvgVol(Integer battGroupId, Integer testRecordCount);
}
src/main/java/com/whyc/service/BattTestDataStopService.java
@@ -4,6 +4,7 @@
import com.whyc.mapper.BattTestDataStopMapper;
import com.whyc.pojo.BattTestDataStop;
import com.whyc.pojo.BatttestdataInf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -17,11 +18,15 @@
    @Resource
    private BattTestDataStopMapper mapper;
    @Autowired
    private SubTablePageInfoService subService;
    /**计算落后信息
     * @param battTestDataInf*/
    public BatttestdataInf calcBehindInfo(BatttestdataInf battTestDataInf) {
        //筛选落后单体,计算总电压
        List<BattTestDataStop> stopList = mapper.getList(battTestDataInf.getBattGroupId(), battTestDataInf.getTestRecordCount());
        //List<BattTestDataStop> stopList = mapper.getList(battTestDataInf.getBattGroupId(), battTestDataInf.getTestRecordCount());
        List<BattTestDataStop> stopList = subService.getList(battTestDataInf.getBattGroupId(), battTestDataInf.getTestRecordCount());
        double realCap = 0;//实际容量
        double STDAH = 0;//标存容量
        int hourRate = 0;//小时率
src/main/java/com/whyc/service/StandardFeatureCurveService.java
@@ -551,7 +551,7 @@
        List list=subService.getList("tb_eleprice_1002");*/
        /*24
        int tableNum= subService.judgeTable_realdata("1000003_2020_12");*/
        /*29*/
        /*29
        BattRealdata realdata = new BattRealdata();
        realdata.setTableName("1000018_2023_09");
        realdata.setRecrodTime(date5);
@@ -560,7 +560,9 @@
        realdata.setRoteN(7);
        //List list=subService.searchMaxNum2(realdata);
        //int maxNum=subService.searchMaxNum(realdata);
        List list=subService.serchByCondition2(realdata);
        List list=subService.serchByCondition2(realdata);*/
        /*32*/
        List list= subService.getList(1000011,1);
        return  new Response().setII(1,true,list,null);
    }
}
src/main/java/com/whyc/service/SubTablePageInfoService.java
@@ -2500,4 +2500,31 @@
        });
        return list;
    }
    //32-BattTestDataStopMapper.xml;26行
    public List<BattTestDataStop> getList(int battGroupId,int testRecordCount){
        String sql="SELECT DISTINCT  battGroupId, test_curr, test_cap, mon_num, mon_vol " +
                "        FROM " +
                "            db_batt_testdata.tb_batttestdatastop_"+battGroupId+" " +
                "        WHERE " +
                "            test_record_count = "+testRecordCount+" " +
                "        AND data_available = 1";
        List<BattTestDataStop> list = sqlExecuteService.executeQuery_call(sql, new CallBack() {
            @Override
            public List getResults(ResultSet rs) throws SQLException {
                List<BattTestDataStop> list=new ArrayList<>();
                while (rs.next()){
                    BattTestDataStop ph=new BattTestDataStop();
                    ph.setBattGroupId(rs.getInt("battGroupId"));
                    ph.setTestCurr(rs.getFloat("test_curr"));
                    ph.setTestCap(rs.getFloat("test_cap"));
                    ph.setMonVol(rs.getFloat("mon_vol"));
                    ph.setMonNum(rs.getInt("mon_num"));
                    list.add(ph);
                }
                return list;
            }
        });
        return list;
    }
}
src/main/resources/mapper/BattResDataMapper.xml
@@ -7,7 +7,7 @@
    <select id="checkTable" resultType="java.lang.String">
        select TABLE_NAME from information_schema.TABLES t where t.TABLE_SCHEMA like "${dbName}" and t.TABLE_NAME like "${tableName}" limit 1
        select TABLE_NAME from information_schema.TABLES t where t.TABLE_SCHEMA like CONCAT('%',#{dbName},'%') and t.TABLE_NAME like CONCAT('%',#{tableName},'%') limit 1
    </select>
    <!--<select id="calcAvgVol" resultType="java.lang.Float">
        select avg(binary mon_vol) from db_batt_testdata.tb_battresdata_${battGroupId} where test_record_count= #{testRecordCount}
src/main/resources/mapper/BattTestDataStopMapper.xml
@@ -23,7 +23,7 @@
                where db_batt_testdata.tb_batttestdatastop_${battGroupId}.test_starttime=#{testStarttime}
                and db_batt_testdata.tb_batttestdatastop_${battGroupId}.data_available=1
    </select>
    <select id="getList" resultType="com.whyc.pojo.BattTestDataStop">
    <!--<select id="getList" resultType="com.whyc.pojo.BattTestDataStop">
        SELECT DISTINCT
            battGroupId, test_curr, test_cap, mon_num, mon_vol
        FROM
@@ -31,7 +31,7 @@
        WHERE
            test_record_count = #{testRecordCount}
        AND data_available = 1
    </select>
    </select>-->
    <select id="calcAvgVol" resultType="java.lang.Float">
        SELECT
            AVG(BINARY mon_vol) AS mon_avg