Mybatis自定义ResultMap使用总结

前段时间因为需求变更,使用Mybatis写SQL的时候需要自定义ResultMap,在使用的过程中也遇到了很多奇怪的问题,搞不懂是什么原因,各路大神有知道的还请指导指导奋斗


在同一个映射文件里,我的第一个ResultMap对应的是一个DAO,是这么写的:

<resultMap id="BaseResultMap" type="com.tracy.gd.domain.Expense" >
    <id column="e_id" property="eId" jdbcType="INTEGER" />
    <result column="e_la_id" property="eLaId" jdbcType="INTEGER" />
    <result column="e_la_cpt_id" property="eLaCptId" jdbcType="INTEGER" />
    <result column="e_la_user_id" property="eLaUserId" jdbcType="INTEGER" />
    <result column="e_lend_time" property="eLendTime" jdbcType="TIMESTAMP" />
    <result column="e_sreturn_time" property="eSreturnTime" jdbcType="TIMESTAMP" />
    <result column="e_areturn_time" property="eAreturnTime" jdbcType="TIMESTAMP" />
    <result column="e_is_returned" property="eIsReturned" jdbcType="VARCHAR" />
    <result column="e_days" property="eDays" jdbcType="INTEGER" />
    <result column="e_expense" property="eExpense" jdbcType="DECIMAL" />
    <result column="attribute1" property="attribute1" jdbcType="VARCHAR" />
    <result column="attribute2" property="attribute2" jdbcType="VARCHAR" />
    <result column="attribute3" property="attribute3" jdbcType="VARCHAR" />
  </resultMap>

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值