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>

参考链接:

  1. https://blog.csdn.net/wt_better/article/details/80992014
  2. https://www.cnblogs.com/qiankun-site/p/5758924.html

posted @ 2020-11-25 10:55  Felix_Openmind  阅读(529)  评论(0编辑  收藏  举报