ap-dev 1.1.7 → 1.1.11

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.
@@ -78,20 +78,17 @@ const menus = [
78
78
  id: 'ApiJavaCommon',
79
79
  label: '5.1 通用必读'
80
80
  }, {
81
- id: 'ApiServiceUtil',
82
- label: '5.2 生成通用代码'
81
+ id: 'ApiApSql',
82
+ label: '5.2 动态SQL'
83
83
  }, {
84
84
  id: 'ApiMybatis',
85
85
  label: '5.3 Mybatis规范'
86
- }, {
87
- id: 'ApiPaging',
88
- label: '5.4 表格分页'
89
86
  }, {
90
87
  id: 'ApiJavaUtils',
91
- label: '5.5 常用工具类'
88
+ label: '5.4 常用工具类'
92
89
  }, {
93
90
  id: 'ApiOtherJava',
94
- label: '5.6 其他'
91
+ label: '5.5 其他'
95
92
  }]
96
93
  }]
97
94
  export default menus
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <api-tabs :options.sync="opts"></api-tabs>
3
+ </template>
4
+
5
+ <script>
6
+ import ApiTabs from './../components/ApiTabs'
7
+
8
+ export default {
9
+ name: "ApiApSql",
10
+ components: {ApiTabs},
11
+ data() {
12
+ let opts = [
13
+ {
14
+ label: "1.共通说明",
15
+ component: "ApiApSqlCommon"
16
+ },{
17
+ label: "2.关键字",
18
+ component: "ApiApSqlKeyword"
19
+ },{
20
+ label: "3.函数",
21
+ component: "ApiApSqlFunction"
22
+ },{
23
+ label: "4.操作符",
24
+ component: "ApiApSqlOperate"
25
+ }
26
+ ];
27
+ return {
28
+ opts: opts
29
+ }
30
+ }
31
+ }
32
+ </script>
33
+
34
+ <style scoped>
35
+ </style>
@@ -1,24 +1,50 @@
1
1
  <template>
2
- <api-tabs :options.sync="opts"></api-tabs>
2
+ <el-tabs v-model="activeName" tabPosition="left" class="api-tabs">
3
+ <template v-for="(item,index) in opts">
4
+ <el-tab-pane :label="item.label" :name="'tab' + index" class="api-tab">
5
+ <component :is="item.component"></component>
6
+ </el-tab-pane>
7
+ </template>
8
+ </el-tabs>
3
9
  </template>
4
10
 
5
11
  <script>
6
- import ApiTabs from './../components/ApiTabs'
12
+ import ApiServiceUtil from './../tabs/ApiServiceUtil'
13
+ import ApiException from './../tabs/ApiException'
14
+ import ApiPermission from './../tabs/ApiPermission'
15
+ import ApiPaging from './../tabs/ApiPaging'
16
+ import ApiTask from './../tabs/ApiTask'
7
17
 
8
18
  export default {
9
- name: "ApiJavaCommon",
10
- components: {ApiTabs},
19
+ name: "ApiJavaCommonUtil",
20
+ components: {
21
+ ApiServiceUtil,
22
+ ApiException,
23
+ ApiPermission,
24
+ ApiPaging,
25
+ ApiTask
26
+ },
11
27
  data() {
12
- let opts = [
13
- {
14
- label: "1.异常处理",
15
- component: "ApiException"
16
- },{
17
- label: "2.权限判断",
18
- component: "ApiPermission"
19
- }
28
+
29
+ let opts = [{
30
+ label: "代码生成",
31
+ component: "ApiServiceUtil"
32
+ }, {
33
+ label: "异常处理",
34
+ component: "ApiException"
35
+ }, {
36
+ label: "权限判断",
37
+ component: "ApiPermission"
38
+ }, {
39
+ label: "表格分页",
40
+ component: "ApiPaging"
41
+ }, {
42
+ label: "调度管理",
43
+ component: "ApiTask"
44
+ }
20
45
  ];
21
46
  return {
47
+ activeName: 'tab0',
22
48
  opts: opts
23
49
  }
24
50
  }
@@ -26,4 +52,13 @@ export default {
26
52
  </script>
27
53
 
28
54
  <style scoped>
55
+ .api-tabs {
56
+ display: flex;
57
+ height: 100%;
58
+ }
59
+
60
+ .api-tabs /deep/ .el-tabs__content {
61
+ flex: 1;
62
+ overflow: scroll;
63
+ }
29
64
  </style>
@@ -48,6 +48,12 @@ export default {
48
48
  memo: `显示checkbox选择框<br>
49
49
  <span class="api-memo">注:支持多选时要配置</span>`,
50
50
  code: `<div class="api-code">showCheckbox: true,</div>`
51
+ },{
52
+ name: 'defaultExpandAll',
53
+ type: '布尔',
54
+ default: 'true',
55
+ memo: `默认展开`,
56
+ code: `<div class="api-code">defaultExpandAll: false,</div>`
51
57
  },{
52
58
  name: 'toolbarBtn',
53
59
  type: '数组',
@@ -0,0 +1,153 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <api-tittle1>共通说明</api-tittle1>
4
+ <api-tittle2>
5
+ 一、使用方法:
6
+ </api-tittle2>
7
+ <api-content>
8
+ 1、后端代码生成:***TF<br>
9
+ <br>
10
+ 2、组装sql<br>
11
+ <div class="api-code">ApSql sql = new ApSql();<br>
12
+ sql.select(TDemoTF.fdName,TDemoTypeTF.fdName)<br>
13
+ .from(TDemoTF.TDemo)<br>
14
+ .leftJoin(TDemoTypeTF.TDemoType)<br>
15
+ .on(TDemoTF.fdTypeId.eq(TDemoTypeTF.fdId))<br>
16
+ .where(TDemoTF.fdName.like("张%"))<br>
17
+ .and(TDemoTF.fdDisabled.eq(1))<br>
18
+ .orderBy(TDemoTF.fdName);</div>
19
+ <br>
20
+ 3、执行sql:可返回四种类型的结果<br>
21
+ <div class="api-code">
22
+ // 1、返回 HashMap 类型的list<br>
23
+ List&lt;HashMap> list1 = sql.execute();<br><br>
24
+ // 2、返回指定对象类型的list<br>
25
+ List&lt;TDemo> list2 = sql.execute(TDemo.class);<br><br>
26
+ // 3、返回 HashMap (只需返回一条数据)<br>
27
+ HashMap obj2 = sql.executeOne();<br><br>
28
+ // 4、返回 指定对象 (只需返回一条数据)<br>
29
+ TDemo obj1 = sql.executeOne(TDemo.class);<br></div>
30
+ <br><br>
31
+ 复杂sql示例:<br>
32
+ <div class="api-code">
33
+ {{js1}}
34
+ </div>
35
+ </api-content>
36
+
37
+ <api-tittle2>
38
+ 二、通用说明:表别名
39
+ </api-tittle2>
40
+ <api-content>
41
+ 1、默认别名:t1、t2、...。<br>
42
+ 默认添加bean属性名称。eg:t1.fd_name as fdName<br><br>
43
+ 2、自定义别名:【.as("****")】<br>
44
+ <div class="api-code">// 例:同一个表,在SQL中多次使用时需要自定义别名。<br>
45
+ .from(TDemoTF.TDemo)<br>
46
+ .leftJoin(TDemoTF.TDemo.as("d"))<br></div>
47
+ <br>
48
+ <span class="api-memo">注:通常使用默认别名即可。如果自定义别名,表相应字段都需要自定义表别名。</span>
49
+ </api-content>
50
+ <api-tittle2>
51
+ 三、通用说明:字段别名(select时使用)
52
+ </api-tittle2>
53
+ <api-content>
54
+ 1、默认bean属性名称:"as 属性名"<br>
55
+ <div class="api-code">
56
+ // select t1.fd_name as fdName<br>
57
+ .select(TDemoTF.fdName)
58
+ </div>
59
+ <br>
60
+ 2、存在函数时,默认添加f*:"as f*"<br>
61
+ <div class="api-code">
62
+ // select count(t1.fd_name) as f1<br>
63
+ .select(count(TDemoTF.fdName))
64
+ </div>
65
+ <br>
66
+ 3、自定义别名:.as("****")<br>
67
+ <div class="api-code">
68
+ // select t1.fd_name as name<br>
69
+ .select(TDemoTF.fdName.as("name"))
70
+ </div>
71
+ </api-content>
72
+ <api-tittle2>
73
+ 四、通用说明:字段操作
74
+ </api-tittle2>
75
+ <api-content>
76
+ 1、字段和字段:<br>
77
+ <div class="api-code">
78
+ // t1.fd_name= t2.fd_name<br>
79
+ TDemo1TF.fdName.eq(TDemo2TF.fdName)
80
+ </div>
81
+ <br>
82
+ 2、字段和参数,默认添加f*:"as f*"<br>
83
+ <div class="api-code">
84
+ // t1.fd_name= '张三'<br>
85
+ TDemo1TF.fdName.eq("张三")
86
+ </div>
87
+ <br>
88
+ </api-content>
89
+ <api-tittle2>
90
+ 五、通用说明:函数
91
+ </api-tittle2>
92
+ <api-content>
93
+ 函数为ASL类下的静态方法,所以使用时需要导入:<br>
94
+ <div class="api-code">
95
+ // 例:select count(f1.fd_name)<br><br>
96
+ // 方式1(推荐):顶部import 静态方法<br>
97
+ import static com.ap.sql.ASL.count;<br>
98
+ .select(count(TDemoTF.fdName))<br><br>
99
+ // 方式2:直接调用<br>
100
+ .select(ASL.count(TDemoTF.fdName))
101
+ </div>
102
+ <br>
103
+ </api-content>
104
+ </div>
105
+ </template>
106
+
107
+ <script>
108
+ import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
109
+
110
+ export default {
111
+ name: 'ApiApSqlCommon',
112
+ components: {
113
+ ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
114
+ },
115
+ data() {
116
+ let js1 = `// 目标sql:获取日期<2021-11-08、名字以张或李开头的名字,同时获取对应的父类型名字
117
+ select
118
+ t1.fd_name as fdName,
119
+ substring(t1.fdName, 1, 2) as f1,
120
+ t2.fd_name as parentName,
121
+ custom('lower(t1.fd_en_name) as fdEnName')
122
+ from
123
+ t_demo t1
124
+ left join t_demo_type t2 on t1.fd_type_id = t2.fd_id
125
+ where
126
+ date_format(t1.fd_date, 'Y-%m-%d') < '2021-11-08'
127
+ and (t1.fd_name like '张%' or t1.fd_name like '李%')
128
+ order by
129
+ t1.fd_name desc
130
+
131
+
132
+ // ApSql构造
133
+ ApSql sql = new ApSql();
134
+ sql.select(TDemoTF.fdName,
135
+ substring(TDemoTF.fdName, 1 ,2),
136
+ TDemoTypeTF.fdName,
137
+ custom('lower(t1.fd_en_name) as fdEnName'))
138
+ .from(TDemoTF.TDemo)
139
+ .leftJoin(TDemoTypeTF.TDemoType)
140
+ .on(TDemoTF.fdTypeId.eq(TDemoTypeTF.fdId))
141
+ .where(TDemoTF.fdDate.lt(date_format('2021-11-08', 'Y-%m-%d')))
142
+ .andPartStart(TDemoTF.fdName.like( "张%"))
143
+ .and(TDemoTF.fdName.like( "李%"))
144
+ .partEnd()
145
+ .orderBy(TDemoTF.fdName.desc());`
146
+ return {js1}
147
+ },
148
+ methods: {}
149
+ }
150
+ </script>
151
+
152
+ <style scoped>
153
+ </style>
@@ -0,0 +1,114 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <api-tittle2>函数说明</api-tittle2>
4
+ <div style="height: 1000px;width: 100%">
5
+ <api-table :data="methodData" :columns="methodCols"/>
6
+ </div>
7
+ </div>
8
+ </template>
9
+
10
+ <script>
11
+ import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
12
+
13
+ export default {
14
+ name: 'ApiApSqlKeyword',
15
+ components: {
16
+ ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
17
+ },
18
+ data() {
19
+ const methodCols = [
20
+ {label: '函数', prop: 'name', width: '100px'},
21
+ {label: '说明', prop: 'memo', width: '300px'},
22
+ {label: '示例代码', prop: 'code', minWidth: '100px'}]
23
+ const methodData = [
24
+ {
25
+ name: 'count',
26
+ memo: `格式:count(字段) <br>说明:计数`,
27
+ code: `<span class="api-code">// 例:select count(t1.fd_name) f1
28
+ .select(count(TDemoTF.fdName))</span>`
29
+ }, {
30
+ name: 'group_concat',
31
+ memo: `格式:group_concat(字段) <br>说明:聚合`,
32
+ code: `<span class="api-code">// 例:select group_concat(t1.fd_name) f1
33
+ .select(group_concat(TDemoTF.fdName))</span>`
34
+ }, {
35
+ name: 'date_format',
36
+ memo: `格式:date_format(字段, "日期格式") <br>说明:日期格式化
37
+ <br>常用日期格式:%Y-%m-%d %H:%i:%S<br>例:2021-11-18 11:20:30`,
38
+ code: `<span class="api-code">// 例:select date_format(t1.fd_date, '%Y-%m-%d %H:%i:%S') f1
39
+ .select(date_format(TDemoTF.fdDate, "%Y-%m-%d %H:%i:%S"))</span>`
40
+ }, {
41
+ name: 'sum',
42
+ memo: `格式:sum(字段) <br>说明:求和`,
43
+ code: `<span class="api-code">// 例:select sum(t1.fd_type) f1
44
+ .select(sum(TDemoTF.fdType))</span>`
45
+ }, {
46
+ name: 'avg',
47
+ memo: `格式:avg(字段) <br>说明:平均数`,
48
+ code: `<span class="api-code">// 例:select avg(t1.fd_type) f1
49
+ .select(avg(TDemoTF.fdType))</span>`
50
+ }, {
51
+ name: 'substring',
52
+ memo: `格式:avg(字段, 开始位置, 截取长度) <br>说明:字符串切割`,
53
+ code: `<span class="api-code">// 例:select substring(t1.fd_name, 1, 2) f1
54
+ .select(substring(TDemoTF.fdName, 1, 2))</span>`
55
+ }, {
56
+ name: 'ifnull',
57
+ memo: `格式:ifnull(字段, "参数") <br>说明:判断空`,
58
+ code: `<span class="api-code">// 例:select ifnull(t1.fd_name,t1.fd_comment) f1
59
+ .select(ifnull(TTestTF.fdName, TTestTF.fdComment))
60
+ // 例:select ifnull(t1.fd_name, '空') f1
61
+ .select(ifnull(TTestTF.fdName, "空"))</span>`
62
+ }, {
63
+ name: 'if_',
64
+ memo: `格式:if(表达式, "参数", "参数") <br>说明:if为java关键字所以末端加了下划线`,
65
+ code: `<span class="api-code">// 例:select if(t1.fd_name='张三', '是张三', '不是张三') f1
66
+ .select(if(TTestTF.fdName.eq("张三"), "是张三", "不是张三"))
67
+ // 例:select if(t1.fd_name='张三', t1.fd_comment, 'xxx') f1
68
+ .select(if(TTestTF.fdName.eq("张三"), TTestTF.fdCommont, "xxx"))</span>`
69
+ }, {
70
+ name: 'round',
71
+ memo: `格式:ROUND(字段) <br>说明:最近的整数(四舍五入)`,
72
+ code: `<span class="api-code">// 例:select round(t1.fd_count) f1
73
+ .select(round(TTestTF.fdCount))</span>`
74
+ }, {
75
+ name: 'truncate',
76
+ memo: `格式:truncate(xx, y) <br>说明:数值 xx 保留到小数点后 y 位的值(不会进行四舍五入)`,
77
+ code: `<span class="api-code">// 例:select truncate(t1.fd_count, 2) f1
78
+ .select(truncate(TTestTF.fdCount, 2))</span>`
79
+ }, {
80
+ name: 'max',
81
+ memo: `格式:max(字段) <br>说明:最大值`,
82
+ code: `<span class="api-code">// 例:select max(t1.fd_count) f1
83
+ .select(max(TTestTF.fdCount))</span>`
84
+ }, {
85
+ name: 'min',
86
+ memo: `格式:min(字段) <br>说明:最小值`,
87
+ code: `<span class="api-code">// 例:select min(t1.fd_count) f1
88
+ .select(min(TTestTF.fdCount))</span>`
89
+ }, {
90
+ name: 'concat',
91
+ memo: `格式:concat(xx,yy...) <br>说明:拼接`,
92
+ code: `<span class="api-code">// 例:select concat(t1.fd_name, "名字", "!") f1
93
+ .select(concat(TTestTF.fdName , "名字", "!"))
94
+ // 例:select concat(t1.fd_name, t1.fd_type) f1
95
+ .select(concat(TTestTF.fdName , TTestTF.fdType))</span>`
96
+ }, {
97
+ name: 'custom',
98
+ memo: `格式:custom("参数") <br>说明:自定义任意字符串`,
99
+ code: `<span class="api-code">// 例:select custom("t1.fd_name as name") f1
100
+ .select(custom("t1.fdName as name"))</span>`
101
+ }
102
+ ]
103
+
104
+ return {
105
+ methodData,
106
+ methodCols
107
+ }
108
+ },
109
+ methods: {}
110
+ }
111
+ </script>
112
+
113
+ <style scoped>
114
+ </style>
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <api-tittle2>关键字说明</api-tittle2>
4
+ <div style="height: 1500px;width: 100%">
5
+ <api-table :data="methodData" :columns="methodCols"/>
6
+ </div>
7
+ </div>
8
+ </template>
9
+
10
+ <script>
11
+ import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
12
+
13
+ export default {
14
+ name: 'ApiApSqlKeyword',
15
+ components: {
16
+ ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
17
+ },
18
+ data() {
19
+ const methodCols = [
20
+ {label: '关键字', prop: 'name', width: '100px'},
21
+ {label: '说明', prop: 'memo', width: '300px'},
22
+ {label: '示例代码', prop: 'code', minWidth: '100px'}]
23
+ const methodData = [
24
+ {
25
+ name: 'select',
26
+ memo: `1、select别名<br>
27
+ 2、表别名<br>
28
+ 3、函数<br>`,
29
+ code: `<span class="api-code">// select示例:
30
+ .select(
31
+ TDemoTF.fdName, // 默认 => t1.fd_name as fdName
32
+ TDemoTF.fdName.as("name"), // 字段别名 => t1.fd_name as name,
33
+ TDemoTF.fdName.tableAs("temp"), // 表别名 => temp.fd_name as fdName,
34
+ substring(TDemoTF.fdName, 1, 2), // 函数调用 => substring(t1.fd_name, 1, 2) as f1
35
+ substring(TDemoTF.fdName, 1, 2).tableAs("temp").as("name")) // 嵌套 => substring(temp.fd_name, 1, 2) as name
36
+ .from(TDemoTF.TDemo)</span>`
37
+ }, {
38
+ name: 'select distinct',
39
+ memo: `同select`,
40
+ code: `<span class="api-code">// select distinct示例:select distinct ...
41
+ .selectDistinct(....)</span>`
42
+ }, {
43
+ name: 'from',
44
+ memo: `1、表别名`,
45
+ code: `<span class="api-code">// 1、默认别名:t_demo t1
46
+ .from(TDemoTF.TDemo)
47
+ // 2、自定义别名转为:t_demo tt
48
+ .from(TDemoTF.TDemo).as("tt")</span>`
49
+ }, {
50
+ name: 'inner join ',
51
+ memo: `同from`,
52
+ code: `<span class="api-code">// 例:from t_demo1 t1 inner join t_demo2 t2:
53
+ .from(TDemo1TF.TDemo).innerJoin(TDemo2TF.TDemo)</span>`
54
+ }, {
55
+ name: 'left join ',
56
+ memo: `同from`,
57
+ code: `<span class="api-code">// 例:from t_demo1 t1 left join t_demo2 t2
58
+ .from(TDemo1TF.TDemo).leftJoin(TDemo2TF.TDemo)</span>`
59
+ }, {
60
+ name: 'right join ',
61
+ memo: `同from`,
62
+ code: `<span class="api-code">// 示例:from t_demo1 t1 right join t_demo2 t2
63
+ .from(TDemo1TF.TDemo).rightJoin(TDemo2TF.TDemo)</span>`
64
+ }, {
65
+ name: 'on',
66
+ memo: `字段连接`,
67
+ code: `<span class="api-code">// 1、单个条件:....on t1.fd_name= t2.fd_name
68
+ .on(TDemo1TF.fdName.eq(TDemo2TF.fdName))
69
+ // 2、多条件拼接:....on t1.fd_name= t2.fd_name and t1.fd_type=1
70
+ .on(TDemo1TF.fdName.eq(TDemo2TF.fdName)).and(TDemo1TF.fdType.eq(1))</span>`
71
+ }, {
72
+ name: 'where',
73
+ memo: `where条件`,
74
+ code: `<span class="api-code">// 例:where t1.fd_name= '张三'
75
+ .where(TDemoTF.fdName.eq("张三"))
76
+ // 例:where t1.fd_name= t2.fd_name
77
+ .where(TDemo1TF.fdName.eq(TDemo2TF.fdName))</span>`
78
+ }, {
79
+ name: 'and',
80
+ memo: `and`,
81
+ code: `<span class="api-code">// 例:and t1.fd_name= '张三'
82
+ .and(TDemoTF.fdName.eq("张三"))
83
+ // 例:and t1.fd_name= t2.fd_name
84
+ .and(TDemo1TF.fdName.eq(TDemo2TF.fdName))</span>`
85
+ }, {
86
+ name: 'or',
87
+ memo: `or`,
88
+ code: `<span class="api-code">// 例:or t1.fd_name= '张三'
89
+ .or(TDemoTF.fdName.eq("张三"))
90
+ // 例:or t1.fd_name= t2.fd_name
91
+ .or(TDemo1TF.fdName.eq(TDemo2TF.fdName))</span>`
92
+ }, {
93
+ name: 'andPartStart',
94
+ memo: `带括号形式:and ()`,
95
+ code: `<span class="api-code">// 例:and ( t1.fd_name like '%张%' or t1.fd_name like '%李%')
96
+ .andPartStart(TDemoTF.fdName.like("%张%")).or(TDemoTF.fdName.like("%李%")).partEnd()</span>`
97
+ }, {
98
+ name: 'orPartStart',
99
+ memo: `带括号形式:or ()`,
100
+ code: `<span class="api-code">// 例:or ( t1.fd_name like '%张%' or t1.fd_name like '%李%')
101
+ .orPartStart(TDemoTF.fdName.like("%张%")).or(TDemoTF.fdName.like("%李%")).partEnd()</span>`
102
+ }, {
103
+ name: 'groupBy',
104
+ memo: `group by`,
105
+ code: `<span class="api-code">// 例:group by t1.fd_name
106
+ .groupBy(TDemoTF.fdName)
107
+ // 例:group by t1.fd_name, t1.fd_type
108
+ .groupBy(TDemoTF.fdName, TDemoTF.fdType)</span>`
109
+ }, {
110
+ name: 'having',
111
+ memo: `having`,
112
+ code: `<span class="api-code">// 例:having t1.fd_name= '张三'
113
+ .having(TDemoTF.fdName.eq("张三"))
114
+ // 例:having t1.fd_name= '张三' and t1.fd_type = 1
115
+ .having(TDemoTF.fdName.eq("张三")).and(TDemoTF.fdType.eq(1))</span>`
116
+ }, {
117
+ name: 'orderBy',
118
+ memo: `order by<br> 默认升序:asc`,
119
+ code: `<span class="api-code">// 例:order by t1.fd_name
120
+ .orderBy(TDemoTF.fdName)
121
+ // 例:order by t1.fd_name, t1.fd_type
122
+ .orderBy(TDemoTF.fdName, TDemoTF.fdType)
123
+ // 例:order by t1.fd_name asc, t1.fd_type desc
124
+ .orderBy(TDemoTF.fdName.asc(), TDemoTF.fdType.desc())</span>`
125
+ }, {
126
+ name: 'limit',
127
+ memo: `limit`,
128
+ code: `<span class="api-code">// 例:limit 1
129
+ .limit(1)
130
+ // 例:limit 1, 2
131
+ .limit(1, 2)</span>`
132
+ }
133
+ ]
134
+
135
+ return {
136
+ methodData,
137
+ methodCols
138
+ }
139
+ },
140
+ methods: {}
141
+ }
142
+ </script>
143
+
144
+ <style scoped>
145
+ </style>
@@ -0,0 +1,102 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <api-tittle2>操作符</api-tittle2>
4
+ <div style="height: 900px;width: 100%">
5
+ <api-table :data="methodData" :columns="methodCols"/>
6
+ </div>
7
+ </div>
8
+ </template>
9
+
10
+ <script>
11
+ import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
12
+
13
+ export default {
14
+ name: 'ApiApSqlKeyword',
15
+ components: {
16
+ ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
17
+ },
18
+ data() {
19
+ const methodCols = [
20
+ {label: '操作符', prop: 'name', width: '100px'},
21
+ {label: '说明', prop: 'memo', width: '300px'},
22
+ {label: '示例代码', prop: 'code', minWidth: '100px'}]
23
+ const methodData = [
24
+ {
25
+ name: '=',
26
+ memo: `格式:字段.eq("参数") <br>说明:等于。参数可以是字段`,
27
+ code: `<span class="api-code">// 例:t1.fd_name = "张三"
28
+ TDemoTF.fdName.eq("张三")
29
+ // 例:t1.fd_name = t2.fd_name
30
+ TDemo1TF.fdName.eq(TDemo2TF.fdName)</span>`
31
+ }, {
32
+ name: '!=',
33
+ memo: `格式:字段.notEq("参数") <br>说明:不等于。参数可以是字段`,
34
+ code: `<span class="api-code">// 例:t1.fd_name != "张三"
35
+ TDemoTF.fdName.notEq("张三")
36
+ // 例:t1.fd_name != t2.fd_name
37
+ TDemo1TF.fdName.notEq(TDemo2TF.fdName)</span>`
38
+ }, {
39
+ name: '<',
40
+ memo: `格式:字段.lt("参数") <br>说明:小于。参数可以是字段`,
41
+ code: `<span class="api-code">// 例:t1.fd_count < 1
42
+ TDemoTF.fdCount.lt(1)</span>`
43
+ }, {
44
+ name: '<=',
45
+ memo: `格式:字段.ltEq("参数") <br>说明:小于等于。参数可以是字段`,
46
+ code: `<span class="api-code">// 例:t1.fd_count <= 1
47
+ TDemoTF.fdCount.ltEq(1)</span>`
48
+ }, {
49
+ name: '>',
50
+ memo: `格式:字段.gt("参数") <br>说明:大于。参数可以是字段`,
51
+ code: `<span class="api-code">// 例:t1.fd_count > 1
52
+ TDemoTF.fdCount.gt(1)</span>`
53
+ }, {
54
+ name: '>=',
55
+ memo: `格式:字段.gtEq("参数") <br>说明:大于等于。参数可以是字段`,
56
+ code: `<span class="api-code">// 例:t1.fd_count >= 1
57
+ TDemoTF.fdCount.gtEq(1)</span>`
58
+ }, {
59
+ name: 'like',
60
+ memo: `格式:字段.like("参数") <br>说明:like`,
61
+ code: `<span class="api-code">// 例:t1.fd_name like "张%"
62
+ TDemoTF.fdCount.like("张%")</span>`
63
+ }, {
64
+ name: 'is null',
65
+ memo: `格式:字段.isNull() <br>说明:为空`,
66
+ code: `<span class="api-code">// 例:t1.fd_name is null
67
+ TDemoTF.fdCount.isNull()</span>`
68
+ }, {
69
+ name: 'is not null',
70
+ memo: `格式:字段.isNotNull() <br>说明:不为空`,
71
+ code: `<span class="api-code">// 例:t1.fd_name is not null
72
+ TDemoTF.fdCount.isNotNull()</span>`
73
+ }, {
74
+ name: 'in',
75
+ memo: `格式:字段.in("参数","参数"...) <br>说明:包含。<br>参数可以是多个。<br>参数可以是list`,
76
+ code: `<span class="api-code">// 例:t1.fd_type in (1, 2, 3)
77
+ TDemoTF.fdType.in(1, 2, 2)
78
+ // 例:t1.fd_type in (1, 2, 3)
79
+ List list = new ArrayList<Integer>();
80
+ list.add(1);
81
+ list.add(2);
82
+ list.add(3);
83
+ TDemoTF.fdType.in(list)</span>`
84
+ }, {
85
+ name: 'between and',
86
+ memo: `格式:字段.between() <br>说明:不为空`,
87
+ code: `<span class="api-code">// 例:t1.fd_type between 1 and 3
88
+ TDemoTF.fdType.between(1, 3)</span>`
89
+ }
90
+ ]
91
+
92
+ return {
93
+ methodData,
94
+ methodCols
95
+ }
96
+ },
97
+ methods: {}
98
+ }
99
+ </script>
100
+
101
+ <style scoped>
102
+ </style>
File without changes