iBATIS一对多映射之中继VO如下属性:
- public class RelayInfoVO {
- //中继信息
- private String bswitcherNames;//本端局
- private String dswitcherNames;//对端局
- private String signalStatCount;//信令数
- private String relayStatCount;//中继数
- private List signalVO;//信令List,用来存放信令List的
- ……
iBATIS一对多映射信令VO如下属性:
- public class SignalInfoVO {
- //信令信息
- private String bswitchers;//本端局
- private String dswitchers;//对端局
- private String signalType;//信令类型
- private String signalCount;//信令个数
- ……
iBATIS的XML如下配置:
注:为中继
VO,column="{bswitcherNames=bswitcherName,dswitcherNames=DSWITCHERNAME}" 是为select="getSignalInfo"所传递的参数。select="getSignalInfo"为所要调用的SELECT查询语句。
- ﹤resultMap id="RelayInfoVO-Result-list" class="com.harvest.ermis.rscount.domain.RelayInfoVO"﹥
- ﹤result property="bswitcherNames" column="BSWITCHERNAME" nullValue=""/﹥
- ﹤result property="dswitcherNames" column="DSWITCHERNAME" nullValue=""/﹥
- ﹤result property="signalStatCount" column="SIGNALSTATCOUNT" nullValue=""/﹥
- ﹤result property="relayStatCount" column="RELAYSTATCOUNT" nullValue=""/﹥
- ﹤result property="signalVO" column="{bswitcherNames=bswitcherName,dswitcherNames=DSWITCHERNAME}" select="getSignalInfo"/﹥
- ﹤/resultMap﹥
注:为信令VO
- ﹤resultMap id="SignalInfoVO-Result-list" class="com.harvest.ermis.rscount.domain.SignalInfoVO"﹥
- ﹤result property="bswitchers" column="BSWITCHERS" nullValue=""/﹥
- ﹤result property="dswitchers" column="DSWITCHERS" nullValue=""/﹥
- ﹤result property="signalType" column="SIGNALTYPE" nullValue=""/﹥
- ﹤result property="signalCount" column="SIGCOUTN" nullValue=""/﹥
- ﹤/resultMap﹥
- ﹤select id="getRSInfo" resultMap="RelayInfoVO-Result-list"﹥
- ……
- ﹤/select﹥
- elect id="getSignalInfo" resultMap="SignalInfoVO-Result-list"﹥
- select c.switcherName as BSWITCHERS,b.switcherName as DSWITCHERS,linkType as SIGNALTYPE,count(*) as SIGCOUTN
- where
- c.switcherName=#bswitcherNames#
- and b.switcherName=#dswitcherNames#
- group by b.switcherName,b.ATTACHING,c.switcherName,linktype
- order by c.switcherName,b.SWITCHERORDER,linktype
- ﹤/select﹥
iBATIS一对多映射的情况就介绍到这里,希望对你有所帮助。
【编辑推荐】