<!-- public abstract Employee findEmpById(Integer id); -->
<select id="findEmpById" resultType="com.mybatis.bean.Employee">
<!-- 使用include标签引用已经抽取的sql -->
select <include refid="selectemp"/> from employee where id = #{id}
</select>
<!--
sql 抽取可重用的sql片段,方便后面引用
1.sql抽取,经常查询的字段名,或者新增数据时使用的字段名抽取出来方便调用
2. 使用include标签来引用已经抽取的sql
-->
<sql id="selectemp">
id,name,money
</sql>