
mybatis
小汤圆的爸比
这个作者很懒,什么都没留下…
展开
-
Mybatis MySQL 获取自动增长主键
有两种方式第一种: SELECT LAST_INSERT_ID() AS id insert into category(id, user_name, password,age) values (#{id,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCH转载 2016-12-13 14:53:10 · 4158 阅读 · 0 评论 -
mybatis批量插入
已测试通过,记录下来,防止忘记方法一: SELECT CURRENT_TIMESTAMP() insert into user_t (id, user_name, password,age) values ( #{item.id,jdbcType=INTEGER}, #{item.userName,jdbcType=VARCHAR}, #{原创 2016-12-15 23:58:21 · 237 阅读 · 0 评论 -
mybatis+spring junit单元测试
spring+mybatis 进行单元测试,今天学习了一下,记录下来参考来源:点击打开链接测试代码:public class TestUser { IUserService userService = null; @Before public void init() { ApplicationContext ac = new ClassPathXmlAppli转载 2016-12-16 21:45:17 · 945 阅读 · 0 评论 -
mybatis注意事项
1.dao层接口 只有一个参数 且没有绑定@Param时getSectionListByTargetId(String target)xml test要这样<if test="_parameter != null and _parameter != ''"> </if>不要使用param12.dao层接口 只有一个参数 且绑定@Par...原创 2018-12-12 13:38:58 · 284 阅读 · 1 评论