关于mybatis配置文件中的resultMap和resultType

来源:互联网 发布:网络校时软件 编辑:程序博客网 时间:2024/06/07 13:33
<select id="selectByName" parameterType="string" resultType ="com.listore.pojo.Category">    select * from listore_category where name = #{name,jdbcType=VARCHAR};</select>
在没有<include>标签中可以使用resultType,但是有了<include>标签以后就会封装对象时候封装失败
比如:
<select id="selectByProductIdUserId" parameterType="map" resultType="com.listore.pojo.Cart">   select    <include refid="Base_Column_List"/>   from listore_cart   where user_id=#{userId}    and product_id=#{productId}</select>

原创粉丝点击