mybatis SQL映射配置文件
Posted Mr.O-O
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mybatis SQL映射配置文件相关的知识,希望对你有一定的参考价值。
<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映射配置文件的主要内容,如果未能解决你的问题,请参考以下文章