diary-2
来源:互联网 发布:淘宝网无法点击购买 编辑:程序博客网 时间:2024/04/28 14:03
普通的: 数据库增删改查
增加:
insert into tatle values()
删除:
delete from tatle where 条件
更新
update table set 属性 where 条件
查询:
select *from table where 条件
Mybatis中的数据库增删改查
<insert id="addFile" parameterType="model.File"> INSERT INTO file(id,title,content,date) VALUES (#{id},#{title},#{content},#{date})</insert><select id="findFile" parameterType="String" resultMap="File"> SELECT *FROM file WHERE content LIKE concat(concat('%',#{content}),'%')</select><select id="listAll" resultMap="File"> SELECT *FROM file</select><select id="findById" parameterType="int" resultMap="File"> SELECT *FROM file WHERE id=#{id}</select><delete id="deleteFile" parameterType="int"> DELETE FROM file where id=#{id}</delete> <!--更新操作--><update id="updateFile" parameterType="model.File"> UPDATE file SET title=#{title},content=#{content},date=#{date} WHERE id=#{id}</update>
阅读全文
0 0
- diary-2
- 10-2 DIARY
- diary
- diary
- Diary
- diary
- diary
- diary
- diary
- Diary
- Diary
- Diary
- MFC Diary - Visual C++ 基础框架2
- OS Diary Day 2 printfmt.c &&printf.c
- work diary
- my diary
- First Diary
- first diary
- 为什么ip地址总是在变
- 没有Project Facets的解决方法
- 网易内推笔试题
- MySQL_006_基础_列属性之 空属性、列描述和默认值
- C语言信号处理
- diary-2
- hadoop入门(五)MapReduce简介
- MySQL系列—Scheme设计与数据类型优化
- Stack-----42. Trapping Rain Water
- Navicat for MySQL中文破解版免费下载
- webpack ERROR in ( your module path) Module build failed: Unknown word
- 插入排序
- LINUX命令行下以HTTP方式下载文件的方法
- TCP三次握手/四次挥手