//查询员工@Select("select * from emp where id = #{id}")publicEmpgetById(Integer id);//方案一:给字段起别名,让别名与实体类属性一致@Select("select id,username,password,name,gender,image,job,entrydate,"+" dept_id deptId,create_time createTime,update_time updateTime from emp where id = #{id}")publicEmpgetById(Integer id);//方案二:通过@Results @Result注解手动映射封装方案(繁琐,不用)@Results({@Result(column ="dept_id",property ="deptId"),@Result(column ="create_time",property ="createTime"),@Result(column ="update_time",property ="updateTime")})@Select("select * from emp where id = #{id}")publicEmpgetById(Integer id);//方案三:开启mybatis的驼峰命名自动映射开关 a column ---> aColumn 在application.properties增加语句//mybatis.configuration.map-underscore-to-camel-case=true