2021
06-07
06-07
MyBatis使用Map与模糊查询的方法示例
当我们的实体类、或者数据库里的表、字段或者参数很多,这个时候考虑使用map一、使用map传参插入数据1.编写Dao接口/Mapper层使用Map做参数//Dao接口/Mapper层使用Map传参intaddUser2(Map<String,Object>map);2.编写Mapper.xml中的sql语句<!--传递map的key--><insertid="addUser2"parameterType="map">insertintofirend_mq.users(id,username,password)value(#{userid},#{name},#{pwd})</inser...
继续阅读 >