From 2eff7304df15f463dcd4563c0c62f4531bbef138 Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期四, 27 六月 2024 15:52:10 +0800 Subject: [PATCH] 电源ACDC --- src/main/resources/mapper/SinfBinfMapper.xml | 28 ++++++++++++++++++++++++---- 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/main/resources/mapper/SinfBinfMapper.xml b/src/main/resources/mapper/SinfBinfMapper.xml index 8795bf8..52a273a 100644 --- a/src/main/resources/mapper/SinfBinfMapper.xml +++ b/src/main/resources/mapper/SinfBinfMapper.xml @@ -1,17 +1,17 @@ <?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="sinfList" type="stationInf"> + <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="getAllSinfBinf" resultMap="sinfList"> - select * from db_batt.station_inf order by sinf_id asc + <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> @@ -19,4 +19,24 @@ 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> \ No newline at end of file -- Gitblit v1.9.1