baja-lite 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/test-mysql.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  import 'reflect-metadata';
2
2
  import { Boot } from './boot';
3
- import { SqlService, Field, DB, DBType, SqlType, ColumnMode, } from './sql';
4
-
3
+ import { SqlService, Field, DB, DBType, SqlType, ColumnMode, } from './sql';
5
4
  class AmaFuck2 {
6
- @Field({ type: SqlType.varchar, length: 200, id: true, uuid: true })
5
+ @Field({ type: SqlType.varchar, length: 200, id: true, uuid: true })
7
6
  site?: string;
8
- @Field({ type: SqlType.varchar, length: 200,def:'333' })
7
+ @Field({ type: SqlType.varchar, length: 200, def: '333' })
9
8
  sellerSku2?: string;
10
- @Field({ type: SqlType.varchar, length: 200 })
9
+ @Field({ type: SqlType.varchar, length: 200 })
11
10
  sellerSku?: string;
12
11
  }
13
12
 
@@ -17,7 +16,15 @@ class AmaFuck2 {
17
16
  class AmaService2 extends SqlService<AmaFuck2>{
18
17
 
19
18
  }
20
- async function go2() {
19
+
20
+ interface Menu {
21
+ resourceid: string;
22
+ resourcepid: string;
23
+ resourcename: string;
24
+ children: Menu[];
25
+ }
26
+
27
+ export async function go2() {
21
28
  await Boot({
22
29
  Mysql: {
23
30
  host: '39.98.58.252',
@@ -28,7 +35,7 @@ async function go2() {
28
35
  database: 'dmce',
29
36
  debug: false
30
37
  },
31
- log: 'trace',
38
+ log: 'info',
32
39
  columnMode: ColumnMode.HUMP,
33
40
  sqlDir: 'E:/pro/baja-lite/xml'
34
41
  });
@@ -98,8 +105,20 @@ async function go2() {
98
105
  return 1;
99
106
  }
100
107
  });
101
- await service.select({sqlId: 'event-report.matchSectionTempWGoalPlayerList',params: {searchVo:{matchId:'yyyy',matchSection:'oooo'}}});
102
- }
103
108
 
109
+ const data = await service.select<Menu>({
110
+ sql: 'SELECT resourceid, resourcepid,resourcename FROM cp_resource ',
111
+ params: {
112
+ site: '1234',
113
+ matchInfo: { reportType: 'yyyy', id: '11' }
114
+ },
115
+ // mapper: [
116
+ // ['site', ['info', 'bSist'], 989],
117
+ // ['site', ['info2', 'bSist'], 33],
118
+ // ['site', ['Bsite'], 0]
119
+ // ]
120
+ });
121
+ console.log(data);
104
122
 
123
+ }
105
124
  go2();