whycxzp
2025-03-25 8d76f32f53f818e9edd8ab81c61867bef6681519
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?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.StationInfMapper">
 
    <resultMap id="sinfList" type="StationInf">
        <id property="sinfId" column="sinf_id"></id>
        <result property="sinfName" column="sinf_name"></result>
        <collection property="pinfList" javaType="java.util.ArrayList" ofType="com.whyc.pojo.db_batt.PowerInf" column="{sinfId=sinf_id}" select="selectPinfList">
        </collection>
    </resultMap>
    <select id="getAllSinf" resultMap="sinfList">
        select * from db_batt.station_inf order by sinf_id asc
    </select>
 
    <select id="selectPinfList" resultType="powerInf">
        select power_inf.*,power_inf.binf_id as battGroupId,power_inf.binf_name as battGroupName from db_batt.power_inf,db_batt.sinf_pinf
        <where>
            power_inf.power_id=sinf_pinf.pinf_id
            and sinf_pinf.sinf_id=#{sinfId}
        </where>
        order by power_inf.power_id asc
    </select>
 
</mapper>