码迷,mamicode.com
首页 > 数据库 > 详细

mybatis SQL映射配置文件

时间:2019-03-22 00:19:42      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:integer   user   执行   into   配置文件   rtu   string   ati   结果   

<select
    id=""
    parameterType=""
    parameterMap=""
    resultType=""
    resultMap=""
    flushCache=""
    useCache=""
    timeout=""
    fetchSize=""
    statementType=""
    resultSetType=""
>

<insert
    id=""
    parameterType=""
    flushCache=""    
    statementType=""
    keyProperty=""
    keyColumn=""
    useGeneratedKeys=""
    timeout=""
>

<update
    id=""
    parameterType=""
    flushCache=""    
    timeout=""
    statementType=""
>

<delete
    id=""
    parameterType=""
    flushCache=""    
    timeout=""
    statementType=""
>
<mapper  namespace=" ">

    <insert    parameterType="输入参数类型"  parameterMap="输入参数集合"  resultType="结果类型"  resultClass="结果类"  resultMap= "结果集合"></insert>
    
    <select  id="findUserById" parameterType="int" resultType="User"  >
        select * from user_table where id = #{id}
    </select>

    <select  id="findUserByName" parameterType="String" resultType="User"  >
        select * from user_table where user_name Like '%%${value}' 
    </select>

    <insert   id = "insertUser"  parameterType="User" >
        <selectKey keyProperty="id" order="BEFORE" resultType="String">
            select 序列名.nextval()
        </selectKey>    
            insert into user()
                             values()
    </insert>

    //update返回执行之后被改变的信息条数
    <update  id="updateUserById" parameterType="User" >
        update user_table  set user_name=#{username} where id = #{id}
    </update>

    <delete  id="deleteUserById" parameterType="Integer" >
        delete  from user_table where id = #{id}
    </delete>

</mapper>

mybatis SQL映射配置文件

标签:integer   user   执行   into   配置文件   rtu   string   ati   结果   

原文地址:https://www.cnblogs.com/Mr-O-O/p/10575509.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!