一般情况下,利用mybatis 一对多使用collection,返回的是一个对象list,但是特殊情况下,只需要一个String类型的List。下面就是返回String类型List的resultMap
<resultMap id="patientPDFMap" type="com.huimu.common.entity.vo.screen.PatientPDFVo"> <result column="patientId" property="patientId"/> <result column="patientName" property="patientName"/> <result column="student_number" property="studentNumber"/> <result column="age" property="age"/> <result column="sex" property="sex"/> <result column="birthday" property="birthday"/> <result column="gradeName" property="gradeName"/> <result column="clazzName" property="clazzName"/> <collection property="examList" ofType="string"> <result column="examine_item"/> </collection> </resultMap>