<!-- 一对多-->
<resultMap id="ss1" type="StudentInfo">
<result property="stuId" column="stuId"></result>
<result property="stuName" column="stuName"></result>
<result property="stuSex" column="stuSex"></result>
<result property="stuAge" column="stuAge"></result>
<result property="classIdStuId" column="classId_stuId"></result>
<result property="stuPassword" column="stuPassword"></result>
<association property="classInfo" javaType="ClassInfo">
<result property="classId" column="classId"></result>
<result property="className" column="className"></result>
</association>
</resultMap>
<select id="allStuClassName" resultMap="ss1">
select s.*,c.* from studentinfo s,classinfo c where s.classId_stuId = c.classId
</select>
Mybatis一对多
最新推荐文章于 2024-11-07 13:06:59 发布