MyBatis中的refid、trim的使用
refid用作形容词,基本意思是“简单的,易懂的”,侧重于事物不复杂,易于迅速解决或很快被头脑接受
参考链接: https://blog.csdn.net/kylecoder/article/details/79466676
refid使用
1、首先定义一个sql标签,一定要定义唯一id
<sql id="Base_Column_List" >name,age</sql>
2、然后通过id引用
<select id="selectAll">
select
<include refid="Base_Column_List" /> // name,age将代替这段内容(代码重用)
from student
</select>
参考链接:
学而不思则罔,思而不学则殆!