| | |
| | | </delete> |
| | | |
| | | <select id="getListWithTestTime" resultType="com.whyc.pojo.BattgroupData"> |
| | | SELECT data.*,info.test_time FROM db_res_meter.tb_battgroup_data data,db_res_meter.tb_battgroup_info info |
| | | SELECT data.*,info.test_time FROM tb_battgroup_data data,tb_battgroup_info info |
| | | where data.battGroup_id = info.battGroup_id and data.battGroup_id = #{battGroupId} |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="selectMaxId" resultType="java.lang.Integer"> |
| | | select ifnull(max(battGroup_id),"100000001") from db_res_meter.tb_battgroup_info limit 1 |
| | | select ifnull(max(battGroup_id),"100000001") from tb_battgroup_info limit 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.DataBaseMapper"> |
| | | <insert id="insertTestData"> |
| | | insert into db_res_meter.tb_test_data(monvolstd,moncapstd,battproducer,battmodel,test_cap,mon_vol) values (12,150,"双登","150dt",149,10.5) |
| | | insert into tb_test_data(monvolstd,moncapstd,battproducer,battmodel,test_cap,mon_vol) values (12,150,"双登","150dt",149,10.5) |
| | | </insert> |
| | | |
| | | |
| | | <update id="createTestData"> |
| | | CREATE TABLE IF NOT EXISTS db_res_meter.tb_test_data ( |
| | | CREATE TABLE IF NOT EXISTS tb_test_data ( |
| | | num int(11) NOT NULL AUTO_INCREMENT, |
| | | monvolstd float NOT NULL DEFAULT '0', |
| | | moncapstd float NOT NULL DEFAULT '0', |
| | |
| | | </delete> |
| | | |
| | | <select id="selectMaxId" resultType="java.lang.Integer"> |
| | | select ifnull(max(file_id),"10001") from db_res_meter.tb_file_info limit 1 |
| | | select ifnull(max(file_id),"10001") from tb_file_info limit 1 |
| | | </select> |
| | | <select id="selectFileId" resultType="java.lang.Integer"> |
| | | select ifnull(file_id,0) from db_res_meter.tb_file_info |
| | | where station_id=#{stationId} and file_url=#{filePath} |
| | | select ifnull(file_id,0) from tb_file_info |
| | | where station_id=#{stationId} and file_url=#{filePath} limit 1 |
| | | </select> |
| | | <select id="selectListFiles" resultType="java.lang.Integer"> |
| | | select distinct file_id from db_res_meter.tb_file_info where station_id=#{stationId} |
| | | select distinct file_id from tb_file_info where station_id=#{stationId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectFileInStation" resultType="fileinfo"> |
| | | select distinct db_res_meter.tb_file_info.*,db_res_meter.tb_station_info.station_name |
| | | from db_res_meter.tb_file_info,db_res_meter.tb_station_info |
| | | select distinct tb_file_info.*,tb_station_info.station_name |
| | | from tb_file_info,tb_station_info |
| | | where tb_file_info.station_id=tb_station_info.station_id |
| | | order by tb_file_info.station_id asc |
| | | </select> |
| | |
| | | |
| | | |
| | | <select id="getMonVolStd" resultType="Integer"> |
| | | select distinct ROUND(batt_vol) from db_res_meter.tb_file_param |
| | | select distinct ROUND(batt_vol) from tb_file_param |
| | | </select> |
| | | <resultMap id="dataList" type="fileParam"> |
| | | <id column="num" property="num"></id> |
| | |
| | | </resultMap> |
| | | <select id="getDataByCondition" resultMap="dataList"> |
| | | select distinct tb_file_param.*,tb_station_info.station_name |
| | | from db_res_meter.tb_file_param,db_res_meter.tb_station_info,db_res_meter.tb_file_info |
| | | from tb_file_param,tb_station_info,tb_file_info |
| | | where tb_station_info.station_id=tb_file_info.station_id |
| | | and tb_file_param.file_id=tb_file_info.file_id |
| | | <if test="testTime1!=null"> |
| | |
| | | when 0 then '400000000' |
| | | else max(station_id) |
| | | end maxId |
| | | from db_res_meter.tb_station_info limit 1 |
| | | from tb_station_info limit 1 |
| | | </select> |
| | | <select id="selectIdByName" resultType="java.lang.Integer"> |
| | | select ifnull(station_id,0) from db_res_meter.tb_station_info where station_name=#{stationName} limit 1 |
| | | select ifnull(station_id,0) from tb_station_info where station_name=#{stationName} limit 1 |
| | | </select> |
| | | <select id="selectIdByName2" resultType="StationInfo"> |
| | | select distinct station_id,station_name from db_res_meter.tb_station_info where station_name1=#{stationName1} and station_name2=#{stationName2} |
| | | select distinct station_id,station_name from tb_station_info where station_name1=#{stationName1} and station_name2=#{stationName2} |
| | | </select> |
| | | <select id="selectIdByName3" resultType="StationInfo"> |
| | | select distinct station_id,station_name from db_res_meter.tb_station_info where station_name1=#{stationName1} and station_name2=#{stationName2} and station_name3=#{stationName3} |
| | | select distinct station_id,station_name from tb_station_info where station_name1=#{stationName1} and station_name2=#{stationName2} and station_name3=#{stationName3} |
| | | </select> |
| | | <select id="selectIdByName1" resultType="StationInfo"> |
| | | select distinct station_id,station_name from db_res_meter.tb_station_info where station_name1=#{stationName1} |
| | | select distinct station_id,station_name from tb_station_info where station_name1=#{stationName1} |
| | | </select> |
| | | <select id="getByFileId" resultType="com.whyc.pojo.StationInfo"> |
| | | SELECT si.* FROM db_res_meter.tb_battgroup_info bi,tb_station_info si where bi.station_id = si.station_id and bi.file_id = #{fileId} limit 1 |
| | | SELECT si.* FROM tb_battgroup_info bi,tb_station_info si where bi.station_id = si.station_id and bi.file_id = #{fileId} limit 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | </collection> |
| | | </resultMap> |
| | | <select id="getStation" resultMap="stationList"> |
| | | SELECT distinct station_name1 from db_res_meter.tb_station_info |
| | | SELECT distinct station_name1 from tb_station_info |
| | | </select> |
| | | |
| | | <resultMap id="name2List" type="StationName2"> |
| | |
| | | </collection> |
| | | </resultMap> |
| | | <select id="selectSName2" resultMap="name2List"> |
| | | SELECT distinct #{station1} as station1,station_name2 from db_res_meter.tb_station_info |
| | | SELECT distinct #{station1} as station1,station_name2 from tb_station_info |
| | | where station_name1=#{station1} |
| | | </select> |
| | | |
| | |
| | | </collection> |
| | | </resultMap> |
| | | <select id="selectSName3" resultMap="name3List"> |
| | | SELECT distinct #{station1} as station1, #{station2} as station2,station_name3,station_id from db_res_meter.tb_station_info |
| | | SELECT distinct #{station1} as station1, #{station2} as station2,station_name3,station_id from tb_station_info |
| | | where station_name1=#{station1} and station_name2=#{station2} |
| | | </select> |
| | | |
| | | <select id="selectFileName" resultType="fileName"> |
| | | SELECT distinct file_id,file_name,file_url from db_res_meter.tb_file_info |
| | | SELECT distinct file_id,file_name,file_url from tb_file_info |
| | | where station_id=#{stationId} |
| | | </select> |
| | | </mapper> |