[mybatis]resultMap configuration

 <resultMap id="brandResultMap" type="brand">
     <!--
            id: Complete the mapping of the primary key field
                column: column name of the table
                property: attribute name of the entity class
            result: Complete the mapping of general fields
                column: column name of the table
                property: attribute name of the entity class
        -->
     <result column="brand_name" property="brandName"/>
     <result column="company_name" property="companyName"/>
</resultMap>



<select id="selectAll" resultMap="brandResultMap">
    select *
    from tb_brand;
</select>

Personally, I feel that this is quite important. It is mainly used to map a column when the naming habits of the two modes are different, which is equivalent to connecting the two. 

Guess you like

Origin blog.csdn.net/qq_63499305/article/details/130714353