这很有可能是因为:
1. 你的select statement没用resultMap,但用了resultClass
2. 而且你的select语句里没有使用 select
coloumn_name as
propertName 这种格式。 你可能省略了 as
propertName
另外,使用 "select
coloumn_name as
propertName"属于取巧的做法;官方文档建议用resultMap:
Using SQL aliases to map columns to properties saves defining a <resultMap> element, but there are limitations. There is no way to specify the types of the output columns (if needed), there is no way to automatically load related data such as complex properties, and there is a slight performance consequence from accessing the result metadata. Architecturally, using aliases this way mixes database logic with reporting logic, making the query harder to read and maintain. You can overcome these limitations with an explicit Result Map (Section 3.5).