方法一:起别名 对不一样的列名起别名 select brand_name as brandName from tbl_brand,让别名和实体类的属性名一样 * 缺点:每次查询都要定义一次别名
方法二:sql片段
<sql id="brand_column">
id, brand_name as brandName, company_name as companyName, ordered, description, status
</sql><select id="selectAll" resultType="brand">
select
<include refid="brand_column"/>
from tb_brand;</select>