首页 > 其他 > 详细

columnPropertyUnsame

时间:2018-11-06 00:34:26      阅读:191      评论:0      收藏:0      [点我收藏+]
<mapper namespace="com.abc.dao.IStudentDao">
    <insert id="insertStudent">
        insert into student(tname,tage,score) values(#{name}, #{age}, #{score})
    </insert>
    
    <delete id="deleteById">
        delete from student where tid=#{xxx}
    </delete>
    
    <update id="updateStudent">
        update student set tname=#{name}, tage=#{age}, score=#{score} where tid=#{id}
    </update>
    
    <select id="selectStudentById" resultType="Student">
        <!-- 给与属性名称不同的字段别名,让别名与属性名称相同 -->
        select tid id,tname name,tage age,score from student where tid=#{ooo}
    </select>
    
</mapper>

 

<mapper namespace="com.abc.dao.IStudentDao">
    <insert id="insertStudent">
        insert into student(tname,tage,score) values(#{name}, #{age}, #{score})
    </insert>
    
    <delete id="deleteById">
        delete from student where tid=#{xxx}
    </delete>
    
    <update id="updateStudent">
        update student set tname=#{name}, tage=#{age}, score=#{score} where tid=#{id}
    </update>
    
    <resultMap type="Student" id="studentMap">
        <id column="tid" property="id"/>
        <result column="tname" property="name"/>
        <result column="tage" property="age"/>
    </resultMap>
    
    <select id="selectStudentById" resultMap="studentMap">
        select tid,tname,tage,score from student where tid=#{ooo}
    </select>
    
</mapper>

 

columnPropertyUnsame

原文:https://www.cnblogs.com/csslcww/p/9912392.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!