05 2022 档案

摘要:@Select("select * from test where id=#{id}")Test GetById2(int id);无需在xml中添加,适合简单的SQL语句。 阅读全文
posted @ 2022-05-25 18:51 Xyang 阅读(17) 评论(0) 推荐(0) 编辑
摘要:1.SQL语句中特殊符号的处理,用纯文本区代替特殊字符。输入CD按回车可快速出现。 select * from test where id <![CDATA[ < ]]> #{id};代替 select * from test where id<#{id};2.添加 获取id返回值 <insert 阅读全文
posted @ 2022-05-25 18:48 Xyang 阅读(17) 评论(0) 推荐(0) 编辑
摘要:1.新建mapper接口,com.xx.mapper ,新建接口TestMapper 2.resources中 新建com/xx/mapper 文件夹 ,可以与1中的包名对应 。 新建 TestMapper.xml 3.TestMapper接口中实现相同的方法 List<Test> GetAll() 阅读全文
posted @ 2022-05-25 17:24 Xyang 阅读(26) 评论(0) 推荐(0) 编辑
摘要:1.pom.xm中添加依赖坐标 <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.5</version> </dependency> 2.mybatis-config.x 阅读全文
posted @ 2022-05-25 16:53 Xyang 阅读(18) 评论(0) 推荐(0) 编辑

hi