日期:2014-05-19 浏览次数:20851 次
<typeAlias alias="User" type="xxx.User" /> <typeAlias alias="Lend" type="xxx.Lend" /> <resultMap id="get-user-result" class="User"> <result property="uid" column="UID" /> <result property="uname" column="UNAME" /> <result property="uage" column="UAGE" /> <result property="usalary" column="USALARY" /> </resultMap> <resultMap id="get-lend-result" class="Lend"> <result property="lid" column="LID" /> <result property="luserid" column="LUSERID" select="getUserById"/> <result property="lmoney" column="LMONEY" /> <result property="lwarrant_userid" column="LWARRANT_USERID" select="getUserById"/> </resultMap> <select id="selectLendById" parameterClass="int" resultMap="get-lend-result"> select * from LEND where ID = #id# </select> <select id="getUserById" parameterClass="int" resultMap="get-user-result"> select * from USER where ID = #id# </select>