![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Mybatis
任倩
这个作者很懒,什么都没留下…
展开
-
初学mybatis1
1>各种jar包的配置 (mybatis的jar包,连接数据库的jar包,日志包)2>配置全局的文件,config.xmlPUBLIC "-//mybatis.org//DTD Config 3.0//EN""http://mybatis.org/dtd/mybatis-3-config.dtd">原创 2017-09-22 08:47:58 · 265 阅读 · 0 评论 -
Mybatis中实体类与数据表的对应
先根据xxxMapper.xml中的sql语句判断是哪个数据表,然后又利用 resultMap中的type来判断是哪个实体类;然后在把 表的字段与实体类的字符对应即可原创 2018-03-08 00:00:22 · 3866 阅读 · 0 评论 -
Mybatis中使用对象传参
在ClassRoomMapper.java中//数量int selCRcount(@Param("croom") ClassRoom croom);在ClassRoomMapper.xml中<select id="selCRcount" resultType="int"> SELECT count(1) from classroom_info <trim prefix="w...原创 2018-03-11 00:16:51 · 29513 阅读 · 1 评论 -
MyBatis中的sql语句
模糊查询: LIKE CONCAT('%',#{参数},'%')<select id="getTeacherCount" resultType="int" parameterType="teacher">SELECT COUNT(1) from teacher_info where 1=1 <if test="name!=null">AND tname LIKE CO原创 2018-03-11 00:32:03 · 241 阅读 · 0 评论