<?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.SinfBinfMapper">
|
<resultMap id="sinfList1" type="stationInf">
|
<id property="sinfId" column="sinf_id"></id>
|
<result property="sinfName" column="sinf_name"></result>
|
<result property="sinfIp" column="sinf_ip"></result>
|
<collection property="binfList" javaType="java.util.ArrayList" ofType="com.whyc.pojo.BattInf" column="{sinfId=sinf_id}" select="selectBinfList">
|
</collection>
|
</resultMap>
|
<select id="getAllSinfBinf1" resultMap="sinfList1">
|
select * from db_batt.station_inf where stype=1 or stype=0 order by sinf_id asc
|
</select>
|
|
<select id="selectBinfList" resultType="battInf">
|
select batt_inf.* from db_batt.batt_inf,db_batt.sinf_binf
|
<where>
|
batt_inf.binf_id=sinf_binf.binf_id
|
and sinf_binf.sinf_id=#{sinfId}
|
</where>
|
</select>
|
|
<resultMap id="sinfList2" type="stationInf">
|
<id property="sinfId" column="sinf_id"></id>
|
<result property="sinfName" column="sinf_name"></result>
|
<result property="sinfIp" column="sinf_ip"></result>
|
<collection property="pinfList" javaType="java.util.ArrayList" ofType="com.whyc.pojo.PowerInf" column="{sinfId=sinf_id}" select="selectPinfList">
|
</collection>
|
</resultMap>
|
<select id="getAllSinfBinf2" resultMap="sinfList2">
|
select * from db_batt.station_inf where stype=2 or stype=0 order by sinf_id asc
|
</select>
|
|
<select id="selectPinfList" resultType="powerInf">
|
select power_inf.* 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>
|
</select>
|
|
</mapper>
|