whycxzp
2025-04-14 8e85ad8e022d2885c410d0654bce08e2a392b08f
src/main/resources/mapper/BattTestInfMapper.xml
@@ -2,10 +2,10 @@
<!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.BattTestInf">
    <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_batt_testdata.tb_batttestdata_inf
        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
@@ -18,12 +18,12 @@
                and record_time>=#{recordStartTime} and record_time&lt;=#{recordEndTime}
            </if>
        </where>
        ORDER BY tb_batttestdata_inf.BattGroupId asc, test_starttime desc
        ORDER BY db_dis_batt.batt_test_inf.BattGroupId asc, test_starttime desc
    </select>
    <select id="searchDischargeTest_WJ" resultType="com.whyc.pojo.BattTestInf">
    <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_batt_testdata.tb_batttestdata_inf
        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
@@ -36,6 +36,30 @@
                and record_time&lt;#{recordStartTime}
            </if>
        </where>
        ORDER BY tb_batttestdata_inf.BattGroupId asc, test_starttime desc
        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,test_record_count,group_vol,test_curr,max_monvol,min_monvol,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
        and test_starttype=3 and test_type=3
        and (test_stoptype in (3, 4, 6)
        or (test_stoptype=2 and test_timelong>=7200))
        ORDER BY db_dis_batt.batt_test_inf.test_starttime desc
    </select>
</mapper>