在某内学了3个月学的一脸懵逼,由于是没基础所以学的不怎么好,求大神帮助
mybatis插入数据到数据库中,实体类的属性名与数据库的字段名不一致,怎么解决?查询可以用别名或者resultMap来解决,但增删改咋解决,他们没有返回值呀
<resultMap type="com.tarena.netctoss.entity.Cost" id="costmap">
<result property="costId" column="cost_id"/>
<result property="baseDuration" column="base_duration"/>
<result property="baseCost" column="base_cost"/>
<result property="unitCost" column="unit_cost"/>
<result property="costType" column="cost_type"/>
</resultMap>
<insert id="save" parameterType="com.tarena.netctoss.entity.Cost" >
INSERT INTO cost_sm
VALUES(cost_seq.nextval,#{name},
#{baseDuration},
#{baseCost},
#{unitCost},
'1',#{descr},sysdate,
null,#{costType})
</insert>