代码生成增加搜索条件查询;

资金账户sql
beetlsql3-dev
Mlxa0324 2 years ago
parent 539ba7ba52
commit e19bc800d6

@ -1,5 +1,7 @@
package com.ibeetl.admin.core.web; package com.ibeetl.admin.core.web;
import cn.hutool.core.util.StrUtil;
import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.gen.*; import com.ibeetl.admin.core.gen.*;
import com.ibeetl.admin.core.gen.model.Attribute; import com.ibeetl.admin.core.gen.model.Attribute;
import com.ibeetl.admin.core.gen.model.Entity; import com.ibeetl.admin.core.gen.model.Entity;
@ -25,6 +27,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.stream.Collectors;
@Controller @Controller
public class CoreCodeGenController { public class CoreCodeGenController {
@ -34,9 +37,32 @@ public class CoreCodeGenController {
@Autowired @Autowired
CoreCodeGenService codeGenService; CoreCodeGenService codeGenService;
/**
*
*/
public class TableSearchQuery {
@Query(name = "表名称", display = true, fuzzy=true)
private String tableName;
@Query(name = "类名", display = true, fuzzy=true)
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
}
@GetMapping(MODEL + "/index.do") @GetMapping(MODEL + "/index.do")
public ModelAndView index() { public ModelAndView index() {
ModelAndView view = new ModelAndView("/core/codeGen/index.html"); ModelAndView view = new ModelAndView("/core/codeGen/index.html");
view.addObject("search", TableSearchQuery.class.getName());
return view; return view;
} }
@ -155,14 +181,15 @@ public class CoreCodeGenController {
return target; return target;
} }
@PostMapping(MODEL + "/table.json") @PostMapping(MODEL + "/table.json")
@ResponseBody @ResponseBody
public JsonResult<List<Entity>> getTable() { public JsonResult<List<Entity>> getTable(TableSearchQuery tableSearchQuery) {
List<Entity> list = codeGenService.getAllEntityInfo(); List<Entity> list = codeGenService.getAllEntityInfo();
return JsonResult.success(list); List<Entity> result = list.stream().filter(
item -> (StrUtil.isNotBlank(tableSearchQuery.getName()) && item.getName().contains(tableSearchQuery.getName()))
|| (StrUtil.isNotBlank(tableSearchQuery.getTableName()) && item.getTableName().contains(tableSearchQuery.getTableName())))
.collect(Collectors.toList());
return JsonResult.success(result);
} }
@PostMapping(MODEL + "/tableDetail.json") @PostMapping(MODEL + "/tableDetail.json")

@ -9,6 +9,10 @@ layui.define([ 'form', 'laydate', 'table','codeApi' ], function(exports) {
init:function(){ init:function(){
this.initTable(); this.initTable();
this.initToolBar(); this.initToolBar();
this.initSearchForm();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"), codeTable)
}
}, },
initTable:function(){ initTable:function(){
codeTable = table.render({ codeTable = table.render({
@ -41,6 +45,9 @@ layui.define([ 'form', 'laydate', 'table','codeApi' ], function(exports) {
}); });
}, },
initSearchForm() {
Lib.initSearchForm($("#searchForm"), codeTable, form);
},
initToolBar:function(){ initToolBar:function(){
toolbar = { toolbar = {
edit : function() { //获取选中数目 edit : function() { //获取选中数目

@ -1,9 +1,12 @@
<!--#layout("/common/layout.html",{"jsBase":"/js/core/codeGen/"}){ --> <!--#layout("/common/layout.html",{"jsBase":"/js/core/codeGen/"}){ -->
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
</layui:searchForm>
<div class="layui-btn-group"> <div class="layui-btn-group">
<layui:accessButton function="codeGen.edit" action="edit">编辑</layui:accessButton> <layui:accessButton function="codeGen.edit" action="edit">编辑</layui:accessButton>
<layui:accessButton function="codeGen.edit" action="refresh">刷新</layui:accessButton> <layui:accessButton function="codeGen.edit" action="refresh">刷新</layui:accessButton>
</div> </div>
<table id="codeTable" lay-filter="codeTable"></table> <table id="codeTable" lay-filter="codeTable"></table>
<!--#} --> <!--#} -->
<script> <script>

@ -0,0 +1,51 @@
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
drop table if exists student_account_asset_allocation;
CREATE TABLE `student_account_asset_allocation` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`student_id` bigint(20) DEFAULT NULL COMMENT '学生ID',
`application_id` bigint(20) DEFAULT NULL COMMENT '应用ID',
`universities_colleges_id` bigint(20) DEFAULT NULL COMMENT '院校ID',
`name` decimal(15,0) DEFAULT NULL COMMENT '账户名称',
`state` tinyint(2) DEFAULT NULL COMMENT '账户开通状态 1未开通 2已开通',
`initial_capital` decimal(15,0) DEFAULT NULL COMMENT '期初资金',
`available_funds` decimal(15,0) DEFAULT NULL COMMENT '可用资金',
`into_account` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '转入账户',
`transfer_amount` decimal(15,0) DEFAULT NULL COMMENT '转账金额',
`transferIn_amount` decimal(15,0) DEFAULT NULL COMMENT '转入金额',
`transfer_out_amount` decimal(15,0) DEFAULT NULL COMMENT '转出金额',
`initial_investment_capital` decimal(15,0) DEFAULT NULL COMMENT '期初投资资金',
`borrowed_funds` decimal(15,0) DEFAULT NULL COMMENT '借入资金',
`investment_funds` decimal(15,0) DEFAULT NULL COMMENT '投资资金',
`investment_value` decimal(15,0) DEFAULT NULL COMMENT '投资市值',
`investment_income` decimal(15,0) DEFAULT NULL COMMENT '投资收益',
`total_assets_of_sub_accounts` decimal(15,0) DEFAULT NULL COMMENT '子账户总资产',
`asset_Investment` decimal(15,0) DEFAULT NULL COMMENT '总资产投资收益率',
`return_on_equity` decimal(15,0) DEFAULT NULL COMMENT '净资产收益率',
`is_update` tinyint(2) DEFAULT NULL COMMENT '是否给予初始值 1未给 2已给',
`amount_frozen` decimal(15,0) DEFAULT NULL COMMENT '冻结金额',
`update_version` bigint(20) DEFAULT NULL COMMENT '乐观锁',
`update_by` bigint(20) DEFAULT NULL COMMENT '修改人',
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`is_del` tinyint(2) DEFAULT '0' COMMENT '是否删除 0未删除1删除',
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`org_id` bigint(20) DEFAULT NULL COMMENT '机构ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='学生资产账户';
drop table if exists student_account_trading_record_sheet;
CREATE TABLE `student_account_trading_record_sheet` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`transaction_amount` decimal(15,0) DEFAULT NULL COMMENT '转入金额',
`transfer_type` varchar(255) DEFAULT NULL COMMENT '转入类型',
`exit_type` varchar(255) DEFAULT NULL COMMENT '转出类型',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`student_id` bigint(20) DEFAULT NULL COMMENT '学生ID',
`user_Id` bigint(20) DEFAULT NULL COMMENT '用户ID',
`org_id` bigint(20) DEFAULT NULL COMMENT '机构ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='学生资产账户交易流水';
Loading…
Cancel
Save