摘要: MyBatis 使用 Map 传递参数 MyBatis 中向 sql 传参时,如果需要多个参数,除了传递对象以使用其属性值,也可以使用 Map 传递多个参数,示例如下: 接口方法: int addUser2(Map<String,Object> map); 接口方法对应的Mapper: <inser 阅读全文
posted @ 2021-09-14 23:39 realzhangsan 阅读(2287) 评论(0) 推荐(0)
摘要: MyBatis 核心配置文件配置mapper MyBatis 核心配置文件配置mapper标签内容时有一点需要注意: 如果 resource 在 resources 文件夹下,则直接填写文件名,就像这样: <mappers> <mapper resource="BlogMapper.xml"/> < 阅读全文
posted @ 2021-09-14 21:41 realzhangsan 阅读(114) 评论(0) 推荐(0)