Commit 59bbf2d9e9ef03b24772f1cfb94d3f207735d33b

Authored by zhangdaihao
1 parent 6c510eca

技术文档梳理

Showing 1 changed file with 21 additions and 120 deletions
jeecg-boot/README.md
@@ -33,10 +33,22 @@ Jeecg-Boot 快速开发平台 @@ -33,10 +33,22 @@ Jeecg-Boot 快速开发平台
33 33
34 - 缓存:Redis 34 - 缓存:Redis
35 35
36 -  
37 -## 开发文档  
38 36
39 -- 查询过滤器用法 37 +## 技术文档
  38 +
  39 +
  40 +- 在线演示 : [http://boot.jeecg.org](http://boot.jeecg.org)
  41 +
  42 +- 在线教程: [http://jeecg-boot.mydoc.io/?t=345660](http://jeecg-boot.mydoc.io/?t=345660)
  43 +
  44 +- 常见问题: [入门常见问题大全](http://www.jeecg.org/forum.php?mod=viewthread&tid=7816&extra=page%3D1)
  45 +
  46 +- QQ交流群 : ①284271917、②769925425
  47 +
  48 +
  49 +## 专项文档
  50 +
  51 +#### 一、查询过滤器用法
40 52
41 ``` 53 ```
42 QueryWrapper<?> queryWrapper = QueryGenerator.initQueryWrapper(?, req.getParameterMap()); 54 QueryWrapper<?> queryWrapper = QueryGenerator.initQueryWrapper(?, req.getParameterMap());
@@ -77,133 +89,22 @@ QueryWrapper&lt;?&gt; queryWrapper = QueryGenerator.initQueryWrapper(?, req.getParamet @@ -77,133 +89,22 @@ QueryWrapper&lt;?&gt; queryWrapper = QueryGenerator.initQueryWrapper(?, req.getParamet
77 | 多选字段模糊查询 | 上述4 有一个特例,若某一查询字段前后都带逗号 则会将其视为走这种查询方式 ,该查询方式是将查询条件以逗号分割再遍历数组 将每个元素作like查询 用or拼接,例如 现在name传入值 ,a,b,c, 那么结果sql就是 name like '%a%' or name like '%b%' or name like '%c%' | | 89 | 多选字段模糊查询 | 上述4 有一个特例,若某一查询字段前后都带逗号 则会将其视为走这种查询方式 ,该查询方式是将查询条件以逗号分割再遍历数组 将每个元素作like查询 用or拼接,例如 现在name传入值 ,a,b,c, 那么结果sql就是 name like '%a%' or name like '%b%' or name like '%c%' | |
78 90
79 91
80 -- Autopoi使用文档(EXCEL工具类 - EasyPOI衍变升级重构版本) 92 +#### 二、AutoPoi(EXCEL工具类-EasyPOI衍变升级重构版本)
81 93
82 [在线文档](https://github.com/zhangdaiscott/autopoi) 94 [在线文档](https://github.com/zhangdaiscott/autopoi)
83 95
84 96
85 97
  98 +#### 三、代码生成器
86 99
87 -- **代码生成器**  
88 -  
89 -** 功能说明**: 一键生成的代码(包括:controller、service、dao、mapper、entity、vue) 100 +> 功能说明: 一键生成的代码(包括:controller、service、dao、mapper、entity、vue)
90 101
91 - **模板位置**: src/main/resources/jeecg/code-template 102 + - 模板位置: src/main/resources/jeecg/code-template
  103 + - 技术文档: http://jeecg-boot.mydoc.io/?t=345685
92 104
93 -**使用方法**:  
94 -  
95 - 【**一对一模板**】  
96 -  
97 -**1.**先找到**jeecg-boot/src/resources/jeecg**下的  
98 -**jeecg_config.properties**和**jeecg_database.properties**两个文件。  
99 -**jeecg_config.properties:** 用来配置文件生成的路径,  
100 -  
101 -**jeecg_database.properties:** 用来配置数据库相关配置.  
102 -  
103 -  
104 -**2.**配置好这些配置之后,我们需要找到**jeecg-boot/src/main/java/org/jeecg/JeecgOneGUI.java**类,也就是启动一对一代码生成器的入口;  
105 -  
106 -  
107 -**3.**右键运行该类,紧接着会弹出一个窗口,如下图:  
108 - ![](https://static.oschina.net/uploads/img/201904/14222638_Svth.png)  
109 -  
110 -  
111 -**4.**然后根据窗口左侧的提示,在右侧填写对应的信息即可.  
112 -  
113 - 【**一对多模板**】  
114 -  
115 -  
116 -**1.**先找到**jeecg-boot/src/resources/jeecg**下的  
117 -  
118 -**jeecg_config.properties**和**jeecg_database.properties**两个文件。  
119 -  
120 -**jeecg_config.properties:** 是配置文件生成路径的,  
121 -  
122 -  
123 -**jeecg_database.properties:** 是配置数据库相关配置的文件。  
124 -  
125 -  
126 -**2.**接着我们需要找到**jeecg-boot/src/main/java/org/jeecg/JeecgOneToMainUtil.java**这个类。  
127 - 该类是生成一对多模板的启动入口。  
128 -  
129 -  
130 -**3.**该类中需要三个步骤来配置一对多表的信息。  
131 -  
132 -  
133 - (1) 第一步: 配置主表信息,代码如下:  
134 -  
135 -```  
136 - //第一步:设置主表配置  
137 - MainTableVo mainTable = new MainTableVo();  
138 - mainTable.setTableName("jeecg_order_main");//表名  
139 - mainTable.setEntityName("TestOrderMain"); //实体名  
140 - mainTable.setEntityPackage("test2"); //包名  
141 - mainTable.setFtlDescription("订单"); //描述  
142 -  
143 -```  
144 - (2) 第二步: 配置子表信息,**有多个则配置多个**, 代码如下:  
145 -  
146 - ①比如: 配置子表 1:  
147 -  
148 - ```  
149 - //第二步:设置子表集合配置  
150 - List<SubTableVo> subTables = new ArrayList<SubTableVo>();  
151 - //[1].子表一  
152 - SubTableVo po = new SubTableVo();  
153 - po.setTableName("jeecg_order_customer");//表名  
154 - po.setEntityName("TestOrderCustom"); //实体名  
155 - po.setEntityPackage("test2"); //包名  
156 - po.setFtlDescription("客户明细"); //描述  
157 - //子表外键参数配置  
158 - /*说明:  
159 - * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾;  
160 - * b) 主表和子表的外键字段名字,必须相同(除主键ID外);  
161 - * c) 多个外键字段,采用逗号分隔;  
162 - */  
163 - po.setForeignKeys(new String[]{"order_id"});  
164 - subTables.add(po);  
165 - ```  
166 - ②比如: 配置子表 2:  
167 -  
168 -```  
169 - //[2].子表二  
170 - SubTableVo po2 = new SubTableVo();  
171 - po2.setTableName("jeecg_order_ticket"); //表名  
172 - po2.setEntityName("TestOrderTicket"); //实体名  
173 - po2.setEntityPackage("test2"); //包名  
174 - po2.setFtlDescription("产品明细"); //描述  
175 - //子表外键参数配置  
176 - /*说明:  
177 - * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾;  
178 - * b) 主表和子表的外键字段名字,必须相同(除主键ID外);  
179 - * c) 多个外键字段,采用逗号分隔;  
180 - */  
181 - po2.setForeignKeys(new String[]{"order_id"});  
182 - subTables.add(po2);  
183 - ```  
184 - ③将整合了子表VO的subTables添加到主表对象当中去:  
185 105
186 -```  
187 - mainTable.setSubTables(subTables);  
188 - ```  
189 - ④需要注意如下代码,该代码的作用是,为子表设置主外键关联,当添加数据时,  
190 -主表的主键将会添加到子表的"order_id"中:  
191 -  
192 -```  
193 - po2.setForeignKeys(new String[]{"order_id"});  
194 - ```  
195 -  
196 - (3) 第三步: 启动(run)程序,生成代码, 代码如下:  
197 -  
198 - ```  
199 - //第三步:一对多(父子表)数据模型,代码生成  
200 - new CodeGenerateOneToMany(mainTable,subTables).generateCodeFile();  
201 - ```  
202 -  
203 -[在线文档](https://github.com/zhangdaiscott/autopoi)  
204 -  
205 106
206 -- **编码排重使用示例** 107 +#### 四、编码排重使用示例
207 108
208 重复校验效果: 109 重复校验效果:
209 ![输入图片说明](https://static.oschina.net/uploads/img/201904/19191836_eGkQ.png "在这里输入图片标题") 110 ![输入图片说明](https://static.oschina.net/uploads/img/201904/19191836_eGkQ.png "在这里输入图片标题")