123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- -- 数据源管理
- CREATE TABLE gen_datasource (
- id bigint NOT NULL COMMENT 'id',
- db_type varchar(200) COMMENT '数据库类型 MySQL、Oracle、SQLServer、PostgreSQL',
- conn_name varchar(200) NOT NULL COMMENT '连接名',
- conn_url varchar(500) COMMENT 'URL',
- username varchar(200) COMMENT '用户名',
- password varchar(200) COMMENT '密码',
- status tinyint COMMENT '状态 0:启用 1:禁用',
- create_date datetime COMMENT '创建时间',
- primary key (id)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='数据源管理';
- -- 字段类型管理
- CREATE TABLE gen_field_type (
- id bigint NOT NULL COMMENT 'id',
- column_type varchar(200) COMMENT '字段类型',
- attr_type varchar(200) COMMENT '属性类型',
- package_name varchar(200) COMMENT '属性包名',
- create_date datetime COMMENT '创建时间',
- primary key (id),
- unique key (column_type)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='字段类型管理';
- -- 基类管理
- CREATE TABLE gen_base_class (
- id bigint NOT NULL COMMENT 'id',
- package_name varchar(200) COMMENT '基类包名',
- code varchar(200) COMMENT '基类编码',
- fields varchar(500) COMMENT '基类字段,多个用英文逗号分隔',
- remark varchar(200) COMMENT '备注',
- create_date datetime COMMENT '创建时间',
- primary key (id)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基类管理';
- -- 代码生成表
- CREATE TABLE gen_table_info (
- id bigint NOT NULL COMMENT 'id',
- table_name varchar(200) COMMENT '表名',
- class_name varchar(200) COMMENT '类名',
- table_comment varchar(200) COMMENT '功能名',
- author varchar(200) COMMENT '作者',
- email varchar(200) COMMENT '邮箱',
- package_name varchar(200) COMMENT '项目包名',
- version varchar(200) COMMENT '项目版本号',
- backend_path varchar(500) COMMENT '后端生成路径',
- frontend_path varchar(500) COMMENT '前端生成路径',
- module_name varchar(200) COMMENT '模块名',
- sub_module_name varchar(200) COMMENT '子模块名',
- datasource_id bigint COMMENT '数据源ID',
- baseclass_id bigint COMMENT '基类ID',
- create_date datetime COMMENT '创建时间',
- primary key (id),
- unique key (table_name)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='代码生成表';
- -- 代码生成表列
- CREATE TABLE gen_table_field (
- id bigint NOT NULL COMMENT 'id',
- table_id bigint COMMENT '表ID',
- table_name varchar(200) COMMENT '表名',
- column_name varchar(200) COMMENT '列名',
- column_type varchar(200) COMMENT '类型',
- column_comment varchar(200) COMMENT '列说明',
- attr_name varchar(200) COMMENT '属性名',
- attr_type varchar(200) COMMENT '属性类型',
- package_name varchar(200) COMMENT '属性包名',
- is_pk tinyint COMMENT '是否主键 0:否 1:是',
- is_required tinyint COMMENT '是否必填 0:否 1:是',
- is_form tinyint COMMENT '是否表单字段 0:否 1:是',
- is_list tinyint COMMENT '是否列表字段 0:否 1:是',
- is_query tinyint COMMENT '是否查询字段 0:否 1:是',
- query_type varchar(200) COMMENT '查询方式',
- form_type varchar(200) COMMENT '表单类型',
- dict_name varchar(200) COMMENT '字典名称',
- validator_type varchar(200) COMMENT '效验方式',
- sort int COMMENT '排序',
- primary key (id),
- key (table_name)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='代码生成表列';
- -- 模板管理
- CREATE TABLE gen_template (
- id bigint NOT NULL COMMENT 'id',
- name varchar(200) COMMENT '名称',
- file_name varchar(200) COMMENT '文件名',
- content mediumtext NOT NULL COMMENT '内容',
- path varchar(500) COMMENT '生成路径',
- status tinyint COMMENT '状态 0:启用 1:禁用',
- create_date datetime COMMENT '创建时间',
- primary key (id)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='模板管理';
- CREATE TABLE gen_test_data (
- id bigint NOT NULL COMMENT 'id',
- username varchar(50) COMMENT '用户名',
- real_name varchar(50) COMMENT '姓名',
- gender tinyint unsigned COMMENT '性别',
- email varchar(100) COMMENT '邮箱',
- notice_type tinyint COMMENT '类型',
- content text COMMENT '内容',
- creator bigint COMMENT '创建者',
- create_date datetime COMMENT '创建时间',
- updater bigint COMMENT '更新者',
- update_date datetime COMMENT '更新时间',
- PRIMARY KEY (id)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='测试功能';
- INSERT INTO sys_menu(id, pid, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1302850622416084993, 0, '', '', 0, 'icon-rocket', 3, 1067246875800000001, now(), 1067246875800000001, now());
- INSERT INTO sys_menu(id, pid, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1302850783288614913, 1305532398162145281, 'devtools/datasource', '', 0, 'icon-sync', 0, 1067246875800000001, now(), 1067246875800000001, now());
- INSERT INTO sys_menu(id, pid, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1302862890696564738, 1305532398162145281, 'devtools/fieldtype', '', 0, 'icon-eye', 1, 1067246875800000001, now(), 1067246875800000001, now());
- INSERT INTO sys_menu(id, pid, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1302874751835848705, 1305532398162145281, 'devtools/baseclass', '', 0, 'icon-info-circle', 3, 1067246875800000001, now(), 1067246875800000001, now());
- INSERT INTO sys_menu(id, pid, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1304081184014635010, 1305532398162145281, 'devtools/template', '', 0, 'icon-up-circle', 3, 1067246875800000001, now(), 1067246875800000001, now());
- INSERT INTO sys_menu(id, pid, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1304802103569809410, 1302850622416084993, 'devtools/generator', '', 0, 'icon-tags', 0, 1067246875800000001, now(), 1067246875800000001, now());
- INSERT INTO sys_menu(id, pid, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1305513187675144193, 1305532398162145281, 'devtools/param', '', 0, 'icon-setting', 5, 1067246875800000001, now(), 1067246875800000001, now());
- INSERT INTO sys_menu(id, pid, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1305532398162145281, 1302850622416084993, '', '', 0, 'icon-setting', 3, 1067246875800000001, now(), 1067246875800000001, now());
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302850622416084993, 'name', 'DevTools', 'en-US');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302850622416084993, 'name', '开发者工具', 'zh-CN');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302850622416084993, 'name', '開發者工具', 'zh-TW');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302850783288614913, 'name', 'DataSource', 'en-US');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302850783288614913, 'name', '数据源管理', 'zh-CN');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302850783288614913, 'name', '數據源管理', 'zh-TW');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302862890696564738, 'name', 'Field Management', 'en-US');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302862890696564738, 'name', '字段管理', 'zh-CN');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302862890696564738, 'name', '字段管理', 'zh-TW');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302874751835848705, 'name', 'BaseClass', 'en-US');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302874751835848705, 'name', '基类管理', 'zh-CN');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1302874751835848705, 'name', '基類管理', 'zh-TW');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1304081184014635010, 'name', 'Template', 'en-US');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1304081184014635010, 'name', '模板管理', 'zh-CN');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1304081184014635010, 'name', '模板管理', 'zh-TW');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1304802103569809410, 'name', 'Code Generation', 'en-US');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1304802103569809410, 'name', '代码生成工具', 'zh-CN');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1304802103569809410, 'name', '代碼生成工具', 'zh-TW');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1305513187675144193, 'name', 'Parameter Config', 'en-US');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1305513187675144193, 'name', '参数配置', 'zh-CN');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1305513187675144193, 'name', '參數配置', 'zh-TW');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1305532398162145281, 'name', 'Config Info', 'en-US');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1305532398162145281, 'name', '配置信息', 'zh-CN');
- INSERT INTO sys_language(table_name, table_id, field_name, field_value, language) VALUES ('sys_menu', 1305532398162145281, 'name', '配置信息', 'zh-TW');
- INSERT INTO sys_params(id, param_code, param_value, param_type, remark, creator, create_date, updater, update_date) VALUES (1067246875800000072, 'DEV_TOOLS_PARAM_KEY', '{"packageName":"com.eitc","version":"3.0","author":"Mark","email":"eitc@163.com","backendPath":"D:\\\\adminio\\\\eitc-erm-tenant\\\\eitc-admin","frontendPath":"D:\\\\adminio\\\\eitc-erm-tenant-admin"}', 0, '代码生成器配置信息', 1067246875800000001, now(), 1067246875800000001, now());
- INSERT INTO gen_base_class(id, package_name, code, fields, remark, create_date) VALUES (1302875019642159105, '${package}.common.entity.BaseEntity', 'BaseEntity', 'id,creator,create_date', '专业版', now());
- INSERT INTO gen_datasource(id, db_type, conn_name, conn_url, username, password, status, create_date) VALUES (1302855887882412034, 'MySQL', '本地', 'jdbc:mysql://localhost:3306/security_enterprise?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true', 'admin', '123456', 0, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152452777352425473, 'datetime', 'Date', 'java.util.Date', now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152453412995002369, 'date', 'Date', 'java.util.Date', now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152453603525455873, 'tinyint', 'Integer', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152453660052090881, 'smallint', 'Integer', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152453722136178689, 'mediumint', 'Integer', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152453808874385409, 'int', 'Integer', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152453849735294977, 'integer', 'Integer', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152453895029583873, 'bigint', 'Long', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152453931373228033, 'float', 'Float', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152453967880450050, 'double', 'Double', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454047601586177, 'decimal', 'BigDecimal', 'java.math.BigDecimal', now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454090760974338, 'bit', 'Boolean', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454147010785282, 'char', 'String', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454183136325633, 'varchar', 'String', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454312664821761, 'tinytext', 'String', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454343820111874, 'text', 'String', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454372077137921, 'mediumtext', 'String', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454401378545665, 'longtext', 'String', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454486267064322, 'timestamp', 'Date', 'java.util.Date', now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454630295269378, 'NUMBER', 'Integer', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454715645161474, 'BINARY_INTEGER', 'Integer', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454778828156930, 'BINARY_FLOAT', 'Float', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454828987838466, 'BINARY_DOUBLE', 'Double', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454885745160193, 'VARCHAR2', 'String', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454919756771329, 'NVARCHAR', 'String', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454952568811521, 'NVARCHAR2', 'String', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152454986349735938, 'CLOB', 'String', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152455109695827970, 'int8', 'Long', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152455153002016770, 'int4', 'Integer', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152455184669011969, 'int2', 'Integer', NULL, now());
- INSERT INTO gen_field_type(id, column_type, attr_type, package_name, create_date) VALUES (1152455217359417345, 'numeric', 'BigDecimal', 'java.math.BigDecimal', now());
- INSERT INTO gen_table_info(id, table_name, class_name, table_comment, author, email, package_name, version, backend_path, frontend_path, module_name, sub_module_name, datasource_id, baseclass_id, create_date) VALUES (1308327671447859201, 'gen_test_data', 'TestData', '测试功能', 'Mark', 'eitc@163.com', 'com.eitc', '3.0', 'D:\\adminio\\eitc-erm-tenant\\eitc-admin', 'D:\\adminio\\eitc-erm-tenant-admin', 'gen', NULL, 0, 1302875019642159105, now());
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671502385153, 1308327671447859201, 'gen_test_data', 'id', 'BIGINT', 'id', 'id', 'Long', NULL, 1, 0, 0, 0, 0, '=', 'text', NULL, NULL, 0);
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671510773761, 1308327671447859201, 'gen_test_data', 'username', 'VARCHAR', '用户名', 'username', 'String', NULL, 0, 1, 1, 1, 1, 'like', 'text', NULL, NULL, 1);
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671510773762, 1308327671447859201, 'gen_test_data', 'real_name', 'VARCHAR', '姓名', 'realName', 'String', NULL, 0, 1, 1, 1, 0, 'like', 'text', NULL, NULL, 2);
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671510773763, 1308327671447859201, 'gen_test_data', 'gender', 'TINYINT', '性别', 'gender', 'Integer', NULL, 0, 1, 1, 1, 1, '=', 'select', 'gender', NULL, 3);
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671510773764, 1308327671447859201, 'gen_test_data', 'email', 'VARCHAR', '邮箱', 'email', 'String', NULL, 0, 1, 1, 1, 0, '=', 'text', NULL, NULL, 4);
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671514968065, 1308327671447859201, 'gen_test_data', 'notice_type', 'TINYINT', '类型', 'noticeType', 'Integer', NULL, 0, 1, 1, 1, 0, '=', 'radio', 'notice_type', NULL, 5);
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671514968066, 1308327671447859201, 'gen_test_data', 'content', 'TEXT', '内容', 'content', 'String', NULL, 0, 1, 1, 0, 0, '=', 'editor', NULL, NULL, 6);
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671514968067, 1308327671447859201, 'gen_test_data', 'creator', 'BIGINT', '创建者', 'creator', 'Long', NULL, 0, 0, 0, 0, 0, '=', 'text', NULL, NULL, 7);
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671514968068, 1308327671447859201, 'gen_test_data', 'create_date', 'DATETIME', '创建时间', 'createDate', 'Date', 'java.util.Date', 0, 0, 0, 1, 1, '=', 'date', NULL, NULL, 8);
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671514968069, 1308327671447859201, 'gen_test_data', 'updater', 'BIGINT', '更新者', 'updater', 'Long', NULL, 0, 0, 0, 0, 0, '=', 'text', NULL, NULL, 9);
- INSERT INTO gen_table_field(id, table_id, table_name, column_name, column_type, column_comment, attr_name, attr_type, package_name, is_pk, is_required, is_form, is_list, is_query, query_type, form_type, dict_name, validator_type, sort) VALUES (1308327671523356674, 1308327671447859201, 'gen_test_data', 'update_date', 'DATETIME', '更新时间', 'updateDate', 'Date', 'java.util.Date', 0, 0, 0, 0, 0, '=', 'text', NULL, NULL, 10);
- INSERT INTO gen_template(id, name, content, file_name, path, status, create_date) VALUES (1151104918417948674, 'Dao.java', 'package ${package}.modules.${moduleName}.dao<#if subModuleName??>.${subModuleName}</#if>;\n\nimport ${package}.common.dao.BaseDao;\nimport ${package}.modules.${moduleName}.entity<#if subModuleName??>.${subModuleName}</#if>.${ClassName}Entity;\nimport org.apache.ibatis.annotations.Mapper;\n\n/**\n* ${tableComment}\n*\n* @author ${author} ${email}\n* @since ${version} ${date}\n*/\n@Mapper\npublic interface ${ClassName}Dao extends BaseDao<${ClassName}Entity> {\n \n}', '${ClassName}Dao.java', '${backendPath}/src/main/java/${packagePath}/modules/${moduleName}/dao/${subModuleName!}', 0, now());
- INSERT INTO gen_template(id, name, content, file_name, path, status, create_date) VALUES (1222102542519422977, 'Dao.xml', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n\n<mapper namespace=\"${package}.modules.${moduleName}.dao<#if subModuleName??>.${subModuleName}</#if>.${ClassName}Dao\">\n\n <resultMap type=\"${package}.modules.${moduleName}.entity<#if subModuleName??>.${subModuleName}</#if>.${ClassName}Entity\" id=\"${className}Map\">\n <#list columnList as column>\n <result property=\"${column.attrName}\" column=\"${column.columnName}\"/>\n </#list>\n </resultMap>\n\n</mapper>', '${ClassName}Dao.xml', '${backendPath}/src/main/resources/mapper/${moduleName}', 0, now());
- INSERT INTO gen_template(id, name, content, file_name, path, status, create_date) VALUES (1222811087900602369, 'Service.java', 'package ${package}.modules.${moduleName}.service<#if subModuleName??>.${subModuleName}</#if>;\n\nimport ${package}.common.service.CrudService;\nimport ${package}.modules.${moduleName}.dto<#if subModuleName??>.${subModuleName}</#if>.${ClassName}DTO;\nimport ${package}.modules.${moduleName}.entity<#if subModuleName??>.${subModuleName}</#if>.${ClassName}Entity;\n\n/**\n * ${tableComment}\n *\n * @author ${author} ${email}\n * @since ${version} ${date}\n */\npublic interface ${ClassName}Service extends CrudService<${ClassName}Entity, ${ClassName}DTO> {\n\n}', '${ClassName}Service.java', '${backendPath}/src/main/java/${packagePath}/modules/${moduleName}/service/${subModuleName!}', 0, now());
- INSERT INTO gen_template(id, name, file_name, content, path, status, create_date) VALUES (1222814109661753346, 'Excel.java', '${ClassName}Excel.java', 'package ${package}.modules.${moduleName}.excel<#if subModuleName??>.${subModuleName}</#if>;\n\nimport com.alibaba.excel.annotation.ExcelProperty;\nimport com.alibaba.excel.annotation.write.style.ColumnWidth;\nimport com.alibaba.excel.annotation.write.style.ContentRowHeight;\nimport com.alibaba.excel.annotation.write.style.HeadRowHeight;\nimport lombok.Data;\n<#list imports as i>\nimport ${i!};\n</#list>\n\n/**\n * ${tableComment}\n *\n * @author ${author} ${email}\n * @since ${version} ${date}\n */\n@Data\n@ContentRowHeight(20)\n@HeadRowHeight(20)\n@ColumnWidth(25)\npublic class ${ClassName}Excel {\n<#assign index = 0>\n<#list columnList as column>\n<#if column.list>\n <#if column.comment!?length gt 0>\n @ExcelProperty(value = \"${column.comment}\", index = ${index})\n <#else>\n @ExcelProperty(value = \"${column.attrType}\", index = ${index})\n </#if>\n private ${column.attrType} ${column.attrName};\n <#assign index = index+1>\n</#if> \n</#list>\n}', '${backendPath}/src/main/java/${packagePath}/modules/${moduleName}/excel/${subModuleName!}', 0, now());
- INSERT INTO gen_template(id, name, content, file_name, path, status, create_date) VALUES (1222816187301851138, 'DTO.java', 'package ${package}.modules.${moduleName}.dto<#if subModuleName??>.${subModuleName}</#if>;\n\nimport io.swagger.annotations.ApiModel;\nimport io.swagger.annotations.ApiModelProperty;\nimport lombok.Data;\n\nimport java.io.Serializable;\n<#list imports as i>\nimport ${i!};\n</#list>\n\n/**\n* ${tableComment}\n*\n* @author ${author} ${email}\n* @since ${version} ${date}\n*/\n@Data\n@ApiModel(value = \"${tableComment}\")\npublic class ${ClassName}DTO implements Serializable {\n private static final long serialVersionUID = 1L;\n\n<#list columnList as column>\n <#if column.comment!?length gt 0>\n @ApiModelProperty(value = \"${column.comment}\")\n </#if>\n private ${column.attrType} ${column.attrName};\n</#list>\n\n}', '${ClassName}DTO.java', '${backendPath}/src/main/java/${packagePath}/modules/${moduleName}/dto/${subModuleName!}', 0, now());
- INSERT INTO gen_template(id, name, content, file_name, path, status, create_date) VALUES (1222817622663983106, 'Controller.java', 'package ${package}.modules.${moduleName}.controller<#if subModuleName??>.${subModuleName}</#if>;\n\nimport ${package}.common.annotation.LogOperation;\nimport ${package}.common.constant.Constant;\nimport ${package}.common.page.PageData;\nimport ${package}.common.utils.ExcelUtils;\nimport ${package}.common.utils.Result;\nimport ${package}.common.validator.AssertUtils;\nimport ${package}.common.validator.ValidatorUtils;\nimport ${package}.common.validator.group.AddGroup;\nimport ${package}.common.validator.group.DefaultGroup;\nimport ${package}.common.validator.group.UpdateGroup;\nimport ${package}.modules.${moduleName}.dto<#if subModuleName??>.${subModuleName}</#if>.${ClassName}DTO;\nimport ${package}.modules.${moduleName}.excel<#if subModuleName??>.${subModuleName}</#if>.${ClassName}Excel;\nimport ${package}.modules.${moduleName}.service<#if subModuleName??>.${subModuleName}</#if>.${ClassName}Service;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport org.apache.shiro.authz.annotation.RequiresPermissions;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\nimport springfox.documentation.annotations.ApiIgnore;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.List;\nimport java.util.Map;\n\n\n/**\n* ${tableComment}\n*\n* @author ${author} ${email}\n* @since ${version} ${date}\n*/\n@RestController\n@RequestMapping(\"${moduleName}/${classname}\")\n@Api(tags=\"${tableComment}\")\npublic class ${ClassName}Controller {\n @Autowired\n private ${ClassName}Service ${className}Service;\n\n @GetMapping(\"page\")\n @ApiOperation(\"分页\")\n @ApiImplicitParams({\n @ApiImplicitParam(name = Constant.PAGE, value = \"当前页码,从1开始\", paramType = \"query\", required = true, dataType=\"int\") ,\n @ApiImplicitParam(name = Constant.LIMIT, value = \"每页显示记录数\", paramType = \"query\",required = true, dataType=\"int\") ,\n @ApiImplicitParam(name = Constant.ORDER_FIELD, value = \"排序字段\", paramType = \"query\", dataType=\"String\") ,\n @ApiImplicitParam(name = Constant.ORDER, value = \"排序方式,可选值(asc、desc)\", paramType = \"query\", dataType=\"String\")\n })\n @RequiresPermissions(\"${moduleName}:${classname}:page\")\n public Result<PageData<${ClassName}DTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){\n PageData<${ClassName}DTO> page = ${className}Service.page(params);\n\n return new Result<PageData<${ClassName}DTO>>().ok(page);\n }\n\n @GetMapping(\"{id}\")\n @ApiOperation(\"信息\")\n @RequiresPermissions(\"${moduleName}:${classname}:info\")\n public Result<${ClassName}DTO> get(@PathVariable(\"id\") Long id){\n ${ClassName}DTO data = ${className}Service.get(id);\n\n return new Result<${ClassName}DTO>().ok(data);\n }\n\n @PostMapping\n @ApiOperation(\"保存\")\n @LogOperation(\"保存\")\n @RequiresPermissions(\"${moduleName}:${classname}:save\")\n public Result save(@RequestBody ${ClassName}DTO dto){\n //效验数据\n ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);\n\n ${className}Service.save(dto);\n\n return new Result();\n }\n\n @PutMapping\n @ApiOperation(\"修改\")\n @LogOperation(\"修改\")\n @RequiresPermissions(\"${moduleName}:${classname}:update\")\n public Result update(@RequestBody ${ClassName}DTO dto){\n //效验数据\n ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);\n\n ${className}Service.update(dto);\n\n return new Result();\n }\n\n @DeleteMapping\n @ApiOperation(\"删除\")\n @LogOperation(\"删除\")\n @RequiresPermissions(\"${moduleName}:${classname}:delete\")\n public Result delete(@RequestBody Long[] ids){\n //效验数据\n AssertUtils.isArrayEmpty(ids, \"id\");\n\n ${className}Service.delete(ids);\n\n return new Result();\n }\n\n @GetMapping(\"export\")\n @ApiOperation(\"导出\")\n @LogOperation(\"导出\")\n @RequiresPermissions(\"${moduleName}:${classname}:export\")\n public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {\n List<${ClassName}DTO> list = ${className}Service.list(params);\n\n ExcelUtils.exportExcelToTarget(response, null, \"${tableComment}\", list, ${ClassName}Excel.class);\n }\n\n}', '${ClassName}Controller.java', '${backendPath}/src/main/java/${packagePath}/modules/${moduleName}/controller/${subModuleName!}', 0, now());
- INSERT INTO gen_template(id, name, content, file_name, path, status, create_date) VALUES (1304292858898309122, 'list.vue', '<template>\r\n <el-card shadow=\"never\" class=\"aui-card--fill\">\r\n <div class=\"mod-${moduleName}__${classname}\">\r\n <el-form :inline=\"true\" :model=\"dataForm\" @keyup.enter.native=\"getDataList()\">\r\n <#list columnList as column>\r\n <#if column.query>\r\n <el-form-item>\r\n <#if column.formType == \'text\' || column.formType == \'textarea\' || column.formType == \'editor\'>\r\n <el-input v-model=\"dataForm.${column.attrName}\" placeholder=\"${column.comment!}\" clearable></el-input>\r\n <#elseif column.formType == \'select\'>\r\n <#if column.dictName??>\r\n <ren-select v-model=\"dataForm.${column.attrName}\" dict-type=\"${column.dictName}\" placeholder=\"${column.comment!}\"></ren-select>\r\n <#else>\r\n <el-select v-model=\"dataForm.${column.attrName}\" placeholder=\"${column.comment!}\"> \r\n <el-option label=\"选择\" value=\"0\"></el-option>\r\n </el-select>\r\n </#if>\r\n <#elseif column.formType == \'radio\'>\r\n <#if column.dictName??>\r\n <ren-radio-group v-model=\"dataForm.${column.attrName}\" dict-type=\"${column.dictName}\"></ren-radio-group>\r\n <#else>\r\n <el-radio-group v-model=\"dataForm.${column.attrName}\">\r\n <el-radio :label=\"0\">单选</el-radio>\r\n </el-radio-group>\r\n </#if>\r\n <#elseif column.formType == \'date\'>\r\n <el-date-picker\r\n v-model=\"daterange\"\r\n type=\"daterange\"\r\n value-format=\"yyyy-MM-dd\"\r\n :range-separator=\"$t(\'datePicker.range\')\"\r\n :start-placeholder=\"$t(\'datePicker.start\')\"\r\n :end-placeholder=\"$t(\'datePicker.end\')\">\r\n </el-date-picker>\r\n <#elseif column.formType == \'datetime\'>\r\n <el-date-picker\r\n v-model=\"datetimerange\"\r\n type=\"datetimerange\"\r\n value-format=\"yyyy-MM-dd HH:mm:ss\"\r\n :range-separator=\"$t(\'datePicker.range\')\"\r\n :start-placeholder=\"$t(\'datePicker.start\')\"\r\n :end-placeholder=\"$t(\'datePicker.end\')\">\r\n </el-date-picker>\r\n <#else>\r\n <el-input v-model=\"dataForm.${column.attrName}\" placeholder=\"${column.comment!}\" clearable></el-input>\r\n </#if>\r\n </el-form-item>\r\n </#if>\r\n </#list>\r\n <el-form-item>\r\n <el-button @click=\"getDataList()\">{{ $t(\'query\') }}</el-button>\r\n </el-form-item>\r\n <el-form-item>\r\n <el-button type=\"info\" @click=\"exportHandle()\">{{ $t(\'export\') }}</el-button>\r\n </el-form-item>\r\n <el-form-item>\r\n <el-button v-if=\"$hasPermission(\'${moduleName}:${classname}:save\')\" type=\"primary\" @click=\"addOrUpdateHandle()\">{{ $t(\'add\') }}</el-button>\r\n </el-form-item>\r\n <el-form-item>\r\n <el-button v-if=\"$hasPermission(\'${moduleName}:${classname}:delete\')\" type=\"danger\" @click=\"deleteHandle()\">{{ $t(\'deleteBatch\') }}</el-button>\r\n </el-form-item>\r\n </el-form>\r\n <el-table v-loading=\"dataListLoading\" :data=\"dataList\" border @selection-change=\"dataListSelectionChangeHandle\" style=\"width: 100%;\">\r\n <el-table-column type=\"selection\" header-align=\"center\" align=\"center\" width=\"50\"></el-table-column>\r\n<#list columnList as column>\r\n<#if column.list>\r\n <#if column.dictName??>\r\n <el-table-column prop=\"${column.attrName}\" label=\"${column.comment!}\" header-align=\"center\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n {{ $getDictLabel(\"${column.dictName}\", scope.row.${column.attrName}) }}\r\n </template>\r\n </el-table-column>\r\n <#else>\r\n <el-table-column prop=\"${column.attrName}\" label=\"${column.comment!}\" header-align=\"center\" align=\"center\"></el-table-column>\r\n </#if>\r\n</#if>\r\n</#list>\r\n <el-table-column :label=\"$t(\'handle\')\" fixed=\"right\" header-align=\"center\" align=\"center\" width=\"150\">\r\n <template slot-scope=\"scope\">\r\n <el-button v-if=\"$hasPermission(\'${moduleName}:${classname}:update\')\" type=\"text\" size=\"small\" @click=\"addOrUpdateHandle(scope.row.id)\">{{ $t(\'update\') }}</el-button>\r\n <el-button v-if=\"$hasPermission(\'${moduleName}:${classname}:delete\')\" type=\"text\" size=\"small\" @click=\"deleteHandle(scope.row.id)\">{{ $t(\'delete\') }}</el-button>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n <el-pagination\r\n :current-page=\"page\"\r\n :page-sizes=\"[10, 20, 50, 100]\"\r\n :page-size=\"limit\"\r\n :total=\"total\"\r\n layout=\"total, sizes, prev, pager, next, jumper\"\r\n @size-change=\"pageSizeChangeHandle\"\r\n @current-change=\"pageCurrentChangeHandle\">\r\n </el-pagination>\r\n <!-- 弹窗, 新增 / 修改 -->\r\n <add-or-update v-if=\"addOrUpdateVisible\" ref=\"addOrUpdate\" @refreshDataList=\"getDataList\"></add-or-update>\r\n </div>\r\n </el-card>\r\n</template>\r\n\r\n<script>\r\nimport mixinViewModule from \'@/mixins/view-module\'\r\nimport AddOrUpdate from \'./${classname}-add-or-update\'\r\nexport default {\r\n mixins: [mixinViewModule],\r\n data () {\r\n return {\r\n mixinViewModuleOptions: {\r\n getDataListURL: \'/${moduleName}/${classname}/page\',\r\n getDataListIsPage: true,\r\n exportURL: \'/${moduleName}/${classname}/export\',\r\n deleteURL: \'/${moduleName}/${classname}\',\r\n deleteIsBatch: true\r\n },\r\n <#list columnList as column>\r\n <#if column.query>\r\n <#if column.formType == \'date\'>\r\n daterange: null,\r\n <#elseif column.formType == \'datetime\'>\r\n datetimerange: null,\r\n </#if>\r\n </#if>\r\n </#list>\r\n dataForm: {\r\n <#list columnList as column>\r\n <#if column.query>\r\n <#if column.formType == \'date\'>\r\n startDate: \'\',\r\n endDate: \'\',\r\n <#elseif column.formType == \'datetime\'>\r\n startDateTime: \'\',\r\n endDateTime: \'\',\r\n <#else>\r\n ${column.attrName}: \'\',\r\n </#if>\r\n </#if>\r\n </#list>\r\n }\r\n }\r\n },\r\n watch: {\r\n <#list columnList as column>\r\n <#if column.query>\r\n <#if column.formType == \'date\'>\r\n daterange (val) {\r\n if (val == null) {\r\n this.dataForm.startDate = null\r\n this.dataForm.endDate = null\r\n } else {\r\n this.dataForm.startDate = val[0]\r\n this.dataForm.endDate = val[1]\r\n }\r\n },\r\n <#elseif column.formType == \'datetime\'>\r\n datetimerange (val) {\r\n if (val == null) {\r\n this.dataForm.startDateTime = null\r\n this.dataForm.endDateTime = null\r\n } else {\r\n this.dataForm.startDateTime = val[0]\r\n this.dataForm.endDateTime = val[1]\r\n }\r\n },\r\n </#if>\r\n </#if>\r\n </#list>\r\n },\r\n components: {\r\n AddOrUpdate\r\n }\r\n}\r\n</script>\r\n', '${classname}.vue', '${frontendPath}/src/views/modules/${moduleName}', 0, now());
- INSERT INTO gen_template(id, name, content, file_name, path, status, create_date) VALUES (1304293015698169857, 'add-or-update.vue', '<#assign editor=false/>\r\n<template>\r\n <el-dialog :visible.sync=\"visible\" :title=\"!dataForm.${pk.attrName} ? $t(\'add\') : $t(\'update\')\" :close-on-click-modal=\"false\" :close-on-press-escape=\"false\">\r\n <el-form :model=\"dataForm\" :rules=\"dataRule\" ref=\"dataForm\" @keyup.enter.native=\"dataFormSubmitHandle()\" :label-width=\"$i18n.locale === \'en-US\' ? \'120px\' : \'80px\'\">\r\n<#list columnList as column>\r\n <#if column.form>\r\n <#if column.formType == \'text\'>\r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <el-input v-model=\"dataForm.${column.attrName}\" placeholder=\"${column.comment!}\"></el-input>\r\n </el-form-item>\r\n <#elseif column.formType == \'textarea\'>\r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <el-input type=\"textarea\" v-model=\"dataForm.${column.attrName}\"></el-input>\r\n </el-form-item>\r\n <#elseif column.formType == \'editor\'>\r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <!-- 富文本编辑器, 容器 -->\r\n <div id=\"J_quillEditor\"></div>\r\n <!-- 自定义上传图片功能 (使用element upload组件) -->\r\n <el-upload\r\n :action=\"uploadUrl\"\r\n :show-file-list=\"false\"\r\n :before-upload=\"uploadBeforeUploadHandle\"\r\n :on-success=\"uploadSuccessHandle\"\r\n style=\"display: none;\">\r\n <el-button ref=\"uploadBtn\" type=\"primary\" size=\"small\">{{ $t(\'upload.button\') }}</el-button>\r\n </el-upload>\r\n </el-form-item>\r\n <#assign editor=true/>\r\n <#assign editorName=\"${column.attrName}\"/>\r\n <#elseif column.formType == \'select\'>\r\n <#if column.dictName??> \r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <ren-select v-model=\"dataForm.${column.attrName}\" dict-type=\"${column.dictName}\" placeholder=\"${column.comment!}\"></ren-select>\r\n </el-form-item>\r\n <#else>\r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <el-select v-model=\"dataForm.${column.attrName}\" placeholder=\"请选择\">\r\n <el-option label=\"智汇口腔\" value=\"0\"></el-option>\r\n </el-select>\r\n </el-form-item>\r\n </#if>\r\n <#elseif column.formType == \'radio\'>\r\n <#if column.dictName??> \r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <ren-radio-group v-model=\"dataForm.${column.attrName}\" dict-type=\"${column.dictName}\"></ren-radio-group>\r\n </el-form-item>\r\n <#else>\r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <el-radio-group v-model=\"dataForm.${column.attrName}\">\r\n <el-radio :label=\"0\">启用</el-radio>\r\n <el-radio :label=\"1\">禁用</el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n </#if>\r\n <#elseif column.formType == \'checkbox\'>\r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <el-checkbox-group v-model=\"dataForm.${column.attrName}\">\r\n <el-checkbox label=\"启用\" name=\"type\"></el-checkbox>\r\n <el-checkbox label=\"禁用\" name=\"type\"></el-checkbox>\r\n </el-checkbox-group>\r\n </el-form-item>\r\n <#elseif column.formType == \'date\'>\r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <el-date-picker type=\"date\" placeholder=\"${column.comment!}\" v-model=\"dataForm.${column.attrName}\"></el-date-picker>\r\n </el-form-item>\r\n <#elseif column.formType == \'datetime\'>\r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <el-date-picker type=\"datetime\" placeholder=\"${column.comment!}\" v-model=\"dataForm.${column.attrName}\"></el-date-picker>\r\n </el-form-item>\r\n <#else>\r\n <el-form-item label=\"${column.comment!}\" prop=\"${column.attrName}\">\r\n <el-input v-model=\"dataForm.${column.attrName}\" placeholder=\"${column.comment!}\"></el-input>\r\n </el-form-item>\r\n </#if>\r\n </#if>\r\n</#list>\r\n </el-form>\r\n <template slot=\"footer\">\r\n <el-button @click=\"visible = false\">{{ $t(\'cancel\') }}</el-button>\r\n <el-button type=\"primary\" @click=\"dataFormSubmitHandle()\">{{ $t(\'confirm\') }}</el-button>\r\n </template>\r\n </el-dialog>\r\n</template>\r\n\r\n<script>\r\nimport debounce from \'lodash/debounce\'\r\n<#if editor>\r\nimport Cookies from \'js-cookie\'\r\nimport \'quill/dist/quill.snow.css\'\r\nimport Quill from \'quill\'\r\n</#if>\r\nexport default {\r\n data () {\r\n return {\r\n visible: false,\r\n <#if editor>\r\n quillEditor: null,\r\n quillEditorToolbarOptions: [\r\n [\'bold\', \'italic\', \'underline\', \'strike\'],\r\n [\'blockquote\', \'code-block\', \'image\'],\r\n [{ \'header\': 1 }, { \'header\': 2 }],\r\n [{ \'list\': \'ordered\' }, { \'list\': \'bullet\' }],\r\n [{ \'script\': \'sub\' }, { \'script\': \'super\' }],\r\n [{ \'indent\': \'-1\' }, { \'indent\': \'+1\' }],\r\n [{ \'direction\': \'rtl\' }],\r\n [{ \'size\': [\'small\', false, \'large\', \'huge\'] }],\r\n [{ \'header\': [1, 2, 3, 4, 5, 6, false] }],\r\n [{ \'color\': [] }, { \'background\': [] }],\r\n [{ \'font\': [] }],\r\n [{ \'align\': [] }],\r\n [\'clean\']\r\n ],\r\n uploadUrl: \'\',\r\n </#if>\r\n dataForm: {\r\n<#list columnList as column>\r\n ${column.attrName}: \'\',\r\n</#list>\r\n }\r\n }\r\n },\r\n computed: {\r\n dataRule () {\r\n <#if editor>\r\n const validate${editorName} = (rule, value, callback) => {\r\n if (this.quillEditor.getLength() <= 1) {\r\n return callback(new Error(this.$t(\'validate.required\')))\r\n }\r\n callback()\r\n }\r\n </#if>\r\n return {\r\n<#list columnList as column>\r\n<#if column.form && column.required>\r\n <#if editor && column.attrName == editorName>\r\n ${column.attrName}: [\r\n { required: true, message: this.$t(\'validate.required\'), trigger: \'blur\' },\r\n { validator: validate${editorName}, trigger: \'blur\' }\r\n ],\r\n <#else>\r\n ${column.attrName}: [\r\n { required: true, message: this.$t(\'validate.required\'), trigger: \'blur\' }\r\n ],\r\n </#if>\r\n</#if>\r\n</#list>\r\n }\r\n }\r\n },\r\n methods: {\r\n init () {\r\n this.visible = true\r\n this.$nextTick(() => {\r\n <#if editor>\r\n if (this.quillEditor) {\r\n this.quillEditor.deleteText(0, this.quillEditor.getLength())\r\n } else {\r\n this.quillEditorHandle()\r\n }\r\n </#if>\r\n this.$refs[\'dataForm\'].resetFields()\r\n if (this.dataForm.${pk.attrName}) {\r\n this.getInfo()\r\n }\r\n })\r\n },\r\n // 获取信息\r\n getInfo () {\r\n this.$http.get(\'/${moduleName}/${classname}/\' + this.dataForm.${pk.attrName}).then(({ data: res }) => {\r\n if (res.code !== 0) {\r\n return this.$message.error(res.msg)\r\n }\r\n this.dataForm = {\r\n ...this.dataForm,\r\n ...res.data\r\n }\r\n <#if editor>\r\n this.quillEditor.root.innerHTML = this.dataForm.${editorName}\r\n </#if>\r\n }).catch(() => {})\r\n },\r\n <#if editor>\r\n // 富文本编辑器\r\n quillEditorHandle () {\r\n this.quillEditor = new Quill(\'#J_quillEditor\', {\r\n modules: {\r\n toolbar: this.quillEditorToolbarOptions\r\n },\r\n theme: \'snow\'\r\n })\r\n // 自定义上传图片功能 (使用element upload组件)\r\n this.uploadUrl = window.SITE_CONFIG[\'apiURL\'] + \'/sys/oss/upload?token=\' + Cookies.get(\'token\')\r\n this.quillEditor.getModule(\'toolbar\').addHandler(\'image\', () => {\r\n this.$refs.uploadBtn.$el.click()\r\n })\r\n // 监听内容变化,动态赋值\r\n this.quillEditor.on(\'text-change\', () => {\r\n this.dataForm.${editorName} = this.quillEditor.root.innerHTML\r\n })\r\n },\r\n // 上传图片之前\r\n uploadBeforeUploadHandle (file) {\r\n if (file.type !== \'image/jpg\' && file.type !== \'image/jpeg\' && file.type !== \'image/png\' && file.type !== \'image/gif\') {\r\n this.$message.error(\'只支持jpg、png、gif格式的图片!\')\r\n return false\r\n }\r\n },\r\n // 上传图片成功\r\n uploadSuccessHandle (res, file, fileList) {\r\n if (res.code !== 0) {\r\n return this.$message.error(res.msg)\r\n }\r\n this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, \'image\', res.data.src)\r\n },\r\n </#if>\r\n // 表单提交\r\n dataFormSubmitHandle: debounce(function () {\r\n this.$refs[\'dataForm\'].validate((valid) => {\r\n if (!valid) {\r\n return false\r\n }\r\n this.$http[!this.dataForm.${pk.attrName} ? \'post\' : \'put\'](\'/${moduleName}/${classname}/\', this.dataForm).then(({ data: res }) => {\r\n if (res.code !== 0) {\r\n return this.$message.error(res.msg)\r\n }\r\n this.$message({\r\n message: this.$t(\'prompt.success\'),\r\n type: \'success\',\r\n duration: 500,\r\n onClose: () => {\r\n this.visible = false\r\n this.$emit(\'refreshDataList\')\r\n }\r\n })\r\n }).catch(() => {})\r\n })\r\n }, 1000, { \'leading\': true, \'trailing\': false })\r\n }\r\n}\r\n</script>\r\n', '${classname}-add-or-update.vue', '${frontendPath}/src/views/modules/${moduleName}', 0, now());
- INSERT INTO gen_template(id, name, file_name, content, path, status, create_date) VALUES (1144564443498168321, 'Entity.java', '${ClassName}Entity.java', 'package ${package}.modules.${moduleName}.entity<#if subModuleName??>.${subModuleName}</#if>;\n\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\nimport com.baomidou.mybatisplus.annotation.*;\n<#list imports as i>\nimport ${i!};\n</#list>\n<#if baseClassEntity??>\nimport ${baseClassEntity.packageName};\n</#if>\n\n/**\n * ${tableComment}\n *\n * @author ${author} ${email}\n * @since ${version} ${date}\n */\n@Data\n@EqualsAndHashCode(callSuper=false)\n@TableName(\"${tableName}\")\npublic class ${ClassName}Entity<#if baseClassEntity??> extends ${baseClassEntity.code}</#if> {\n private static final long serialVersionUID = 1L;\n\n<#list columnList as column>\n <#if baseClassEntity?? && baseClassEntity.fields?split(\",\")?seq_contains(column.columnName)>\n <#else>\n <#if column.comment!?length gt 0>\n /**\n * ${column.comment}\n */\n </#if>\n <#if \"creator,create_date,dept_id,tenant_code\"?split(\",\")?seq_contains(column.columnName)>\n @TableField(fill = FieldFill.INSERT)\n </#if>\n <#if \"updater,update_date\"?split(\",\")?seq_contains(column.columnName)>\n @TableField(fill = FieldFill.INSERT_UPDATE)\n </#if>\n <#if column.pk>\n @TableId\n </#if>\n private ${column.attrType} ${column.attrName};\n </#if>\n</#list>\n}', '${backendPath}/src/main/java/${packagePath}/modules/${moduleName}/entity/${subModuleName!}', 0, now());
- INSERT INTO gen_template(id, name, file_name, content, path, status, create_date) VALUES (1222811738672033793, 'ServiceImpl.java', '${ClassName}ServiceImpl.java', 'package ${package}.modules.${moduleName}.service<#if subModuleName??>.${subModuleName}</#if>.impl;\n\nimport com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;\nimport ${package}.common.service.impl.CrudServiceImpl;\nimport ${package}.common.constant.Constant;\nimport ${package}.modules.${moduleName}.dao<#if subModuleName??>.${subModuleName}</#if>.${ClassName}Dao;\nimport ${package}.modules.${moduleName}.dto<#if subModuleName??>.${subModuleName}</#if>.${ClassName}DTO;\nimport ${package}.modules.${moduleName}.entity<#if subModuleName??>.${subModuleName}</#if>.${ClassName}Entity;\nimport ${package}.modules.${moduleName}.service<#if subModuleName??>.${subModuleName}</#if>.${ClassName}Service;\nimport ${package}.modules.security.user.SecurityUser;\nimport org.apache.commons.lang3.StringUtils;\nimport org.springframework.stereotype.Service;\n\nimport java.util.Map;\n\n/**\n * ${tableComment}\n *\n * @author ${author} ${email}\n * @since ${version} ${date}\n */\n@Service\npublic class ${ClassName}ServiceImpl extends CrudServiceImpl<${ClassName}Dao, ${ClassName}Entity, ${ClassName}DTO> implements ${ClassName}Service {\n\n @Override\n public QueryWrapper<${ClassName}Entity> getWrapper(Map<String, Object> params){\n QueryWrapper<${ClassName}Entity> wrapper = new QueryWrapper<>();\n\n <#list columnList as column>\n <#if column.query>\n <#if column.formType == \'date\'>\n String startDate = (String)params.get(\"startDate\");\n String endDate = (String)params.get(\"endDate\");\n wrapper.ge(StringUtils.isNotBlank(startDate), \"${column.columnName}\", startDate);\n wrapper.le(StringUtils.isNotBlank(endDate), \"${column.columnName}\", endDate);\n <#elseif column.formType == \'datetime\'>\n String startDateTime = (String)params.get(\"startDateTime\");\n String endDateTime = (String)params.get(\"endDateTime\");\n wrapper.ge(StringUtils.isNotBlank(startDateTime), \"${column.columnName}\", startDateTime);\n wrapper.le(StringUtils.isNotBlank(endDateTime), \"${column.columnName}\", endDateTime);\n <#else>\n String ${column.attrName} = (String)params.get(\"${column.attrName}\");\n <#switch column.queryType> \n <#case \"=\"> \n wrapper.eq(StringUtils.isNotBlank(${column.attrName}), \"${column.columnName}\", ${column.attrName});\n <#break> \n <#case \"!=\"> \n wrapper.ne(StringUtils.isNotBlank(${column.attrName}), \"${column.columnName}\", ${column.attrName});\n <#break> \n <#case \">\"> \n wrapper.gt(StringUtils.isNotBlank(${column.attrName}), \"${column.columnName}\", ${column.attrName});\n <#break> \n <#case \">=\"> \n wrapper.ge(StringUtils.isNotBlank(${column.attrName}), \"${column.columnName}\", ${column.attrName});\n <#break> \n <#case \"<\"> \n wrapper.lt(StringUtils.isNotBlank(${column.attrName}), \"${column.columnName}\", ${column.attrName});\n <#break> \n <#case \"<=\"> \n wrapper.le(StringUtils.isNotBlank(${column.attrName}), \"${column.columnName}\", ${column.attrName});\n <#break> \n <#case \"like\"> \n wrapper.like(StringUtils.isNotBlank(${column.attrName}), \"${column.columnName}\", ${column.attrName});\n <#break>\n <#case \"left like\"> \n wrapper.likeLeft(StringUtils.isNotBlank(${column.attrName}), \"${column.columnName}\", ${column.attrName});\n <#break> \n <#case \"right like\"> \n wrapper.likeRight(StringUtils.isNotBlank(${column.attrName}), \"${column.columnName}\", ${column.attrName});\n <#break> \n <#default> \n wrapper.ne(StringUtils.isNotBlank(${column.attrName}), \"${column.columnName}\", ${column.attrName});\n </#switch>\n </#if>\n </#if>\n\n <#if column.columnName == \'tenant_code\'>\n wrapper.eq(\"tenant_code\", TenantContext.getTenantCode(SecurityUser.getUser()));\n </#if>\n </#list>\n\n return wrapper;\n }\n\n\n}', '${backendPath}/src/main/java/${packagePath}/modules/${moduleName}/service/${subModuleName!}/impl', 0, now());
- INSERT INTO gen_test_data(id, username, real_name, gender, email, notice_type, content, creator, create_date, updater, update_date) VALUES (1067246875800000001, 'sunlightcs', 'Mark', 0, 'root@admin.163.com', 0, '<p>智汇口腔代码生成器!</p>', 1067246875800000001, now(), 1067246875800000001, now());
|