![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis
No上善若水
知识是用来分享的。
展开
-
Mybatis在mapper.xml中写条件查询语句
做系统很多时候都会使用到查询功能,但有时只是想针对某列数据进行查询,下面是我在mapper.xml中的配置。主要说2个问题:1.使用where 1=1是因为oid可能为null,如果不加 1=1,那么就可能出现where and id==#{id,jdbcType=INTEGER}的问题,这样语句会出错,加了 1=1就可以避免这种问题。2.有时候数据可能为null,也有可能为"",如果只判断...原创 2020-01-10 18:35:58 · 13032 阅读 · 0 评论 -
IDEA中xml文件头报错URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)
在配置mybatis-config.xml的过程中,URL报错,如下图所示:解决方法:1.复制变红的URL:http://mybatis.org/dtd/mybatis-3-config.dtd2.点击File->Settings->languages & frameworks -> Schemas and DTDs3.点击右边的绿色+,把http://myba...原创 2019-09-02 09:57:34 · 267 阅读 · 0 评论 -
@Override is not allowed when implementing interface method
在使用IDEA的时候,遇到了@Override is not allowed when implementing interface method的问题,解决方法如下:在pom.xml中添加 <build> <finalName>mybatisdemo</finalName> <!--finalName可以改成你想要的名...原创 2019-09-02 11:27:55 · 125 阅读 · 0 评论