<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="com.hh.mapper.BrandMapper"> <!-- 得到返回结果,数据库中的字段与pojo中的字段不匹配进行映射--> <resultMap id="brandResult" type="brand"> <result column="brand_name" property="brandName"/> <result column="company_name" property="companyName"/> </resultMap> <select id="selectAll" resultMap="brandResult"> select * from tb_brand; </select> </mapper>