fg电池监控平台的达梦数据库版本
whycxzp
2024-11-15 50460fa38da2c448458b109b0a61c4dee52e4afd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.whyc.mapper.BatttestdataMapper">
    <delete id="deleteByTestRecordCount">
        delete
        from db_batt_testdata.tb_batttestdata_${battGroupId}
        where test_record_count = #{testRecordCount}
    </delete>
 
    <select id="findhistory" resultType="com.whyc.pojo.BatttestdataId">
        select distinct * from db_batt_testdata.tb_batttestdata_${battGroupId}
        <where>
            test_record_count=#{testRecordCount}
            and (record_num%#{roteN}=0 or test_timelong>=#{maxtime} or test_timelong&lt;= #{mintime})
            and data_available=1
        </where>
    </select>
 
    <select id="serchMaxAndMintime" resultType="com.whyc.pojo.BatttestdataId">
        SELECT MAX(record_num) as recordNum, MAX(test_timelong) as num, MIN(test_timelong) as testType
        FROM db_batt_testdata.tb_batttestdata_${battGroupId}
        WHERE test_record_count = #{testRecordCount}
          and data_available = 1 LIMIT 1
    </select>
    <resultMap id="infDoc" type="testDataInfDoc">
        <id property="num" column="num"></id>
        <result property="recordTime" column="record_time"></result>
        <result property="groupVol" column="group_vol"></result>
        <result property="testCurr" column="test_curr"></result>
        <result property="testCap" column="test_cap"></result>
        <result property="battGroupId" column="BattGroupId"></result>
        <result property="testRecordCount" column="test_record_count"></result>
        <result property="recordNum" column="record_num"></result>
        <result property="testTimelong" column="test_timelong"></result>
        <collection property="datalist" javaType="java.util.ArrayList"
                    ofType="com.whyc.pojo.BatttestdataId"
                    column="{battGroupId=BattGroupId,testRecordCount=test_record_count,recordNum=record_num}"
                    select="selectBatttestdataId"></collection>
    </resultMap>
    <select id="searchWordExport" resultMap="infDoc">
        SELECT distinct BattGroupId, record_time, test_record_count, group_vol, test_curr, test_cap,
        record_num,test_timelong
        FROM db_batt_testdata.tb_batttestdata_${battGroupId}
        WHERE test_record_count = #{testRecordCount}
        and record_num in
        <foreach collection="recordNumList" item="recordNum" separator="," open="(" close=")">
            #{recordNum}
        </foreach>
    </select>
 
    <select id="selectBatttestdataId" resultType="BatttestdataId">
        SELECT *
        FROM db_batt_testdata.tb_batttestdata_${battGroupId}
        WHERE test_record_count = #{testRecordCount}
          and record_num = #{recordNum}
    </select>
</mapper>