mybatis <include refid=“xxx“></include>

<include refid="xxx"></include>使用在查询字段,多个select查询语句,可能查询的字段是相同的,就可以用这个标签把需要查询的字段抽出来。

<sql id="org_id">
        id,code,name,parent_code,parent_name
</sql> 
 

<select id="selectOrg" resultMap="orgMap" >
       select 
        <include refid="org_id" />
       from t_student
</select>

猜你喜欢

转载自blog.csdn.net/u011149152/article/details/134648331
今日推荐