whycxzp
2025-06-10 73bb5617e6aeb4ee8f7dfd4ad54b61d477969d86
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
58
59
60
61
62
63
64
65
66
<?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.BattTestInfMapper">
 
    <select id="searchDischargeTest" resultType="com.whyc.pojo.db_dis_batt.BattTestInf">
        select
        battgroupid,test_curr,max_monvol,min_monvol,test_cap,test_starttime,record_time,test_timelong,test_stoptype
        from db_dis_batt.batt_test_inf
        <where>
            db_batt_testdata.tb_batttestdata_inf.data_available=1
            and test_starttype=3 and test_type=3
            and (test_stoptype in (3, 4, 6)
            or (test_stoptype=2 and test_timelong>=7200))
            <if test="battGroupId!=null">
                and battgroupid=#{battGroupId}
            </if>
            <if test="recordStartTime!=null and recordEndTime!=null">
                and record_time>=#{recordStartTime} and record_time&lt;=#{recordEndTime}
            </if>
        </where>
        ORDER BY db_dis_batt.batt_test_inf.BattGroupId asc, test_starttime desc
    </select>
    <select id="searchDischargeTest_WJ" resultType="com.whyc.pojo.db_dis_batt.BattTestInf">
        select
        battgroupid,test_curr,max_monvol,min_monvol,test_cap,test_starttime,record_time,test_timelong,test_stoptype
        from db_dis_batt.batt_test_inf
        <where>
            db_batt_testdata.tb_batttestdata_inf.data_available=1
            and test_starttype=3 and test_type=3
            and (test_stoptype in (3, 4, 6)
            or (test_stoptype=2 and test_timelong>=7200))
            <if test="battGroupId!=null">
                and battgroupid=#{battGroupId}
            </if>
            <if test="recordStartTime!=null">
                and record_time&lt;#{recordStartTime}
            </if>
        </where>
        ORDER BY db_dis_batt.batt_test_inf.BattGroupId asc, test_starttime desc
    </select>
    <select id="searchDischarge" resultType="com.whyc.pojo.db_dis_batt.BattTestInf">
        select
        battgroupid,test_curr,max_monvol,min_monvol,test_cap,test_starttime,record_time,test_timelong,test_stoptype
        from db_dis_batt.batt_test_inf
        <where>
            db_batt_testdata.tb_batttestdata_inf.data_available=1
            and test_starttype=3 and test_type=3
            and (test_stoptype in (3, 4, 6)
            or (test_stoptype=2 and test_timelong>=7200))
            <if test="battGroupId!=null">
                and battgroupid=#{battGroupId}
            </if>
        </where>
        ORDER BY db_dis_batt.batt_test_inf.BattGroupId asc, test_starttime desc
    </select>
    <select id="getDischargeList" resultType="com.whyc.pojo.db_dis_batt.BattTestInf">
        select
        binf_name as battGroupName,batt_test_inf.binf_id as battGroupId,mon_cap,mon_vol,test_record_count,group_vol,test_curr,max_monvol,min_monvol,min_monnum,max_monnum,test_cap,test_starttime,record_time,test_timelong,test_stoptype
        from db_dis_batt.batt_test_inf,db_batt.power_inf where db_batt.power_inf.binf_id=db_dis_batt.batt_test_inf.binf_id
        <if test="battGroupId!=null">
            and db_dis_batt.batt_test_inf.binf_id=#{battGroupId}
        </if>
        and test_type=3
        ORDER BY db_dis_batt.batt_test_inf.test_starttime desc
    </select>
</mapper>