mybatis关联外键查询
<resultMap id="get-lend-result" class="Lend">
<result property="lid" column="LID" />
<result property="luserid" column="LUSERID" />
<result property="lmoney" column="LMONEY" />
<result property="lwarrant_userid" column="LWARRANT_USERID"/>
<association property="lendPerson" column="LUSERID" select="selectUserByOid"></association>
<association property="warrantPerson" column="LWARRANT_USERID" select="selectUserByOid"></association>
</resultMap>
在实体类中加两个属性:
private User lendPerson;
private User warrantPerson;