1.Mybatis的本质是JDBC,但是不需要关注JDBC,只需要关注SQL语句.
2.SqlSession
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530222226805-1727507806.png)
3. SqlSession操作数据库的常用方法有:
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530222428109-1159910272.png)
4.SqlSessionFactory
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530222503402-893875564.png)
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530222524650-1717185938.png)
5.SqlSessionFactoryBuilder
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530222550503-858935992.png)
6.SqlMapConfig.xml中配置的内容和顺序如下:
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530222704832-1600519967.png)
7.可以在SqlMapConfig.xml中引入properties文件的配置信息,实现配置的热插拔效果。例如:
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530222748623-1794178486.png)
8.在SqlMapConfig.xml中引入jdbc.properties
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530222840913-1719274632.png)
9.加载顺序
10.typeAlias类型别名
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530223016117-1248516763.png)
11.![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530223540674-1401198708.png)
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530223600503-401748008.png)
12.在SqlMapConfig.xml中给一个类指定别名
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530223636943-1780976380.png)
在映射配置文件中使用类型别名
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530223723507-1994235591.png)
在SqlMapConfig.xml中为一个package下所有类注册别名
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530223744773-2078024830.png)
在映射配置文件中使用类型别名
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530223806480-921771003.png)
13.<mapper resource=""/>
用于指定映射配置文件xml的路径,支持xml开发方式,例如:
<mapper resource="com/itheima/dao/UserDao.xml"/>
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530223849246-428639962.png)
<mapper class=""/>
用于指定映射器接口的全限定类名,支持XML开发和注解开发,例如:
<mapper class="com.itheima.dao.UserDao"/>
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530223932911-426030176.png)
<package name=""/>
用于指定映射器接口的全限定类名,支持XML开发和注解开发,例如:
<mapper class="com.itheima.dao.UserDao"/>
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530223950875-459785528.png)
14.Mybatis的事务
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224059397-2050438279.png)
15.事务的隔离级别
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224121133-1089921631.png)
16.==Mybatis动态SQL==
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224152282-1034262058.png)
动态SQL的标签应用
if标签,语法介绍
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224240353-375357549.png)
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224315567-761483923.png)
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224356688-1724317112.png)
<where>
标签语法介绍
<where></where>
标签代替where 1=1
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224440255-285263568.png)
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224448683-959782417.png)
<foreach>
标签语法介绍
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224507845-559426714.png)
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224527969-1015477550.png)
<sql>
标签语法介绍
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224631694-1583637607.png)
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224701764-847833296.png)
17. 模糊查询
使用#{}方式进行模糊查询
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224811595-1763643485.png)
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224824871-798156939.png)
使用${value}方式进行模糊查询
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224839786-229233393.png)
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224850285-888914688.png)
18. ==#{}和${value}的区别==
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224907535-1543477626.png)
19. 查询数量(聚合函数)
![](https://img2018.cnblogs.com/blog/1641319/201905/1641319-20190530224934312-2026475509.png)
20.resulType: resultType是查询select标签上才有的,用来设置查询的结果集要封装成什么类型的