<resultMapid="SQuestion"type="SelectQuestion"><resultproperty="qid"column="qid"></result><resultproperty="putUser"column="name"></result><collectionproperty="selections"javaType="ArrayList"ofType="SelectionEntity"select="getSelectMsgById"column="qid"/></resultMap><selectid="getSelectMsgById"resultType="String">
select selection from toanswer.selection where qid=#{qid}
</select><selectid="getSelectQuestionByKeywords"resultMap="SQuestion">
SELECT * from view_select_question where question like concat('%',#{keywords},'%')
</select>
简单查询
<selectid="getDiscussByUid"resultType="DiscussSimpleEntity">
select did,content from discuss where uid=#{uid} and is_deleted=0;
</select>