| | |
| | | BattResData getMinInfo(Integer battGroupId, Integer testRecordCount); |
| | | //历史内阻数据查询 |
| | | List<BattResData> getResInfoByBattGroupId(@Param("battGroupId") int battGroupId); |
| | | //判断表是否存在 |
| | | String checkTable(@Param("dbName") String dbName,@Param("tableName") String tableName); |
| | | } |
| | |
| | | } |
| | | //历史内阻数据查询 |
| | | public Response getResInfoByBattGroupId(int battGroupId) { |
| | | String dbName="db_batt_testdata"; |
| | | String tableName="tb_battresdata_"+String.valueOf(battGroupId); |
| | | String name=mapper.checkTable(dbName,tableName); |
| | | PageInfo pageInfo=new PageInfo(); |
| | | if(name!=null){ |
| | | List<BattResData> list=mapper.getResInfoByBattGroupId(battGroupId); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | pageInfo.setList(list); |
| | | } |
| | | return new Response().set(1,pageInfo); |
| | | } |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.BattResDataMapper" > |
| | | |
| | | |
| | | <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> |
| | | <select id="calcAvgVol" resultType="java.lang.Float"> |
| | | select avg(binary mon_vol) from db_batt_testdata.tb_battresdata_${battGroupId} where test_record_count= #{testRecordCount} |
| | | </select> |