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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?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.DevLithiumInfMapper">
 
    <select id="getAllInf" resultType="com.whyc.pojo.db_lithium_ram_db.DevLithiumInf">
        select * from db_lithium_ram_db.tb_dev_inf
        <where>
            dev_type=#{dto.devType}
            <if test="dto.devOnline!=null">
                and dev_online=#{dto.devOnline}
            </if>
            <if test="dto.startTime!=null">
                and create_time>=#{dto.startTime}
            </if>
            <if test="dto.endTime!=null">
                and create_time&lt;=#{dto.endTime}
            </if>
            and dev_id in (
            SELECT distinct dev_id from db_user.tb_battgroup_baojigroup,db_user.tb_battgroup_usr
            <where>
                tb_battgroup_baojigroup.baoji_group_id=tb_battgroup_usr.baoji_group_id
                <if test="dto.uid!=null">
                    and uid=#{dto.uid}
                </if>
            </where>
            )
        </where>
    </select>
    <select id="getMaxDevId" resultType="java.lang.Integer">
        select max(dev_id) from db_lithium_ram_db.tb_dev_inf
        <where>
            dev_type=#{devType}
        </where>
        limit 1
    </select>
    <select id="getLine" resultType="com.whyc.pojo.db_lithium_ram_db.DevLithiumInf">
        select * from db_lithium_ram_db.tb_dev_inf
        <where>
         dev_id in (
        SELECT distinct dev_id from db_user.tb_battgroup_baojigroup,db_user.tb_battgroup_usr
        <where>
            tb_battgroup_baojigroup.baoji_group_id=tb_battgroup_usr.baoji_group_id
            <if test="uid!=null">
                and uid=#{uid}
            </if>
        </where>
        )
        </where>
    </select>
 
    <select id="getDevType" resultType="com.whyc.pojo.db_lithium_ram_db.DevLithiumInf">
        select * from db_lithium_ram_db.tb_dev_inf
        <where>
            dev_type=#{devType}
            and dev_id in (
            SELECT distinct dev_id from db_user.tb_battgroup_baojigroup,db_user.tb_battgroup_usr
            <where>
                tb_battgroup_baojigroup.baoji_group_id=tb_battgroup_usr.baoji_group_id
                <if test="uid!=null">
                    and uid=#{uid}
                </if>
            </where>
            )
        </where>
    </select>
    <select id="getDevStaticByType" resultType="com.whyc.pojo.db_lithium_ram_db.DevLithiumInf">
        select * from db_lithium_ram_db.tb_dev_inf
        <where>
            dev_id in (
            SELECT distinct dev_id from db_user.tb_battgroup_baojigroup,db_user.tb_battgroup_usr
            <where>
                tb_battgroup_baojigroup.baoji_group_id=tb_battgroup_usr.baoji_group_id
                <if test="uid!=null">
                    and uid=#{uid}
                </if>
            </where>
            )
        </where>
    </select>
 
</mapper>