Commit 8ea3db87 by ning

数据库更新应用

parent 51fdec3d
...@@ -14,9 +14,13 @@ public static void main(String args[]){ ...@@ -14,9 +14,13 @@ public static void main(String args[]){
} }
``` ```
```typescript ```typescript
初始化数据对象
private gldwDao: GldwDao = SQLiteContext.with(GldwDao)
```
```typescript
批量插入数据 批量插入数据
SQLiteContext.with(GldwDao) this.gldwDao.batchInsert([{ guid: '124', dwdm: '124', dwfh: '124', dwxz: 'zf' }
.batchInsert([{ guid: '124', dwdm: '124', dwfh: '124', dwxz: 'zf' }
, { guid: '125', dwdm: '125', dwfh: '125', dwxz: 'zf' }]) , { guid: '125', dwdm: '125', dwfh: '125', dwxz: 'zf' }])
.then(result => { .then(result => {
Logger.info(this, '数据保存成功' + result); Logger.info(this, '数据保存成功' + result);
...@@ -26,8 +30,15 @@ SQLiteContext.with(GldwDao) ...@@ -26,8 +30,15 @@ SQLiteContext.with(GldwDao)
```typescript ```typescript
查询表数据 查询表数据
SQLiteContext.with(GldwDao).queryAll().then((res1) => { this.gldwDao.queryAll().then((res1) => {
Logger.info(this, '查询结果:' + JSON.stringify(res1)); Logger.info(this, '查询结果:' + JSON.stringify(res1));
}) })
``` ```
```typescript
更新数据
let val = await this.gldwDao.update({'guid':'124','dwfh':'mmm_124'});
Logger.info(this,'更新返回值:' + val)
```
--- ---
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论