mysql语法中not in会把null值过滤掉
null在SQL中表示“未知”或“不存在”,所以not in会认为null是一个具体的值,需要被排除。 在这个查询中,所有的column列为null值得都会被排除。 select *from tempwhere column not in ('value1', 'value2' null); 如果不希望not in过滤null值,可以使用 not in 结合 or from tempwhere column not in ('value1', 'value2') or column is null;
基本的ResultMap
在 MyBatis 中,resultMap用来将数据库查询结果映射到 Java 对象。定义了如何将 SQL 查询结果的列与 Java 对象的属性进行映射。它支持复杂的映射关系,如一对多、多对一等。 基本的ResultMap假设有一个User类: class User { private Long id; private String username;} <resultMap id="userResultMap" type="User"> <id property="id" column="user_id"/> <result property="username"...