├── .gitattributes ├── .gitignore ├── ReadMe.md ├── gencode-maven-plugin ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── alvin │ │ └── gencode │ │ ├── CleanMavenPlugin.java │ │ ├── GenCodeMavenPlugin.java │ │ ├── SwaggerApiGenCodeMavenPlugin.java │ │ ├── beans │ │ └── PropConfig.java │ │ ├── run │ │ ├── code │ │ │ ├── CodeCond.java │ │ │ ├── CodeDao.java │ │ │ ├── CodeService.java │ │ │ ├── Field.java │ │ │ └── Table.java │ │ ├── config │ │ │ └── GenCodePluginConfig.java │ │ └── service │ │ │ ├── JDBC2MbTypeService.java │ │ │ └── VmFileService.java │ │ ├── swagger │ │ ├── JsMockBus.java │ │ ├── SwaggerMockMethod.java │ │ ├── bean │ │ │ ├── ActionBean.java │ │ │ ├── ActionMethodBean.java │ │ │ ├── JSMock.java │ │ │ ├── JSMockApiConfig.java │ │ │ ├── JSMockFunction.java │ │ │ └── SwgClientMethodBean.java │ │ └── service │ │ │ ├── HttpClientService.java │ │ │ └── JsoupService.java │ │ └── utils │ │ ├── ConfigUtil.java │ │ ├── Utils.java │ │ └── VelocityUtil.java │ └── resources │ ├── application.properties │ ├── jdbctypemap.properties │ └── log4j.properties ├── test-maven-plugin ├── pom.xml └── src │ └── main │ ├── config │ ├── config.properties │ ├── dist │ │ ├── address │ │ │ ├── Address.java │ │ │ ├── AddressAction.java │ │ │ ├── AddressCond.java │ │ │ ├── AddressDao.java │ │ │ ├── AddressDialog.vue │ │ │ ├── AddressList.vue │ │ │ ├── AddressListExpand.vue │ │ │ ├── AddressMapper.xml │ │ │ ├── AddressMock.js │ │ │ └── AddressService.java │ │ ├── bill │ │ │ ├── Bill.java │ │ │ ├── BillAction.java │ │ │ ├── BillCond.java │ │ │ ├── BillDao.java │ │ │ ├── BillDialog.vue │ │ │ ├── BillList.vue │ │ │ ├── BillListExpand.vue │ │ │ ├── BillMapper.xml │ │ │ ├── BillMock.js │ │ │ └── BillService.java │ │ ├── category │ │ │ ├── Category.java │ │ │ ├── CategoryAction.java │ │ │ ├── CategoryCond.java │ │ │ ├── CategoryDao.java │ │ │ ├── CategoryDialog.vue │ │ │ ├── CategoryList.vue │ │ │ ├── CategoryListExpand.vue │ │ │ ├── CategoryMapper.xml │ │ │ ├── CategoryMock.js │ │ │ └── CategoryService.java │ │ ├── customer │ │ │ ├── Customer.java │ │ │ ├── CustomerAction.java │ │ │ ├── CustomerCond.java │ │ │ ├── CustomerDao.java │ │ │ ├── CustomerDialog.vue │ │ │ ├── CustomerList.vue │ │ │ ├── CustomerListExpand.vue │ │ │ ├── CustomerMapper.xml │ │ │ ├── CustomerMock.js │ │ │ └── CustomerService.java │ │ ├── dept │ │ │ ├── Dept.java │ │ │ ├── DeptAction.java │ │ │ ├── DeptCond.java │ │ │ ├── DeptDao.java │ │ │ ├── DeptDialog.vue │ │ │ ├── DeptList.vue │ │ │ ├── DeptListExpand.vue │ │ │ ├── DeptMapper.xml │ │ │ ├── DeptMock.js │ │ │ └── DeptService.java │ │ ├── dict │ │ │ ├── Dict.java │ │ │ ├── DictAction.java │ │ │ ├── DictCond.java │ │ │ ├── DictDao.java │ │ │ ├── DictDialog.vue │ │ │ ├── DictList.vue │ │ │ ├── DictListExpand.vue │ │ │ ├── DictMapper.xml │ │ │ ├── DictMock.js │ │ │ └── DictService.java │ │ ├── func │ │ │ ├── Func.java │ │ │ ├── FuncAction.java │ │ │ ├── FuncCond.java │ │ │ ├── FuncDao.java │ │ │ ├── FuncDialog.vue │ │ │ ├── FuncList.vue │ │ │ ├── FuncListExpand.vue │ │ │ ├── FuncMapper.xml │ │ │ ├── FuncMock.js │ │ │ └── FuncService.java │ │ ├── inbound │ │ │ ├── Inbound.java │ │ │ ├── InboundAction.java │ │ │ ├── InboundCond.java │ │ │ ├── InboundDao.java │ │ │ ├── InboundDialog.vue │ │ │ ├── InboundList.vue │ │ │ ├── InboundListExpand.vue │ │ │ ├── InboundMapper.xml │ │ │ ├── InboundMock.js │ │ │ └── InboundService.java │ │ ├── menu │ │ │ ├── Menu.java │ │ │ ├── MenuAction.java │ │ │ ├── MenuCond.java │ │ │ ├── MenuDao.java │ │ │ ├── MenuDialog.vue │ │ │ ├── MenuList.vue │ │ │ ├── MenuListExpand.vue │ │ │ ├── MenuMapper.xml │ │ │ ├── MenuMock.js │ │ │ └── MenuService.java │ │ ├── menurule │ │ │ ├── MenuRule.java │ │ │ ├── MenuRuleAction.java │ │ │ ├── MenuRuleCond.java │ │ │ ├── MenuRuleDao.java │ │ │ ├── MenuRuleDialog.vue │ │ │ ├── MenuRuleList.vue │ │ │ ├── MenuRuleListExpand.vue │ │ │ ├── MenuRuleMapper.xml │ │ │ ├── MenuRuleMock.js │ │ │ └── MenuRuleService.java │ │ ├── outbound │ │ │ ├── Outbound.java │ │ │ ├── OutboundAction.java │ │ │ ├── OutboundCond.java │ │ │ ├── OutboundDao.java │ │ │ ├── OutboundDialog.vue │ │ │ ├── OutboundList.vue │ │ │ ├── OutboundListExpand.vue │ │ │ ├── OutboundMapper.xml │ │ │ ├── OutboundMock.js │ │ │ └── OutboundService.java │ │ ├── person │ │ │ ├── Person.java │ │ │ ├── PersonAction.java │ │ │ ├── PersonCond.java │ │ │ ├── PersonDao.java │ │ │ ├── PersonDialog.vue │ │ │ ├── PersonList.vue │ │ │ ├── PersonListExpand.vue │ │ │ ├── PersonMapper.xml │ │ │ ├── PersonMock.js │ │ │ └── PersonService.java │ │ ├── product │ │ │ ├── Product.java │ │ │ ├── ProductAction.java │ │ │ ├── ProductCond.java │ │ │ ├── ProductDao.java │ │ │ ├── ProductDialog.vue │ │ │ ├── ProductList.vue │ │ │ ├── ProductListExpand.vue │ │ │ ├── ProductMapper.xml │ │ │ ├── ProductMock.js │ │ │ └── ProductService.java │ │ ├── quote │ │ │ ├── Quote.java │ │ │ ├── QuoteAction.java │ │ │ ├── QuoteCond.java │ │ │ ├── QuoteDao.java │ │ │ ├── QuoteDialog.vue │ │ │ ├── QuoteList.vue │ │ │ ├── QuoteListExpand.vue │ │ │ ├── QuoteMapper.xml │ │ │ ├── QuoteMock.js │ │ │ └── QuoteService.java │ │ ├── record │ │ │ ├── Record.java │ │ │ ├── RecordAction.java │ │ │ ├── RecordCond.java │ │ │ ├── RecordDao.java │ │ │ ├── RecordDialog.vue │ │ │ ├── RecordList.vue │ │ │ ├── RecordListExpand.vue │ │ │ ├── RecordMapper.xml │ │ │ ├── RecordMock.js │ │ │ └── RecordService.java │ │ ├── role │ │ │ ├── Role.java │ │ │ ├── RoleAction.java │ │ │ ├── RoleCond.java │ │ │ ├── RoleDao.java │ │ │ ├── RoleDialog.vue │ │ │ ├── RoleList.vue │ │ │ ├── RoleListExpand.vue │ │ │ ├── RoleMapper.xml │ │ │ ├── RoleMock.js │ │ │ └── RoleService.java │ │ ├── roledept │ │ │ ├── RoleDept.java │ │ │ ├── RoleDeptAction.java │ │ │ ├── RoleDeptCond.java │ │ │ ├── RoleDeptDao.java │ │ │ ├── RoleDeptDialog.vue │ │ │ ├── RoleDeptList.vue │ │ │ ├── RoleDeptListExpand.vue │ │ │ ├── RoleDeptMapper.xml │ │ │ ├── RoleDeptMock.js │ │ │ └── RoleDeptService.java │ │ ├── rolefunc │ │ │ ├── RoleFunc.java │ │ │ ├── RoleFuncAction.java │ │ │ ├── RoleFuncCond.java │ │ │ ├── RoleFuncDao.java │ │ │ ├── RoleFuncDialog.vue │ │ │ ├── RoleFuncList.vue │ │ │ ├── RoleFuncListExpand.vue │ │ │ ├── RoleFuncMapper.xml │ │ │ ├── RoleFuncMock.js │ │ │ └── RoleFuncService.java │ │ ├── sysuser │ │ │ ├── SysUser.java │ │ │ ├── SysUserAction.java │ │ │ ├── SysUserCond.java │ │ │ ├── SysUserDao.java │ │ │ ├── SysUserDialog.vue │ │ │ ├── SysUserList.vue │ │ │ ├── SysUserListExpand.vue │ │ │ ├── SysUserMapper.xml │ │ │ ├── SysUserMock.js │ │ │ └── SysUserService.java │ │ ├── ticket │ │ │ ├── Ticket.java │ │ │ ├── TicketAction.java │ │ │ ├── TicketCond.java │ │ │ ├── TicketDao.java │ │ │ ├── TicketDialog.vue │ │ │ ├── TicketList.vue │ │ │ ├── TicketListExpand.vue │ │ │ ├── TicketMapper.xml │ │ │ ├── TicketMock.js │ │ │ └── TicketService.java │ │ └── vendor │ │ │ ├── Vendor.java │ │ │ ├── VendorAction.java │ │ │ ├── VendorCond.java │ │ │ ├── VendorDao.java │ │ │ ├── VendorDialog.vue │ │ │ ├── VendorList.vue │ │ │ ├── VendorListExpand.vue │ │ │ ├── VendorMapper.xml │ │ │ ├── VendorMock.js │ │ │ └── VendorService.java │ └── templates │ │ ├── mjwxmp_mybatis_java │ │ ├── ModelAction_java.vm │ │ ├── ModelCond_java.vm │ │ ├── ModelDao_java.vm │ │ ├── ModelMapper_xml.vm │ │ ├── ModelService_java.vm │ │ └── Model_java.vm │ │ └── mjwxmp_web_iview │ │ ├── ModelDialog_vue.vm │ │ ├── ModelListExpand_vue.vm │ │ ├── ModelList_vue.vm │ │ └── ModelMock_js.vm │ └── resources │ └── application.properties └── test.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # ========================= 15 | # Operating System Files 16 | # ========================= 17 | 18 | # OSX 19 | # ========================= 20 | 21 | .DS_Store 22 | .AppleDouble 23 | .LSOverride 24 | 25 | # Thumbnails 26 | ._* 27 | 28 | # Files that might appear in the root of a volume 29 | .DocumentRevisions-V100 30 | .fseventsd 31 | .Spotlight-V100 32 | .TemporaryItems 33 | .Trashes 34 | .VolumeIcon.icns 35 | 36 | # Directories potentially created on remote AFP share 37 | .AppleDB 38 | .AppleDesktop 39 | Network Trash Folder 40 | Temporary Items 41 | .apdisk 42 | 43 | # Windows 44 | # ========================= 45 | 46 | # Windows image file caches 47 | Thumbs.db 48 | ehthumbs.db 49 | 50 | # Folder config file 51 | Desktop.ini 52 | 53 | # Recycle Bin used on file shares 54 | $RECYCLE.BIN/ 55 | 56 | # Windows Installer files 57 | *.cab 58 | *.msi 59 | *.msm 60 | *.msp 61 | 62 | # Windows shortcuts 63 | *.lnk 64 | *.iml 65 | gencode-maven-plugin/.idea 66 | test-maven-plugin/.idea 67 | gencode-maven-plugin/target 68 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | # 代码生成器maven 插件 2 | > 目录 gencode-maven-plugin 3 | ## 安装步骤 4 | ### 1.下载并编译 mini-inject 5 | 地址: https://github.com/alvin198761/mini-inject 6 | ```sql 7 | 执行命令 8 | git clone https://github.com/alvin198761/mini-inject.git 9 | unzip mini-inject.zip 10 | cd mini-inject 11 | mvn install 12 | 13 | ``` 14 | ### 2. 下载并编译gcode 15 | 地址: https://github.com/alvin198761/gcode 16 | ```sql 17 | 执行命令 18 | git clone https://github.com/alvin198761/gcode.git 19 | unzip gcode.zip 20 | cd gcode/gen_code_v2 21 | mvn install 22 | ``` 23 | ### 3. 下载并编译本项目 24 | > 不做赘述 25 | 26 | # 插件测试程序 27 | * 1.下载并安装 28 | * 2.配置插件 29 | ```xml 30 | 31 | 32 | org.alvin.gencode 33 | gencode-maven-plugin 34 | 1.0-SNAPSHOT 35 | 36 | ${basedir}/src/main/config/config.properties 37 | 38 | 39 | 40 | 41 | run 42 | 43 | 44 | 45 | 46 | ``` 47 | * 3.配置好 config.properties 里面的内容 (见本项目样例文件) 48 | * 4.执行命令 49 | ```sql 50 | mvn install //安装项目 51 | mvn gencode:run //执行插件命令 52 | ``` 53 | 54 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/CleanMavenPlugin.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.alvin.gencode.beans.PropConfig; 5 | import org.alvin.gencode.utils.ConfigUtil; 6 | import org.apache.maven.plugin.AbstractMojo; 7 | import org.apache.maven.plugins.annotations.LifecyclePhase; 8 | import org.apache.maven.plugins.annotations.Mojo; 9 | import org.apache.maven.plugins.annotations.Parameter; 10 | 11 | import java.io.IOException; 12 | import java.nio.file.*; 13 | import java.nio.file.attribute.BasicFileAttributes; 14 | 15 | /** 16 | * @author 唐植超 17 | * @date 2019/11/19 18 | */ 19 | @Slf4j 20 | @Mojo(name = "clean", defaultPhase = LifecyclePhase.NONE) 21 | public class CleanMavenPlugin extends AbstractMojo { 22 | 23 | @Parameter 24 | private String config; 25 | 26 | @Override 27 | public void execute() { 28 | log.info("启动配置加载"); 29 | try { 30 | PropConfig propConfig = ConfigUtil.initConfig(); 31 | log.info("开始清除文件"); 32 | Path path = Paths.get(propConfig.getConfigDir(), "gcode.rmb"); 33 | log.info("删除gcode.rmb"); 34 | Files.delete(path); 35 | log.info("清除dist目录"); 36 | path = Paths.get(propConfig.getConfigDir(), "dist"); 37 | Files.walkFileTree(path, new FileVisitor() { 38 | 39 | public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { 40 | Files.delete(dir); 41 | return FileVisitResult.CONTINUE; 42 | } 43 | 44 | public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { 45 | return FileVisitResult.CONTINUE; 46 | } 47 | 48 | public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { 49 | Files.delete(file); 50 | return FileVisitResult.CONTINUE; 51 | } 52 | 53 | public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { 54 | return FileVisitResult.CONTINUE; 55 | } 56 | }); 57 | } catch (IOException e) { 58 | e.printStackTrace(); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/GenCodeMavenPlugin.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.alvin.mini_inject.InjectContext; 5 | import org.alvin.mini_inject.annotations.MiniServiceScan; 6 | import org.apache.maven.plugin.AbstractMojo; 7 | import org.apache.maven.plugins.annotations.LifecyclePhase; 8 | import org.apache.maven.plugins.annotations.Mojo; 9 | import org.apache.maven.plugins.annotations.Parameter; 10 | 11 | @Slf4j 12 | @MiniServiceScan("org.alvin.gencode.run") 13 | @Mojo(name = "run", defaultPhase = LifecyclePhase.NONE) 14 | public class GenCodeMavenPlugin extends AbstractMojo { 15 | 16 | @Parameter 17 | private String config; 18 | 19 | public void execute() { 20 | System.getProperties().put("config", this.config); 21 | InjectContext.run(GenCodeMavenPlugin.class, new String[]{this.config}); 22 | } 23 | 24 | // public static void main(String[] args) { 25 | // String path = System.getProperty("user.dir").concat(File.separator).concat("src").concat(File.separator).concat("config").concat(File.separator).concat("config.properties"); 26 | // System.getProperties().put("config", path); 27 | // InjectContext.run(GenCodeMavenPlugin.class, args); 28 | // } 29 | } 30 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/SwaggerApiGenCodeMavenPlugin.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.alvin.mini_inject.InjectContext; 5 | import org.alvin.mini_inject.annotations.MiniServiceScan; 6 | import org.apache.maven.plugin.AbstractMojo; 7 | import org.apache.maven.plugins.annotations.LifecyclePhase; 8 | import org.apache.maven.plugins.annotations.Mojo; 9 | import org.apache.maven.plugins.annotations.Parameter; 10 | 11 | /** 12 | * @author 唐植超 13 | * @date 2019/11/19 14 | */ 15 | @Slf4j 16 | @MiniServiceScan("org.alvin.gencode.swagger") 17 | @Mojo(name = "swaggerapi", defaultPhase = LifecyclePhase.NONE) 18 | public class SwaggerApiGenCodeMavenPlugin extends AbstractMojo { 19 | 20 | @Parameter 21 | private String config; 22 | 23 | @Override 24 | public void execute() { 25 | System.getProperties().put("config", this.config); 26 | InjectContext.run(SwaggerApiGenCodeMavenPlugin.class, new String[]{this.config}); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/beans/PropConfig.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.beans; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PropConfig { 7 | 8 | private String driverClassName; 9 | private String url; 10 | private String username; 11 | private String password; 12 | 13 | private String packageName; 14 | private String author; 15 | private String configDir; 16 | private String dbName; 17 | 18 | private String swaggerUrl; 19 | private String swaggerApiType; 20 | 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/run/code/CodeCond.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.run.code; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | import org.alvin.code.jdbc.beans.BaseCondition; 8 | 9 | @Data 10 | public class CodeCond extends BaseCondition { 11 | 12 | @Override 13 | public void addCondition() { 14 | add(t_name, "AND table_name LIKE ?", 3); 15 | add(t_name_eq, "AND table_name = ?"); 16 | add(table_schema, "AND table_schema=?"); 17 | add(tableNameNotIn, "AND table_name not in "); 18 | } 19 | 20 | private String t_name;// 表名模糊 21 | private String t_name_eq;// 表名等于 22 | private String table_schema;// 数据名 23 | private List tableNameNotIn; //表名称排除 24 | 25 | private String db_user;// 数据库用户名 26 | // 27 | private String author;// 作者名 28 | private String packageName; //包名 29 | private List c_list;// 生成代码用的数据 30 | 31 | private List templateDirs; //模板目录选择 32 | 33 | private String sql; 34 | 35 | 36 | } -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/run/code/Field.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.run.code; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Field { 7 | private String name;// 字段名 8 | private String comment;// 注释 9 | private String type;// 数据类型 10 | 11 | private String lower_camel; //单峰驼 12 | private String upper_camel; //双峰驼 13 | 14 | private Integer length; //字符长度 15 | private String column_key;//键 16 | 17 | private String dbType; //数据库类型 18 | private String allTypeName;//类型全称 19 | private String mb_db_type ;//mybatis 数据库类型 20 | 21 | } 22 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/run/code/Table.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.run.code; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Table { 7 | private String t_name;// 表名 8 | private String comment;// 表名注释 9 | private String cls_upp;// 类名(首字母大写) 10 | private String c_name;// 类中文名 11 | } 12 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/run/config/GenCodePluginConfig.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.run.config; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.alvin.code.jdbc.ConnectionUtils; 5 | import org.alvin.gencode.beans.PropConfig; 6 | import org.alvin.gencode.run.code.CodeService; 7 | import org.alvin.gencode.utils.ConfigUtil; 8 | import org.alvin.mini_inject.annotations.MiniComponent; 9 | import org.alvin.mini_inject.annotations.MiniInject; 10 | import org.alvin.mini_inject.annotations.MiniRun; 11 | 12 | import java.io.IOException; 13 | 14 | @Slf4j 15 | @MiniComponent 16 | public class GenCodePluginConfig { 17 | 18 | @MiniInject 19 | private CodeService codeService; 20 | 21 | @MiniRun 22 | public void start() { 23 | try { 24 | log.info("启动配置加载"); 25 | PropConfig propConfig = ConfigUtil.initConfig(); 26 | log.info("初始化数据库连接"); 27 | this.initConnectionConfig(propConfig); 28 | log.info("生成代码"); 29 | this.codeService.genCode(propConfig); 30 | } catch (IOException e) { 31 | e.printStackTrace(); 32 | } 33 | } 34 | 35 | public void initConnectionConfig(PropConfig propConfig) { 36 | try { 37 | ConnectionUtils.init(propConfig.getDriverClassName(), propConfig.getUrl(), propConfig.getUsername(), propConfig.getPassword()); 38 | } catch (ClassNotFoundException e) { 39 | e.printStackTrace(); 40 | System.exit(0); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/run/service/JDBC2MbTypeService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.run.service; 2 | 3 | import org.alvin.mini_inject.annotations.MiniComponent; 4 | 5 | import java.io.IOException; 6 | import java.util.Properties; 7 | 8 | /** 9 | * @author 唐植超 10 | * @date 2019/09/12 11 | */ 12 | @MiniComponent 13 | public class JDBC2MbTypeService { 14 | 15 | private Properties properties = new Properties(); 16 | 17 | public JDBC2MbTypeService(){ 18 | try { 19 | properties.load(this.getClass().getResourceAsStream("/jdbctypemap.properties")); 20 | } catch (IOException e) { 21 | e.printStackTrace(); 22 | } 23 | } 24 | 25 | public String getType(String key) { 26 | return this.properties.getProperty(key); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/run/service/VmFileService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.run.service; 2 | 3 | import com.google.common.collect.Lists; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.alvin.mini_inject.annotations.MiniComponent; 6 | 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.util.LinkedList; 10 | import java.util.List; 11 | 12 | 13 | @Slf4j 14 | /** 15 | * 文件操作 16 | */ 17 | @MiniComponent 18 | public class VmFileService { 19 | 20 | /** 21 | * 扫描文件并执行 22 | */ 23 | public List scanTemplate(String dirName, String suffix, List templateDirs) throws IOException { 24 | File dir = new File(dirName).getCanonicalFile(); 25 | List classList = Lists.newArrayList(); 26 | 27 | if (!dir.exists() || !dir.isDirectory()) { 28 | log.error("没有找到对应的目录"); 29 | return Lists.newArrayList(); 30 | } 31 | LinkedList files = Lists.newLinkedList(); 32 | if (templateDirs == null || templateDirs.isEmpty()) { 33 | files.add(dir); 34 | } else { 35 | files.addAll(Lists.newArrayList(dir.listFiles((fdir, name) -> templateDirs.contains(name)))); 36 | } 37 | // 循环读取目录以及子目录下的所有类文件 38 | while (!files.isEmpty()) { 39 | File f = files.removeFirst(); 40 | if (f.isDirectory()) { 41 | //根目录过滤 42 | if (templateDirs != null && templateDirs.isEmpty()) { 43 | //之过滤第一层 44 | if (f.getParentFile().getAbsolutePath().equals(dir.getAbsolutePath())) { 45 | if (!templateDirs.contains(f.getName())) { 46 | continue; 47 | } 48 | } 49 | } 50 | 51 | File[] fs = f.listFiles(); 52 | int i = 0; 53 | for (File childFile : fs) { 54 | files.add(i++, childFile); 55 | } 56 | continue; 57 | } 58 | if (!f.getName().toLowerCase().endsWith(suffix)) { 59 | continue; 60 | } 61 | String subPath = f.getAbsolutePath().substring(dir.getAbsolutePath().length()); 62 | classList.add(subPath); 63 | } 64 | 65 | return classList; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/swagger/SwaggerMockMethod.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.swagger; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.SOURCE) 10 | public @interface SwaggerMockMethod { 11 | 12 | String value(); 13 | } 14 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/swagger/bean/ActionBean.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.swagger.bean; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class ActionBean { 9 | 10 | private String date; //生成时间 11 | private String author;//作者 12 | private String note;//说明 13 | private String actionName; //action 说明 14 | private List methods; //方法列表 15 | } 16 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/swagger/bean/ActionMethodBean.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.swagger.bean; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.google.common.collect.Lists; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class ActionMethodBean { 11 | 12 | private String method;//方法 13 | private String url;//地址 14 | private String note;//说明 15 | private String description;//注释 16 | 17 | private String name; //方法名称 18 | 19 | private JSONObject params; //参数 20 | 21 | private String reqParamType;//请求参数方式 body formdata 22 | // private List> responseMsg;//响应错误信息 23 | // private String paramsStr;//显示的参数拼装结果 24 | private String consumes; 25 | //是否有路径参数 26 | private boolean hasPath = false; 27 | //路径参数集合 28 | private String pathParams; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/swagger/bean/JSMock.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.swagger.bean; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class JSMock { 7 | 8 | private String name; 9 | private String description; 10 | private String id; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/swagger/bean/JSMockApiConfig.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.swagger.bean; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class JSMockApiConfig { 10 | 11 | private String url; 12 | private String ctype; //客户端类型 13 | private List tags; 14 | } 15 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/swagger/bean/JSMockFunction.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.swagger.bean; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Map; 6 | 7 | @Data 8 | public class JSMockFunction { 9 | 10 | private String name; 11 | private String url; 12 | private String method; 13 | private String description; 14 | private Map headers; 15 | private Map params; 16 | private Map response; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/swagger/bean/SwgClientMethodBean.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.swagger.bean; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class SwgClientMethodBean { 7 | 8 | private String name; 9 | private String url; 10 | private String method; 11 | private boolean hasToken; 12 | private String comment; 13 | private String data; 14 | private String contentType; 15 | } 16 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/swagger/service/HttpClientService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.swagger.service; 2 | 3 | import org.alvin.mini_inject.annotations.MiniComponent; 4 | import org.apache.http.client.methods.CloseableHttpResponse; 5 | import org.apache.http.client.methods.HttpGet; 6 | import org.apache.http.impl.client.CloseableHttpClient; 7 | import org.apache.http.impl.client.HttpClients; 8 | import org.apache.http.util.EntityUtils; 9 | 10 | import java.io.IOException; 11 | @MiniComponent 12 | public class HttpClientService { 13 | /** 14 | * 简单get 请求 15 | * 16 | * @param url 17 | * @return 18 | */ 19 | public String get(String url) { 20 | try (CloseableHttpClient client = HttpClients.createDefault()) { 21 | HttpGet httpGet = new HttpGet(url); 22 | CloseableHttpResponse response = client.execute(httpGet); 23 | if (response.getStatusLine().getStatusCode() == 200) { 24 | return EntityUtils.toString(response.getEntity());//获得返回的结果 25 | } 26 | throw new IOException("请求错误,错误码:" + response.getStatusLine().getStatusCode()); 27 | } catch (Exception e) { 28 | e.printStackTrace(); 29 | } 30 | return null; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/swagger/service/JsoupService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.swagger.service; 2 | 3 | import org.alvin.gencode.swagger.bean.JSMock; 4 | import org.alvin.mini_inject.annotations.MiniComponent; 5 | import org.jsoup.Jsoup; 6 | import org.jsoup.nodes.Document; 7 | import org.jsoup.nodes.Element; 8 | import org.jsoup.select.Elements; 9 | 10 | import java.io.IOException; 11 | import java.util.List; 12 | import java.util.stream.Collectors; 13 | 14 | @MiniComponent 15 | public class JsoupService { 16 | 17 | /** 18 | * 获取所有接口 19 | * 20 | * @param url 21 | * @return 22 | * @throws IOException 23 | */ 24 | public List getMockList(String url) throws IOException { 25 | Document doc = Jsoup.connect(url).get(); 26 | Element element = doc.getElementById("resources"); 27 | Elements actionEls = element.getAllElements(); 28 | return actionEls.stream().map(item -> { 29 | JSMock jsMock = new JSMock(); 30 | jsMock.setId(item.id()); 31 | Element head = item.getElementsByTag("h2").get(0); 32 | jsMock.setDescription(head.text()); 33 | jsMock.setName(head.getElementsByTag("a").get(0).text()); 34 | return jsMock; 35 | }).collect(Collectors.toList()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/java/org/alvin/gencode/utils/ConfigUtil.java: -------------------------------------------------------------------------------- 1 | package org.alvin.gencode.utils; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.alvin.gencode.beans.PropConfig; 5 | 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.lang.reflect.Field; 9 | import java.nio.file.Files; 10 | import java.nio.file.Paths; 11 | import java.util.Properties; 12 | 13 | /** 14 | * @author 唐植超 15 | * @date 2019/11/19 16 | */ 17 | @Slf4j 18 | public class ConfigUtil { 19 | 20 | public static PropConfig initConfig() throws IOException { 21 | String path = System.getProperty("config"); 22 | log.info("配置文件路径:" + path); 23 | try (InputStream is = Files.newInputStream(Paths.get(path))) { 24 | Properties properties = new Properties(); 25 | properties.load(is); 26 | PropConfig propConfig = new PropConfig(); 27 | properties.forEach((k, v) -> { 28 | try { 29 | Field field = PropConfig.class.getDeclaredField(k.toString()); 30 | if (field == null) { 31 | return; 32 | } 33 | boolean flag = field.isAccessible(); 34 | try { 35 | field.setAccessible(true); 36 | field.set(propConfig, v.toString().replace("${basedir}", System.getProperty("user.dir"))); 37 | } catch (Exception e) { 38 | e.printStackTrace(); 39 | } finally { 40 | field.setAccessible(flag); 41 | } 42 | } catch (NoSuchFieldException e) { 43 | e.printStackTrace(); 44 | } 45 | }); 46 | return propConfig; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvin198761/gencode-maven-plugin/a8dac13cba10dffd01f45b0ae57c281df9c3223b/gencode-maven-plugin/src/main/resources/application.properties -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/resources/jdbctypemap.properties: -------------------------------------------------------------------------------- 1 | ARRAY=ARRAY 2 | BIT=BIT 3 | TINYINT=TINYINT 4 | SMALLINT=SMALLINT 5 | INTEGER=INTEGER 6 | BIGINT=BIGINT 7 | FLOAT=FLOAT 8 | REAL=REAL 9 | DOUBLE=DOUBLE 10 | NUMERIC=NUMERIC 11 | DECIMAL=DECIMAL 12 | CHAR=CHAR 13 | VARCHAR=VARCHAR 14 | LONGVARCHAR=LONGVARCHAR 15 | DATE=DATE 16 | TIME=TIME 17 | TIMESTAMP=TIMESTAMP 18 | DATETIME=DATE 19 | BINARY=BINARY 20 | VARBINARY=VARBINARY 21 | LONGVARBINARY=LONGVARBINARY 22 | NULL=NULL 23 | OTHER=OTHER 24 | BLOB=BLOB 25 | CLOB=CLOB 26 | BOOLEAN=BOOLEAN 27 | NVARCHAR=NVARCHAR 28 | NCHAR=NCHAR 29 | NCLOB=NCLOB 30 | STRUCT=STRUCT 31 | JAVA_OBJECT=JAVA_OBJECT 32 | DISTINCT=DISTINCT 33 | REF=REF 34 | DATALINK=DATALINK 35 | ROWID=ROWID 36 | LONGNVARCHAR=LONGNVARCHAR 37 | SQLXML=SQLXML 38 | INT=INTEGER -------------------------------------------------------------------------------- /gencode-maven-plugin/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvin198761/gencode-maven-plugin/a8dac13cba10dffd01f45b0ae57c281df9c3223b/gencode-maven-plugin/src/main/resources/log4j.properties -------------------------------------------------------------------------------- /test-maven-plugin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.alvin.home 8 | test-maven-plugin 9 | 1.0-SNAPSHOT 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | org.alvin.gencode 19 | gencode-maven-plugin 20 | 1.0-SNAPSHOT 21 | 22 | ${basedir}/src/main/config/config.properties 23 | 24 | 25 | 26 | 27 | run 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/config.properties: -------------------------------------------------------------------------------- 1 | driverClassName=com.mysql.jdbc.Driver 2 | url=jdbc:mysql://localhost:3306/erp_laozhang?useUnicode=true&characterEncoding=utf-8&useSSL=false 3 | username=root 4 | password=123456 5 | configDir=${basedir}/src/main/config 6 | packageName=org.alvin.test 7 | mode=create 8 | author=alvin198761@163.com 9 | dbName=erp_laozhang -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/address/AddressDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.address; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 收寄信息--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface AddressDao { 10 | 11 | /** 12 | * @方法说明:物理删除收寄信息记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新收寄信息记录 18 | */ 19 | int update(Address vo) ; 20 | 21 | /** 22 | * @方法说明:更新收寄信息记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Address vo); 25 | 26 | /** 27 | * @方法说明:新增收寄信息记录 28 | */ 29 | int save(Address vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页收寄信息列表 33 | */ 34 | List
queryList(AddressCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 收寄信息 对象 38 | */ 39 | Address findOne(AddressCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个收寄信息实体 43 | */ 44 | Address findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询收寄信息记录个数 49 | */ 50 | long queryCount(AddressCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询收寄信息记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 收寄信息 59 | */ 60 | int insertBatch(List
list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/address/AddressListExpand.vue: -------------------------------------------------------------------------------- 1 | 35 | 40 | 50 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/address/AddressMock.js: -------------------------------------------------------------------------------- 1 | /*收寄信息模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/address/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | type: "@integer(100,200)",//类型 12 | targetPhone : "@word(5,10)",// 电话 13 | targetAddr : "@word(5,10)",// 地址 14 | targetName : "@word(5,10)",// 姓名 15 | targetId: "@integer(100,200)",//收寄方id 16 | remark : "@word(5,10)",// 备注 17 | }], 18 | 'number': '@integer(100,200)', 19 | 'size': 10, 20 | 'totalElements': 500, 21 | }); 22 | 23 | var resp = { 24 | "code": 200, 25 | "errorMsg": "请求成功", 26 | "data":data 27 | }; 28 | 29 | setTimeout(function () { 30 | res.json(resp); 31 | }, 500); 32 | }, 33 | 34 | 'POST /api/address/update': function (req, res, next) { 35 | var resp = { 36 | "code": 200, 37 | "errorMsg": "请求成功", 38 | "data":1 39 | }; 40 | setTimeout(function () { 41 | res.json(resp); 42 | }, 500); 43 | }, 44 | 45 | 'POST /api/address/save': function (req, res, next) { 46 | var resp = { 47 | "code": 200, 48 | "errorMsg": "请求成功", 49 | "data":1 50 | }; 51 | setTimeout(function () { 52 | res.json(resp); 53 | }, 500); 54 | }, 55 | 56 | 'POST /api/address/queryList': function (req, res, next) { 57 | var data = Mock.mock({ 58 | 'content|10': [{ 59 | id: "@integer(100,200)",//主键 60 | type: "@integer(100,200)",//类型 61 | targetPhone : "@word(5,10)",// 电话 62 | targetAddr : "@word(5,10)",// 地址 63 | targetName : "@word(5,10)",// 姓名 64 | targetId: "@integer(100,200)",//收寄方id 65 | remark : "@word(5,10)",// 备注 66 | }] 67 | }); 68 | var resp = { 69 | "code": 200, 70 | "errorMsg": "请求成功", 71 | "data":data.content 72 | }; 73 | 74 | setTimeout(function () { 75 | res.json(resp); 76 | }, 500); 77 | 78 | }, 79 | 80 | 'POST /api/address/delete': function (req, res, next) { 81 | var resp = { 82 | "code": 200, 83 | "errorMsg": "请求成功", 84 | "data":1 85 | }; 86 | setTimeout(function () { 87 | res.json(resp); 88 | }, 500); 89 | }, 90 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/address/AddressService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.address; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 收寄信息--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class AddressService { 18 | 19 | 20 | @Autowired 21 | private AddressDao dao; //注入收寄信息数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[收寄信息]记录 25 | */ 26 | @Transactional 27 | public int save(Address address) { 28 | return dao.save(address); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除收寄信息记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新收寄信息记录 42 | */ 43 | @Transactional 44 | public int update(Address address) { 45 | return dao.update(address); 46 | } 47 | 48 | /** 49 | * @方法说明:更新收寄信息记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Address address) { 53 | return dao.updateNotNull(address); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页收寄信息列表 58 | */ 59 | public Page
queryPage(AddressCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页收寄信息列表(使用范型) 67 | */ 68 | public List
queryList(AddressCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 收寄信息 对象 74 | */ 75 | public Address findOne(AddressCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个收寄信息记录 81 | */ 82 | public Address findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询收寄信息记录个数 88 | */ 89 | public long queryCount(AddressCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 收寄信息 95 | */ 96 | @Transactional 97 | public int insertBatch(List
list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/bill/BillDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.bill; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 开票信息--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface BillDao { 10 | 11 | /** 12 | * @方法说明:物理删除开票信息记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新开票信息记录 18 | */ 19 | int update(Bill vo) ; 20 | 21 | /** 22 | * @方法说明:更新开票信息记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Bill vo); 25 | 26 | /** 27 | * @方法说明:新增开票信息记录 28 | */ 29 | int save(Bill vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页开票信息列表 33 | */ 34 | List queryList(BillCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 开票信息 对象 38 | */ 39 | Bill findOne(BillCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个开票信息实体 43 | */ 44 | Bill findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询开票信息记录个数 49 | */ 50 | long queryCount(BillCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询开票信息记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 开票信息 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/bill/BillListExpand.vue: -------------------------------------------------------------------------------- 1 | 35 | 40 | 50 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/bill/BillMock.js: -------------------------------------------------------------------------------- 1 | /*开票信息模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/bill/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | busId: "@integer(100,200)",//供应商 12 | bank : "@word(5,10)",// 开户行 13 | account : "@word(5,10)",// 账号 14 | taxpayerNo : "@word(5,10)",// 纳税人识别号 15 | remark : "@word(5,10)",// 备注 16 | busType: "@integer(100,200)",//bus_type 17 | }], 18 | 'number': '@integer(100,200)', 19 | 'size': 10, 20 | 'totalElements': 500, 21 | }); 22 | 23 | var resp = { 24 | "code": 200, 25 | "errorMsg": "请求成功", 26 | "data":data 27 | }; 28 | 29 | setTimeout(function () { 30 | res.json(resp); 31 | }, 500); 32 | }, 33 | 34 | 'POST /api/bill/update': function (req, res, next) { 35 | var resp = { 36 | "code": 200, 37 | "errorMsg": "请求成功", 38 | "data":1 39 | }; 40 | setTimeout(function () { 41 | res.json(resp); 42 | }, 500); 43 | }, 44 | 45 | 'POST /api/bill/save': function (req, res, next) { 46 | var resp = { 47 | "code": 200, 48 | "errorMsg": "请求成功", 49 | "data":1 50 | }; 51 | setTimeout(function () { 52 | res.json(resp); 53 | }, 500); 54 | }, 55 | 56 | 'POST /api/bill/queryList': function (req, res, next) { 57 | var data = Mock.mock({ 58 | 'content|10': [{ 59 | id: "@integer(100,200)",//主键 60 | busId: "@integer(100,200)",//供应商 61 | bank : "@word(5,10)",// 开户行 62 | account : "@word(5,10)",// 账号 63 | taxpayerNo : "@word(5,10)",// 纳税人识别号 64 | remark : "@word(5,10)",// 备注 65 | busType: "@integer(100,200)",//bus_type 66 | }] 67 | }); 68 | var resp = { 69 | "code": 200, 70 | "errorMsg": "请求成功", 71 | "data":data.content 72 | }; 73 | 74 | setTimeout(function () { 75 | res.json(resp); 76 | }, 500); 77 | 78 | }, 79 | 80 | 'POST /api/bill/delete': function (req, res, next) { 81 | var resp = { 82 | "code": 200, 83 | "errorMsg": "请求成功", 84 | "data":1 85 | }; 86 | setTimeout(function () { 87 | res.json(resp); 88 | }, 500); 89 | }, 90 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/bill/BillService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.bill; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 开票信息--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class BillService { 18 | 19 | 20 | @Autowired 21 | private BillDao dao; //注入开票信息数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[开票信息]记录 25 | */ 26 | @Transactional 27 | public int save(Bill bill) { 28 | return dao.save(bill); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除开票信息记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新开票信息记录 42 | */ 43 | @Transactional 44 | public int update(Bill bill) { 45 | return dao.update(bill); 46 | } 47 | 48 | /** 49 | * @方法说明:更新开票信息记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Bill bill) { 53 | return dao.updateNotNull(bill); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页开票信息列表 58 | */ 59 | public Page queryPage(BillCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页开票信息列表(使用范型) 67 | */ 68 | public List queryList(BillCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 开票信息 对象 74 | */ 75 | public Bill findOne(BillCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个开票信息记录 81 | */ 82 | public Bill findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询开票信息记录个数 88 | */ 89 | public long queryCount(BillCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 开票信息 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/category/Category.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.category ; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | /** 6 | * @类说明: 税收分类--实体类 7 | * @author: alvin198761@163.com 8 | * @date : 2019-11-17 21:00:17 9 | **/ 10 | @ApiModel(value = "Category", description = "税收分类实体") 11 | public class Category { 12 | 13 | //数据库中的字段 14 | @ApiModelProperty(value = "主键", dataType = "Long") 15 | private Long id ;// 主键 16 | @ApiModelProperty(value = "名称", dataType = "String") 17 | private String name ;// 名称 18 | @ApiModelProperty(value = "税收编码", dataType = "String") 19 | private String taxCode ;// 税收编码 20 | 21 | //此处可添加查询显示辅助字段 22 | 23 | //getters and setters 24 | /** 25 | * @return 主键 26 | */ 27 | public Long getId(){ 28 | return this.id ; 29 | } 30 | 31 | /** 32 | * @param 主键 33 | */ 34 | public void setId(Long id){ 35 | this.id = id; 36 | } 37 | 38 | /** 39 | * @return 名称 40 | */ 41 | public String getName(){ 42 | return this.name ; 43 | } 44 | 45 | /** 46 | * @param 名称 47 | */ 48 | public void setName(String name){ 49 | this.name = name; 50 | } 51 | 52 | /** 53 | * @return 税收编码 54 | */ 55 | public String getTaxCode(){ 56 | return this.taxCode ; 57 | } 58 | 59 | /** 60 | * @param 税收编码 61 | */ 62 | public void setTaxCode(String taxCode){ 63 | this.taxCode = taxCode; 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/category/CategoryCond.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.category ; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import java.util.List; 6 | 7 | 8 | /** 9 | * @类说明: 税收分类--查询条件实体类 10 | * @author: alvin198761@163.com 11 | * @date : 2019-11-17 21:00:17 12 | **/ 13 | @ApiModel(value = "CategoryCond", description = "税收分类查询条件实体") 14 | public class CategoryCond { 15 | 16 | //feilds 17 | @ApiModelProperty(value = "主键", dataType = "Long") 18 | private Long id ;// 主键 19 | @ApiModelProperty(value = "名称", dataType = "String") 20 | private String name ;// 名称 21 | @ApiModelProperty(value = "税收编码", dataType = "String") 22 | private String taxCode ;// 税收编码 23 | // 通用变量 24 | private List ids;// 主键列表 25 | private Integer pageSize = 10; //每页条数 26 | private Integer total; //总条数 27 | private Integer pageNum; //当前页码 28 | 29 | 30 | //getters and setters 31 | /** 32 | * @return 主键 33 | */ 34 | public Long getId(){ 35 | return this.id ; 36 | } 37 | 38 | /** 39 | * @param 主键 40 | */ 41 | public void setId(Long id){ 42 | this.id = id; 43 | } 44 | 45 | /** 46 | * @return 名称 47 | */ 48 | public String getName(){ 49 | return this.name ; 50 | } 51 | 52 | /** 53 | * @param 名称 54 | */ 55 | public void setName(String name){ 56 | this.name = name; 57 | } 58 | 59 | /** 60 | * @return 税收编码 61 | */ 62 | public String getTaxCode(){ 63 | return this.taxCode ; 64 | } 65 | 66 | /** 67 | * @param 税收编码 68 | */ 69 | public void setTaxCode(String taxCode){ 70 | this.taxCode = taxCode; 71 | } 72 | 73 | /** 74 | * @return 主键列表 75 | */ 76 | public List getIds(){ 77 | return this.ids; 78 | } 79 | 80 | /** 81 | *@param 主键列表 82 | */ 83 | public void setIds(Long ids){ 84 | this.ids = ids; 85 | } 86 | 87 | /** 88 | * @return 每页条数 89 | */ 90 | public Integer getPageSize(){ 91 | return this.pageSize; 92 | } 93 | 94 | /** 95 | *@param 每页条数 96 | */ 97 | public void setPageSize(Integer pageSize){ 98 | this.pageSize = pageSize; 99 | } 100 | 101 | /** 102 | * @return 总条数 103 | */ 104 | public Integer getTotal(){ 105 | return this.total; 106 | } 107 | 108 | /** 109 | *@param 总条数 110 | */ 111 | public void setTotal(Integer total){ 112 | this.total = total; 113 | } 114 | 115 | /** 116 | * @return 当前页码 117 | */ 118 | public Integer getPageNum(){ 119 | return this.pageNum; 120 | } 121 | 122 | /** 123 | *@param 当前页码 124 | */ 125 | public void setPageNum(Integer pageNum){ 126 | this.pageNum = pageNum; 127 | } 128 | 129 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/category/CategoryDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.category; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 税收分类--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface CategoryDao { 10 | 11 | /** 12 | * @方法说明:物理删除税收分类记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新税收分类记录 18 | */ 19 | int update(Category vo) ; 20 | 21 | /** 22 | * @方法说明:更新税收分类记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Category vo); 25 | 26 | /** 27 | * @方法说明:新增税收分类记录 28 | */ 29 | int save(Category vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页税收分类列表 33 | */ 34 | List queryList(CategoryCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 税收分类 对象 38 | */ 39 | Category findOne(CategoryCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个税收分类实体 43 | */ 44 | Category findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询税收分类记录个数 49 | */ 50 | long queryCount(CategoryCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询税收分类记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 税收分类 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/category/CategoryListExpand.vue: -------------------------------------------------------------------------------- 1 | 19 | 24 | 34 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/category/CategoryMock.js: -------------------------------------------------------------------------------- 1 | /*税收分类模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/category/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | name : "@word(5,10)",// 名称 12 | taxCode : "@word(5,10)",// 税收编码 13 | }], 14 | 'number': '@integer(100,200)', 15 | 'size': 10, 16 | 'totalElements': 500, 17 | }); 18 | 19 | var resp = { 20 | "code": 200, 21 | "errorMsg": "请求成功", 22 | "data":data 23 | }; 24 | 25 | setTimeout(function () { 26 | res.json(resp); 27 | }, 500); 28 | }, 29 | 30 | 'POST /api/category/update': function (req, res, next) { 31 | var resp = { 32 | "code": 200, 33 | "errorMsg": "请求成功", 34 | "data":1 35 | }; 36 | setTimeout(function () { 37 | res.json(resp); 38 | }, 500); 39 | }, 40 | 41 | 'POST /api/category/save': function (req, res, next) { 42 | var resp = { 43 | "code": 200, 44 | "errorMsg": "请求成功", 45 | "data":1 46 | }; 47 | setTimeout(function () { 48 | res.json(resp); 49 | }, 500); 50 | }, 51 | 52 | 'POST /api/category/queryList': function (req, res, next) { 53 | var data = Mock.mock({ 54 | 'content|10': [{ 55 | id: "@integer(100,200)",//主键 56 | name : "@word(5,10)",// 名称 57 | taxCode : "@word(5,10)",// 税收编码 58 | }] 59 | }); 60 | var resp = { 61 | "code": 200, 62 | "errorMsg": "请求成功", 63 | "data":data.content 64 | }; 65 | 66 | setTimeout(function () { 67 | res.json(resp); 68 | }, 500); 69 | 70 | }, 71 | 72 | 'POST /api/category/delete': function (req, res, next) { 73 | var resp = { 74 | "code": 200, 75 | "errorMsg": "请求成功", 76 | "data":1 77 | }; 78 | setTimeout(function () { 79 | res.json(resp); 80 | }, 500); 81 | }, 82 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/category/CategoryService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.category; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 税收分类--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class CategoryService { 18 | 19 | 20 | @Autowired 21 | private CategoryDao dao; //注入税收分类数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[税收分类]记录 25 | */ 26 | @Transactional 27 | public int save(Category category) { 28 | return dao.save(category); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除税收分类记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新税收分类记录 42 | */ 43 | @Transactional 44 | public int update(Category category) { 45 | return dao.update(category); 46 | } 47 | 48 | /** 49 | * @方法说明:更新税收分类记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Category category) { 53 | return dao.updateNotNull(category); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页税收分类列表 58 | */ 59 | public Page queryPage(CategoryCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页税收分类列表(使用范型) 67 | */ 68 | public List queryList(CategoryCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 税收分类 对象 74 | */ 75 | public Category findOne(CategoryCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个税收分类记录 81 | */ 82 | public Category findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询税收分类记录个数 88 | */ 89 | public long queryCount(CategoryCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 税收分类 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/customer/Customer.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.customer ; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | /** 6 | * @类说明: 客户--实体类 7 | * @author: alvin198761@163.com 8 | * @date : 2019-11-17 21:00:17 9 | **/ 10 | @ApiModel(value = "Customer", description = "客户实体") 11 | public class Customer { 12 | 13 | //数据库中的字段 14 | @ApiModelProperty(value = "主键", dataType = "Long") 15 | private Long id ;// 主键 16 | @ApiModelProperty(value = "客户编号", dataType = "String") 17 | private String cusNo ;// 客户编号 18 | @ApiModelProperty(value = "单位名称", dataType = "String") 19 | private String cusName ;// 单位名称 20 | @ApiModelProperty(value = "客户地址", dataType = "String") 21 | private String address ;// 客户地址 22 | @ApiModelProperty(value = "客户性质", dataType = "Byte") 23 | private Byte cusType ;// 客户性质 24 | @ApiModelProperty(value = "备注", dataType = "String") 25 | private String remark ;// 备注 26 | 27 | //此处可添加查询显示辅助字段 28 | 29 | //getters and setters 30 | /** 31 | * @return 主键 32 | */ 33 | public Long getId(){ 34 | return this.id ; 35 | } 36 | 37 | /** 38 | * @param 主键 39 | */ 40 | public void setId(Long id){ 41 | this.id = id; 42 | } 43 | 44 | /** 45 | * @return 客户编号 46 | */ 47 | public String getCusNo(){ 48 | return this.cusNo ; 49 | } 50 | 51 | /** 52 | * @param 客户编号 53 | */ 54 | public void setCusNo(String cusNo){ 55 | this.cusNo = cusNo; 56 | } 57 | 58 | /** 59 | * @return 单位名称 60 | */ 61 | public String getCusName(){ 62 | return this.cusName ; 63 | } 64 | 65 | /** 66 | * @param 单位名称 67 | */ 68 | public void setCusName(String cusName){ 69 | this.cusName = cusName; 70 | } 71 | 72 | /** 73 | * @return 客户地址 74 | */ 75 | public String getAddress(){ 76 | return this.address ; 77 | } 78 | 79 | /** 80 | * @param 客户地址 81 | */ 82 | public void setAddress(String address){ 83 | this.address = address; 84 | } 85 | 86 | /** 87 | * @return 客户性质 88 | */ 89 | public Byte getCusType(){ 90 | return this.cusType ; 91 | } 92 | 93 | /** 94 | * @param 客户性质 95 | */ 96 | public void setCusType(Byte cusType){ 97 | this.cusType = cusType; 98 | } 99 | 100 | /** 101 | * @return 备注 102 | */ 103 | public String getRemark(){ 104 | return this.remark ; 105 | } 106 | 107 | /** 108 | * @param 备注 109 | */ 110 | public void setRemark(String remark){ 111 | this.remark = remark; 112 | } 113 | 114 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/customer/CustomerDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.customer; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 客户--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface CustomerDao { 10 | 11 | /** 12 | * @方法说明:物理删除客户记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新客户记录 18 | */ 19 | int update(Customer vo) ; 20 | 21 | /** 22 | * @方法说明:更新客户记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Customer vo); 25 | 26 | /** 27 | * @方法说明:新增客户记录 28 | */ 29 | int save(Customer vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页客户列表 33 | */ 34 | List queryList(CustomerCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 客户 对象 38 | */ 39 | Customer findOne(CustomerCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个客户实体 43 | */ 44 | Customer findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询客户记录个数 49 | */ 50 | long queryCount(CustomerCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询客户记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 客户 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/customer/CustomerListExpand.vue: -------------------------------------------------------------------------------- 1 | 31 | 36 | 46 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/customer/CustomerMock.js: -------------------------------------------------------------------------------- 1 | /*客户模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/customer/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | cusNo : "@word(5,10)",// 客户编号 12 | cusName : "@word(5,10)",// 单位名称 13 | address : "@word(5,10)",// 客户地址 14 | cusType: "@integer(100,200)",//客户性质 15 | remark : "@word(5,10)",// 备注 16 | }], 17 | 'number': '@integer(100,200)', 18 | 'size': 10, 19 | 'totalElements': 500, 20 | }); 21 | 22 | var resp = { 23 | "code": 200, 24 | "errorMsg": "请求成功", 25 | "data":data 26 | }; 27 | 28 | setTimeout(function () { 29 | res.json(resp); 30 | }, 500); 31 | }, 32 | 33 | 'POST /api/customer/update': function (req, res, next) { 34 | var resp = { 35 | "code": 200, 36 | "errorMsg": "请求成功", 37 | "data":1 38 | }; 39 | setTimeout(function () { 40 | res.json(resp); 41 | }, 500); 42 | }, 43 | 44 | 'POST /api/customer/save': function (req, res, next) { 45 | var resp = { 46 | "code": 200, 47 | "errorMsg": "请求成功", 48 | "data":1 49 | }; 50 | setTimeout(function () { 51 | res.json(resp); 52 | }, 500); 53 | }, 54 | 55 | 'POST /api/customer/queryList': function (req, res, next) { 56 | var data = Mock.mock({ 57 | 'content|10': [{ 58 | id: "@integer(100,200)",//主键 59 | cusNo : "@word(5,10)",// 客户编号 60 | cusName : "@word(5,10)",// 单位名称 61 | address : "@word(5,10)",// 客户地址 62 | cusType: "@integer(100,200)",//客户性质 63 | remark : "@word(5,10)",// 备注 64 | }] 65 | }); 66 | var resp = { 67 | "code": 200, 68 | "errorMsg": "请求成功", 69 | "data":data.content 70 | }; 71 | 72 | setTimeout(function () { 73 | res.json(resp); 74 | }, 500); 75 | 76 | }, 77 | 78 | 'POST /api/customer/delete': function (req, res, next) { 79 | var resp = { 80 | "code": 200, 81 | "errorMsg": "请求成功", 82 | "data":1 83 | }; 84 | setTimeout(function () { 85 | res.json(resp); 86 | }, 500); 87 | }, 88 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/customer/CustomerService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.customer; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 客户--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class CustomerService { 18 | 19 | 20 | @Autowired 21 | private CustomerDao dao; //注入客户数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[客户]记录 25 | */ 26 | @Transactional 27 | public int save(Customer customer) { 28 | return dao.save(customer); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除客户记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新客户记录 42 | */ 43 | @Transactional 44 | public int update(Customer customer) { 45 | return dao.update(customer); 46 | } 47 | 48 | /** 49 | * @方法说明:更新客户记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Customer customer) { 53 | return dao.updateNotNull(customer); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页客户列表 58 | */ 59 | public Page queryPage(CustomerCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页客户列表(使用范型) 67 | */ 68 | public List queryList(CustomerCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 客户 对象 74 | */ 75 | public Customer findOne(CustomerCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个客户记录 81 | */ 82 | public Customer findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询客户记录个数 88 | */ 89 | public long queryCount(CustomerCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 客户 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/dept/DeptDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.dept; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: admin_dept--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface DeptDao { 10 | 11 | /** 12 | * @方法说明:物理删除admin_dept记录(多条) 13 | */ 14 | int delete(Integer ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新admin_dept记录 18 | */ 19 | int update(Dept vo) ; 20 | 21 | /** 22 | * @方法说明:更新admin_dept记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Dept vo); 25 | 26 | /** 27 | * @方法说明:新增admin_dept记录 28 | */ 29 | int save(Dept vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页admin_dept列表 33 | */ 34 | List queryList(DeptCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 admin_dept 对象 38 | */ 39 | Dept findOne(DeptCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个admin_dept实体 43 | */ 44 | Dept findById(Integer id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询admin_dept记录个数 49 | */ 50 | long queryCount(DeptCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询admin_dept记录个数 54 | */ 55 | int deleteLogic(Integer ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 admin_dept 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/dept/DeptListExpand.vue: -------------------------------------------------------------------------------- 1 | 47 | 52 | 62 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/dept/DeptService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.dept; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: admin_dept--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class DeptService { 18 | 19 | 20 | @Autowired 21 | private DeptDao dao; //注入admin_dept数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[admin_dept]记录 25 | */ 26 | @Transactional 27 | public int save(Dept dept) { 28 | return dao.save(dept); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除admin_dept记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Integer ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新admin_dept记录 42 | */ 43 | @Transactional 44 | public int update(Dept dept) { 45 | return dao.update(dept); 46 | } 47 | 48 | /** 49 | * @方法说明:更新admin_dept记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Dept dept) { 53 | return dao.updateNotNull(dept); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页admin_dept列表 58 | */ 59 | public Page queryPage(DeptCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页admin_dept列表(使用范型) 67 | */ 68 | public List queryList(DeptCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 admin_dept 对象 74 | */ 75 | public Dept findOne(DeptCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个admin_dept记录 81 | */ 82 | public Dept findById(Integer id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询admin_dept记录个数 88 | */ 89 | public long queryCount(DeptCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 admin_dept 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/dict/Dict.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.dict ; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | /** 6 | * @类说明: 类型字典--实体类 7 | * @author: alvin198761@163.com 8 | * @date : 2019-11-17 21:00:17 9 | **/ 10 | @ApiModel(value = "Dict", description = "类型字典实体") 11 | public class Dict { 12 | 13 | //数据库中的字段 14 | @ApiModelProperty(value = "主键", dataType = "Long") 15 | private Long id ;// 主键 16 | @ApiModelProperty(value = "主键", dataType = "Long") 17 | private Long id ;// 主键 18 | @ApiModelProperty(value = "type", dataType = "Integer") 19 | private Integer type ;// type 20 | @ApiModelProperty(value = "type", dataType = "Integer") 21 | private Integer type ;// type 22 | @ApiModelProperty(value = "name", dataType = "String") 23 | private String name ;// name 24 | @ApiModelProperty(value = "name", dataType = "String") 25 | private String name ;// name 26 | 27 | //此处可添加查询显示辅助字段 28 | 29 | //getters and setters 30 | /** 31 | * @return 主键 32 | */ 33 | public Long getId(){ 34 | return this.id ; 35 | } 36 | 37 | /** 38 | * @param 主键 39 | */ 40 | public void setId(Long id){ 41 | this.id = id; 42 | } 43 | 44 | /** 45 | * @return 主键 46 | */ 47 | public Long getId(){ 48 | return this.id ; 49 | } 50 | 51 | /** 52 | * @param 主键 53 | */ 54 | public void setId(Long id){ 55 | this.id = id; 56 | } 57 | 58 | /** 59 | * @return type 60 | */ 61 | public Integer getType(){ 62 | return this.type ; 63 | } 64 | 65 | /** 66 | * @param type 67 | */ 68 | public void setType(Integer type){ 69 | this.type = type; 70 | } 71 | 72 | /** 73 | * @return type 74 | */ 75 | public Integer getType(){ 76 | return this.type ; 77 | } 78 | 79 | /** 80 | * @param type 81 | */ 82 | public void setType(Integer type){ 83 | this.type = type; 84 | } 85 | 86 | /** 87 | * @return name 88 | */ 89 | public String getName(){ 90 | return this.name ; 91 | } 92 | 93 | /** 94 | * @param name 95 | */ 96 | public void setName(String name){ 97 | this.name = name; 98 | } 99 | 100 | /** 101 | * @return name 102 | */ 103 | public String getName(){ 104 | return this.name ; 105 | } 106 | 107 | /** 108 | * @param name 109 | */ 110 | public void setName(String name){ 111 | this.name = name; 112 | } 113 | 114 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/dict/DictDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.dict; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 类型字典--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface DictDao { 10 | 11 | /** 12 | * @方法说明:物理删除类型字典记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新类型字典记录 18 | */ 19 | int update(Dict vo) ; 20 | 21 | /** 22 | * @方法说明:更新类型字典记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Dict vo); 25 | 26 | /** 27 | * @方法说明:新增类型字典记录 28 | */ 29 | int save(Dict vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页类型字典列表 33 | */ 34 | List queryList(DictCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 类型字典 对象 38 | */ 39 | Dict findOne(DictCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个类型字典实体 43 | */ 44 | Dict findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询类型字典记录个数 49 | */ 50 | long queryCount(DictCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询类型字典记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 类型字典 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/dict/DictListExpand.vue: -------------------------------------------------------------------------------- 1 | 31 | 36 | 46 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/dict/DictMock.js: -------------------------------------------------------------------------------- 1 | /*类型字典模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/dict/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | id: "@integer(100,200)",//主键 12 | type: "@integer(100,200)",//type 13 | type: "@integer(100,200)",//type 14 | name : "@word(5,10)",// name 15 | name : "@word(5,10)",// name 16 | }], 17 | 'number': '@integer(100,200)', 18 | 'size': 10, 19 | 'totalElements': 500, 20 | }); 21 | 22 | var resp = { 23 | "code": 200, 24 | "errorMsg": "请求成功", 25 | "data":data 26 | }; 27 | 28 | setTimeout(function () { 29 | res.json(resp); 30 | }, 500); 31 | }, 32 | 33 | 'POST /api/dict/update': function (req, res, next) { 34 | var resp = { 35 | "code": 200, 36 | "errorMsg": "请求成功", 37 | "data":1 38 | }; 39 | setTimeout(function () { 40 | res.json(resp); 41 | }, 500); 42 | }, 43 | 44 | 'POST /api/dict/save': function (req, res, next) { 45 | var resp = { 46 | "code": 200, 47 | "errorMsg": "请求成功", 48 | "data":1 49 | }; 50 | setTimeout(function () { 51 | res.json(resp); 52 | }, 500); 53 | }, 54 | 55 | 'POST /api/dict/queryList': function (req, res, next) { 56 | var data = Mock.mock({ 57 | 'content|10': [{ 58 | id: "@integer(100,200)",//主键 59 | id: "@integer(100,200)",//主键 60 | type: "@integer(100,200)",//type 61 | type: "@integer(100,200)",//type 62 | name : "@word(5,10)",// name 63 | name : "@word(5,10)",// name 64 | }] 65 | }); 66 | var resp = { 67 | "code": 200, 68 | "errorMsg": "请求成功", 69 | "data":data.content 70 | }; 71 | 72 | setTimeout(function () { 73 | res.json(resp); 74 | }, 500); 75 | 76 | }, 77 | 78 | 'POST /api/dict/delete': function (req, res, next) { 79 | var resp = { 80 | "code": 200, 81 | "errorMsg": "请求成功", 82 | "data":1 83 | }; 84 | setTimeout(function () { 85 | res.json(resp); 86 | }, 500); 87 | }, 88 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/dict/DictService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.dict; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 类型字典--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class DictService { 18 | 19 | 20 | @Autowired 21 | private DictDao dao; //注入类型字典数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[类型字典]记录 25 | */ 26 | @Transactional 27 | public int save(Dict dict) { 28 | return dao.save(dict); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除类型字典记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新类型字典记录 42 | */ 43 | @Transactional 44 | public int update(Dict dict) { 45 | return dao.update(dict); 46 | } 47 | 48 | /** 49 | * @方法说明:更新类型字典记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Dict dict) { 53 | return dao.updateNotNull(dict); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页类型字典列表 58 | */ 59 | public Page queryPage(DictCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页类型字典列表(使用范型) 67 | */ 68 | public List queryList(DictCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 类型字典 对象 74 | */ 75 | public Dict findOne(DictCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个类型字典记录 81 | */ 82 | public Dict findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询类型字典记录个数 88 | */ 89 | public long queryCount(DictCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 类型字典 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/func/FuncDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.func; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 菜单--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface FuncDao { 10 | 11 | /** 12 | * @方法说明:物理删除菜单记录(多条) 13 | */ 14 | int delete(Integer ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新菜单记录 18 | */ 19 | int update(Func vo) ; 20 | 21 | /** 22 | * @方法说明:更新菜单记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Func vo); 25 | 26 | /** 27 | * @方法说明:新增菜单记录 28 | */ 29 | int save(Func vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页菜单列表 33 | */ 34 | List queryList(FuncCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 菜单 对象 38 | */ 39 | Func findOne(FuncCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个菜单实体 43 | */ 44 | Func findById(Integer id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询菜单记录个数 49 | */ 50 | long queryCount(FuncCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询菜单记录个数 54 | */ 55 | int deleteLogic(Integer ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 菜单 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/func/FuncService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.func; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 菜单--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class FuncService { 18 | 19 | 20 | @Autowired 21 | private FuncDao dao; //注入菜单数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[菜单]记录 25 | */ 26 | @Transactional 27 | public int save(Func func) { 28 | return dao.save(func); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除菜单记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Integer ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新菜单记录 42 | */ 43 | @Transactional 44 | public int update(Func func) { 45 | return dao.update(func); 46 | } 47 | 48 | /** 49 | * @方法说明:更新菜单记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Func func) { 53 | return dao.updateNotNull(func); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页菜单列表 58 | */ 59 | public Page queryPage(FuncCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页菜单列表(使用范型) 67 | */ 68 | public List queryList(FuncCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 菜单 对象 74 | */ 75 | public Func findOne(FuncCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个菜单记录 81 | */ 82 | public Func findById(Integer id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询菜单记录个数 88 | */ 89 | public long queryCount(FuncCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 菜单 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/inbound/InboundDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.inbound; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 入库记录--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface InboundDao { 10 | 11 | /** 12 | * @方法说明:物理删除入库记录记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新入库记录记录 18 | */ 19 | int update(Inbound vo) ; 20 | 21 | /** 22 | * @方法说明:更新入库记录记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Inbound vo); 25 | 26 | /** 27 | * @方法说明:新增入库记录记录 28 | */ 29 | int save(Inbound vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页入库记录列表 33 | */ 34 | List queryList(InboundCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 入库记录 对象 38 | */ 39 | Inbound findOne(InboundCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个入库记录实体 43 | */ 44 | Inbound findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询入库记录记录个数 49 | */ 50 | long queryCount(InboundCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询入库记录记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 入库记录 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/inbound/InboundListExpand.vue: -------------------------------------------------------------------------------- 1 | 31 | 36 | 46 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/inbound/InboundMock.js: -------------------------------------------------------------------------------- 1 | /*入库记录模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/inbound/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | prodId : "@word(5,10)",// 产品id 12 | date: "@integer(100,200)",//入库日期 13 | ticketType : "@word(5,10)",// 发票类型 14 | ticketStatus : "@word(5,10)",// 发票状态 15 | remark : "@word(5,10)",// 备注 16 | }], 17 | 'number': '@integer(100,200)', 18 | 'size': 10, 19 | 'totalElements': 500, 20 | }); 21 | 22 | var resp = { 23 | "code": 200, 24 | "errorMsg": "请求成功", 25 | "data":data 26 | }; 27 | 28 | setTimeout(function () { 29 | res.json(resp); 30 | }, 500); 31 | }, 32 | 33 | 'POST /api/inbound/update': function (req, res, next) { 34 | var resp = { 35 | "code": 200, 36 | "errorMsg": "请求成功", 37 | "data":1 38 | }; 39 | setTimeout(function () { 40 | res.json(resp); 41 | }, 500); 42 | }, 43 | 44 | 'POST /api/inbound/save': function (req, res, next) { 45 | var resp = { 46 | "code": 200, 47 | "errorMsg": "请求成功", 48 | "data":1 49 | }; 50 | setTimeout(function () { 51 | res.json(resp); 52 | }, 500); 53 | }, 54 | 55 | 'POST /api/inbound/queryList': function (req, res, next) { 56 | var data = Mock.mock({ 57 | 'content|10': [{ 58 | id: "@integer(100,200)",//主键 59 | prodId : "@word(5,10)",// 产品id 60 | date: "@integer(100,200)",//入库日期 61 | ticketType : "@word(5,10)",// 发票类型 62 | ticketStatus : "@word(5,10)",// 发票状态 63 | remark : "@word(5,10)",// 备注 64 | }] 65 | }); 66 | var resp = { 67 | "code": 200, 68 | "errorMsg": "请求成功", 69 | "data":data.content 70 | }; 71 | 72 | setTimeout(function () { 73 | res.json(resp); 74 | }, 500); 75 | 76 | }, 77 | 78 | 'POST /api/inbound/delete': function (req, res, next) { 79 | var resp = { 80 | "code": 200, 81 | "errorMsg": "请求成功", 82 | "data":1 83 | }; 84 | setTimeout(function () { 85 | res.json(resp); 86 | }, 500); 87 | }, 88 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/inbound/InboundService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.inbound; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 入库记录--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class InboundService { 18 | 19 | 20 | @Autowired 21 | private InboundDao dao; //注入入库记录数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[入库记录]记录 25 | */ 26 | @Transactional 27 | public int save(Inbound inbound) { 28 | return dao.save(inbound); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除入库记录记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新入库记录记录 42 | */ 43 | @Transactional 44 | public int update(Inbound inbound) { 45 | return dao.update(inbound); 46 | } 47 | 48 | /** 49 | * @方法说明:更新入库记录记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Inbound inbound) { 53 | return dao.updateNotNull(inbound); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页入库记录列表 58 | */ 59 | public Page queryPage(InboundCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页入库记录列表(使用范型) 67 | */ 68 | public List queryList(InboundCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 入库记录 对象 74 | */ 75 | public Inbound findOne(InboundCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个入库记录记录 81 | */ 82 | public Inbound findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询入库记录记录个数 88 | */ 89 | public long queryCount(InboundCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 入库记录 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/menu/MenuDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.menu; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: admin_menu--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface MenuDao { 10 | 11 | /** 12 | * @方法说明:物理删除admin_menu记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新admin_menu记录 18 | */ 19 | int update(Menu vo) ; 20 | 21 | /** 22 | * @方法说明:更新admin_menu记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Menu vo); 25 | 26 | /** 27 | * @方法说明:新增admin_menu记录 28 | */ 29 | int save(Menu vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页admin_menu列表 33 | */ 34 | List queryList(MenuCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 admin_menu 对象 38 | */ 39 | Menu findOne(MenuCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个admin_menu实体 43 | */ 44 | Menu findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询admin_menu记录个数 49 | */ 50 | long queryCount(MenuCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询admin_menu记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 admin_menu 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/menu/MenuListExpand.vue: -------------------------------------------------------------------------------- 1 | 55 | 60 | 70 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/menu/MenuService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.menu; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: admin_menu--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class MenuService { 18 | 19 | 20 | @Autowired 21 | private MenuDao dao; //注入admin_menu数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[admin_menu]记录 25 | */ 26 | @Transactional 27 | public int save(Menu menu) { 28 | return dao.save(menu); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除admin_menu记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新admin_menu记录 42 | */ 43 | @Transactional 44 | public int update(Menu menu) { 45 | return dao.update(menu); 46 | } 47 | 48 | /** 49 | * @方法说明:更新admin_menu记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Menu menu) { 53 | return dao.updateNotNull(menu); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页admin_menu列表 58 | */ 59 | public Page queryPage(MenuCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页admin_menu列表(使用范型) 67 | */ 68 | public List queryList(MenuCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 admin_menu 对象 74 | */ 75 | public Menu findOne(MenuCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个admin_menu记录 81 | */ 82 | public Menu findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询admin_menu记录个数 88 | */ 89 | public long queryCount(MenuCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 admin_menu 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/menurule/MenuRule.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.menurule ; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | /** 6 | * @类说明: admin_menu_rule--实体类 7 | * @author: alvin198761@163.com 8 | * @date : 2019-11-17 21:00:17 9 | **/ 10 | @ApiModel(value = "MenuRule", description = "admin_menu_rule实体") 11 | public class MenuRule { 12 | 13 | //数据库中的字段 14 | @ApiModelProperty(value = "id", dataType = "Long") 15 | private Long id ;// id 16 | @ApiModelProperty(value = "id", dataType = "Long") 17 | private Long id ;// id 18 | @ApiModelProperty(value = "did", dataType = "Long") 19 | private Long did ;// did 20 | @ApiModelProperty(value = "did", dataType = "Long") 21 | private Long did ;// did 22 | @ApiModelProperty(value = "mid", dataType = "Long") 23 | private Long mid ;// mid 24 | @ApiModelProperty(value = "mid", dataType = "Long") 25 | private Long mid ;// mid 26 | 27 | //此处可添加查询显示辅助字段 28 | 29 | //getters and setters 30 | /** 31 | * @return id 32 | */ 33 | public Long getId(){ 34 | return this.id ; 35 | } 36 | 37 | /** 38 | * @param id 39 | */ 40 | public void setId(Long id){ 41 | this.id = id; 42 | } 43 | 44 | /** 45 | * @return id 46 | */ 47 | public Long getId(){ 48 | return this.id ; 49 | } 50 | 51 | /** 52 | * @param id 53 | */ 54 | public void setId(Long id){ 55 | this.id = id; 56 | } 57 | 58 | /** 59 | * @return did 60 | */ 61 | public Long getDid(){ 62 | return this.did ; 63 | } 64 | 65 | /** 66 | * @param did 67 | */ 68 | public void setDid(Long did){ 69 | this.did = did; 70 | } 71 | 72 | /** 73 | * @return did 74 | */ 75 | public Long getDid(){ 76 | return this.did ; 77 | } 78 | 79 | /** 80 | * @param did 81 | */ 82 | public void setDid(Long did){ 83 | this.did = did; 84 | } 85 | 86 | /** 87 | * @return mid 88 | */ 89 | public Long getMid(){ 90 | return this.mid ; 91 | } 92 | 93 | /** 94 | * @param mid 95 | */ 96 | public void setMid(Long mid){ 97 | this.mid = mid; 98 | } 99 | 100 | /** 101 | * @return mid 102 | */ 103 | public Long getMid(){ 104 | return this.mid ; 105 | } 106 | 107 | /** 108 | * @param mid 109 | */ 110 | public void setMid(Long mid){ 111 | this.mid = mid; 112 | } 113 | 114 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/menurule/MenuRuleDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.menurule; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: admin_menu_rule--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface MenuRuleDao { 10 | 11 | /** 12 | * @方法说明:物理删除admin_menu_rule记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新admin_menu_rule记录 18 | */ 19 | int update(MenuRule vo) ; 20 | 21 | /** 22 | * @方法说明:更新admin_menu_rule记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(MenuRule vo); 25 | 26 | /** 27 | * @方法说明:新增admin_menu_rule记录 28 | */ 29 | int save(MenuRule vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页admin_menu_rule列表 33 | */ 34 | List queryList(MenuRuleCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 admin_menu_rule 对象 38 | */ 39 | MenuRule findOne(MenuRuleCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个admin_menu_rule实体 43 | */ 44 | MenuRule findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询admin_menu_rule记录个数 49 | */ 50 | long queryCount(MenuRuleCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询admin_menu_rule记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 admin_menu_rule 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/menurule/MenuRuleListExpand.vue: -------------------------------------------------------------------------------- 1 | 31 | 36 | 46 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/menurule/MenuRuleMock.js: -------------------------------------------------------------------------------- 1 | /*admin_menu_rule模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/menuRule/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//id 11 | id: "@integer(100,200)",//id 12 | did: "@integer(100,200)",//did 13 | did: "@integer(100,200)",//did 14 | mid: "@integer(100,200)",//mid 15 | mid: "@integer(100,200)",//mid 16 | }], 17 | 'number': '@integer(100,200)', 18 | 'size': 10, 19 | 'totalElements': 500, 20 | }); 21 | 22 | var resp = { 23 | "code": 200, 24 | "errorMsg": "请求成功", 25 | "data":data 26 | }; 27 | 28 | setTimeout(function () { 29 | res.json(resp); 30 | }, 500); 31 | }, 32 | 33 | 'POST /api/menuRule/update': function (req, res, next) { 34 | var resp = { 35 | "code": 200, 36 | "errorMsg": "请求成功", 37 | "data":1 38 | }; 39 | setTimeout(function () { 40 | res.json(resp); 41 | }, 500); 42 | }, 43 | 44 | 'POST /api/menuRule/save': function (req, res, next) { 45 | var resp = { 46 | "code": 200, 47 | "errorMsg": "请求成功", 48 | "data":1 49 | }; 50 | setTimeout(function () { 51 | res.json(resp); 52 | }, 500); 53 | }, 54 | 55 | 'POST /api/menuRule/queryList': function (req, res, next) { 56 | var data = Mock.mock({ 57 | 'content|10': [{ 58 | id: "@integer(100,200)",//id 59 | id: "@integer(100,200)",//id 60 | did: "@integer(100,200)",//did 61 | did: "@integer(100,200)",//did 62 | mid: "@integer(100,200)",//mid 63 | mid: "@integer(100,200)",//mid 64 | }] 65 | }); 66 | var resp = { 67 | "code": 200, 68 | "errorMsg": "请求成功", 69 | "data":data.content 70 | }; 71 | 72 | setTimeout(function () { 73 | res.json(resp); 74 | }, 500); 75 | 76 | }, 77 | 78 | 'POST /api/menuRule/delete': function (req, res, next) { 79 | var resp = { 80 | "code": 200, 81 | "errorMsg": "请求成功", 82 | "data":1 83 | }; 84 | setTimeout(function () { 85 | res.json(resp); 86 | }, 500); 87 | }, 88 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/menurule/MenuRuleService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.menurule; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: admin_menu_rule--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class MenuRuleService { 18 | 19 | 20 | @Autowired 21 | private MenuRuleDao dao; //注入admin_menu_rule数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[admin_menu_rule]记录 25 | */ 26 | @Transactional 27 | public int save(MenuRule menuRule) { 28 | return dao.save(menuRule); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除admin_menu_rule记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新admin_menu_rule记录 42 | */ 43 | @Transactional 44 | public int update(MenuRule menuRule) { 45 | return dao.update(menuRule); 46 | } 47 | 48 | /** 49 | * @方法说明:更新admin_menu_rule记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(MenuRule menuRule) { 53 | return dao.updateNotNull(menuRule); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页admin_menu_rule列表 58 | */ 59 | public Page queryPage(MenuRuleCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页admin_menu_rule列表(使用范型) 67 | */ 68 | public List queryList(MenuRuleCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 admin_menu_rule 对象 74 | */ 75 | public MenuRule findOne(MenuRuleCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个admin_menu_rule记录 81 | */ 82 | public MenuRule findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询admin_menu_rule记录个数 88 | */ 89 | public long queryCount(MenuRuleCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 admin_menu_rule 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/outbound/Outbound.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.outbound ; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | /** 6 | * @类说明: 出库记录--实体类 7 | * @author: alvin198761@163.com 8 | * @date : 2019-11-17 21:00:17 9 | **/ 10 | @ApiModel(value = "Outbound", description = "出库记录实体") 11 | public class Outbound { 12 | 13 | //数据库中的字段 14 | @ApiModelProperty(value = "主键", dataType = "Long") 15 | private Long id ;// 主键 16 | @ApiModelProperty(value = "客户id", dataType = "Long") 17 | private Long cusId ;// 客户id 18 | @ApiModelProperty(value = "送货状态", dataType = "String") 19 | private String status ;// 送货状态 20 | @ApiModelProperty(value = "备注", dataType = "String") 21 | private String remark ;// 备注 22 | @ApiModelProperty(value = "date", dataType = "Date") 23 | private Date date ;// date 24 | 25 | //此处可添加查询显示辅助字段 26 | 27 | //getters and setters 28 | /** 29 | * @return 主键 30 | */ 31 | public Long getId(){ 32 | return this.id ; 33 | } 34 | 35 | /** 36 | * @param 主键 37 | */ 38 | public void setId(Long id){ 39 | this.id = id; 40 | } 41 | 42 | /** 43 | * @return 客户id 44 | */ 45 | public Long getCusId(){ 46 | return this.cusId ; 47 | } 48 | 49 | /** 50 | * @param 客户id 51 | */ 52 | public void setCusId(Long cusId){ 53 | this.cusId = cusId; 54 | } 55 | 56 | /** 57 | * @return 送货状态 58 | */ 59 | public String getStatus(){ 60 | return this.status ; 61 | } 62 | 63 | /** 64 | * @param 送货状态 65 | */ 66 | public void setStatus(String status){ 67 | this.status = status; 68 | } 69 | 70 | /** 71 | * @return 备注 72 | */ 73 | public String getRemark(){ 74 | return this.remark ; 75 | } 76 | 77 | /** 78 | * @param 备注 79 | */ 80 | public void setRemark(String remark){ 81 | this.remark = remark; 82 | } 83 | 84 | /** 85 | * @return date 86 | */ 87 | public Date getDate(){ 88 | return this.date ; 89 | } 90 | 91 | /** 92 | * @param date 93 | */ 94 | public void setDate(Date date){ 95 | this.date = date; 96 | } 97 | 98 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/outbound/OutboundDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.outbound; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 出库记录--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface OutboundDao { 10 | 11 | /** 12 | * @方法说明:物理删除出库记录记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新出库记录记录 18 | */ 19 | int update(Outbound vo) ; 20 | 21 | /** 22 | * @方法说明:更新出库记录记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Outbound vo); 25 | 26 | /** 27 | * @方法说明:新增出库记录记录 28 | */ 29 | int save(Outbound vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页出库记录列表 33 | */ 34 | List queryList(OutboundCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 出库记录 对象 38 | */ 39 | Outbound findOne(OutboundCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个出库记录实体 43 | */ 44 | Outbound findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询出库记录记录个数 49 | */ 50 | long queryCount(OutboundCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询出库记录记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 出库记录 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/outbound/OutboundListExpand.vue: -------------------------------------------------------------------------------- 1 | 27 | 32 | 42 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/outbound/OutboundMock.js: -------------------------------------------------------------------------------- 1 | /*出库记录模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/outbound/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | cusId: "@integer(100,200)",//客户id 12 | status : "@word(5,10)",// 送货状态 13 | remark : "@word(5,10)",// 备注 14 | date: "@integer(100,200)",//date 15 | }], 16 | 'number': '@integer(100,200)', 17 | 'size': 10, 18 | 'totalElements': 500, 19 | }); 20 | 21 | var resp = { 22 | "code": 200, 23 | "errorMsg": "请求成功", 24 | "data":data 25 | }; 26 | 27 | setTimeout(function () { 28 | res.json(resp); 29 | }, 500); 30 | }, 31 | 32 | 'POST /api/outbound/update': function (req, res, next) { 33 | var resp = { 34 | "code": 200, 35 | "errorMsg": "请求成功", 36 | "data":1 37 | }; 38 | setTimeout(function () { 39 | res.json(resp); 40 | }, 500); 41 | }, 42 | 43 | 'POST /api/outbound/save': function (req, res, next) { 44 | var resp = { 45 | "code": 200, 46 | "errorMsg": "请求成功", 47 | "data":1 48 | }; 49 | setTimeout(function () { 50 | res.json(resp); 51 | }, 500); 52 | }, 53 | 54 | 'POST /api/outbound/queryList': function (req, res, next) { 55 | var data = Mock.mock({ 56 | 'content|10': [{ 57 | id: "@integer(100,200)",//主键 58 | cusId: "@integer(100,200)",//客户id 59 | status : "@word(5,10)",// 送货状态 60 | remark : "@word(5,10)",// 备注 61 | date: "@integer(100,200)",//date 62 | }] 63 | }); 64 | var resp = { 65 | "code": 200, 66 | "errorMsg": "请求成功", 67 | "data":data.content 68 | }; 69 | 70 | setTimeout(function () { 71 | res.json(resp); 72 | }, 500); 73 | 74 | }, 75 | 76 | 'POST /api/outbound/delete': function (req, res, next) { 77 | var resp = { 78 | "code": 200, 79 | "errorMsg": "请求成功", 80 | "data":1 81 | }; 82 | setTimeout(function () { 83 | res.json(resp); 84 | }, 500); 85 | }, 86 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/outbound/OutboundService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.outbound; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 出库记录--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class OutboundService { 18 | 19 | 20 | @Autowired 21 | private OutboundDao dao; //注入出库记录数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[出库记录]记录 25 | */ 26 | @Transactional 27 | public int save(Outbound outbound) { 28 | return dao.save(outbound); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除出库记录记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新出库记录记录 42 | */ 43 | @Transactional 44 | public int update(Outbound outbound) { 45 | return dao.update(outbound); 46 | } 47 | 48 | /** 49 | * @方法说明:更新出库记录记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Outbound outbound) { 53 | return dao.updateNotNull(outbound); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页出库记录列表 58 | */ 59 | public Page queryPage(OutboundCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页出库记录列表(使用范型) 67 | */ 68 | public List queryList(OutboundCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 出库记录 对象 74 | */ 75 | public Outbound findOne(OutboundCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个出库记录记录 81 | */ 82 | public Outbound findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询出库记录记录个数 88 | */ 89 | public long queryCount(OutboundCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 出库记录 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/person/Person.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.person ; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | /** 6 | * @类说明: 联系人--实体类 7 | * @author: alvin198761@163.com 8 | * @date : 2019-11-17 21:00:17 9 | **/ 10 | @ApiModel(value = "Person", description = "联系人实体") 11 | public class Person { 12 | 13 | //数据库中的字段 14 | @ApiModelProperty(value = "主键", dataType = "Long") 15 | private Long id ;// 主键 16 | @ApiModelProperty(value = "联系人姓名", dataType = "String") 17 | private String name ;// 联系人姓名 18 | @ApiModelProperty(value = "联系人电话", dataType = "String") 19 | private String phoneNo ;// 联系人电话 20 | @ApiModelProperty(value = "业务id", dataType = "Long") 21 | private Long busId ;// 业务id 22 | @ApiModelProperty(value = "业务类型", dataType = "Byte") 23 | private Byte busType ;// 业务类型 24 | 25 | //此处可添加查询显示辅助字段 26 | 27 | //getters and setters 28 | /** 29 | * @return 主键 30 | */ 31 | public Long getId(){ 32 | return this.id ; 33 | } 34 | 35 | /** 36 | * @param 主键 37 | */ 38 | public void setId(Long id){ 39 | this.id = id; 40 | } 41 | 42 | /** 43 | * @return 联系人姓名 44 | */ 45 | public String getName(){ 46 | return this.name ; 47 | } 48 | 49 | /** 50 | * @param 联系人姓名 51 | */ 52 | public void setName(String name){ 53 | this.name = name; 54 | } 55 | 56 | /** 57 | * @return 联系人电话 58 | */ 59 | public String getPhoneNo(){ 60 | return this.phoneNo ; 61 | } 62 | 63 | /** 64 | * @param 联系人电话 65 | */ 66 | public void setPhoneNo(String phoneNo){ 67 | this.phoneNo = phoneNo; 68 | } 69 | 70 | /** 71 | * @return 业务id 72 | */ 73 | public Long getBusId(){ 74 | return this.busId ; 75 | } 76 | 77 | /** 78 | * @param 业务id 79 | */ 80 | public void setBusId(Long busId){ 81 | this.busId = busId; 82 | } 83 | 84 | /** 85 | * @return 业务类型 86 | */ 87 | public Byte getBusType(){ 88 | return this.busType ; 89 | } 90 | 91 | /** 92 | * @param 业务类型 93 | */ 94 | public void setBusType(Byte busType){ 95 | this.busType = busType; 96 | } 97 | 98 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/person/PersonDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.person; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 联系人--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface PersonDao { 10 | 11 | /** 12 | * @方法说明:物理删除联系人记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新联系人记录 18 | */ 19 | int update(Person vo) ; 20 | 21 | /** 22 | * @方法说明:更新联系人记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Person vo); 25 | 26 | /** 27 | * @方法说明:新增联系人记录 28 | */ 29 | int save(Person vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页联系人列表 33 | */ 34 | List queryList(PersonCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 联系人 对象 38 | */ 39 | Person findOne(PersonCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个联系人实体 43 | */ 44 | Person findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询联系人记录个数 49 | */ 50 | long queryCount(PersonCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询联系人记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 联系人 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/person/PersonListExpand.vue: -------------------------------------------------------------------------------- 1 | 27 | 32 | 42 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/person/PersonMock.js: -------------------------------------------------------------------------------- 1 | /*联系人模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/person/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | name : "@word(5,10)",// 联系人姓名 12 | phoneNo : "@word(5,10)",// 联系人电话 13 | busId: "@integer(100,200)",//业务id 14 | busType: "@integer(100,200)",//业务类型 15 | }], 16 | 'number': '@integer(100,200)', 17 | 'size': 10, 18 | 'totalElements': 500, 19 | }); 20 | 21 | var resp = { 22 | "code": 200, 23 | "errorMsg": "请求成功", 24 | "data":data 25 | }; 26 | 27 | setTimeout(function () { 28 | res.json(resp); 29 | }, 500); 30 | }, 31 | 32 | 'POST /api/person/update': function (req, res, next) { 33 | var resp = { 34 | "code": 200, 35 | "errorMsg": "请求成功", 36 | "data":1 37 | }; 38 | setTimeout(function () { 39 | res.json(resp); 40 | }, 500); 41 | }, 42 | 43 | 'POST /api/person/save': function (req, res, next) { 44 | var resp = { 45 | "code": 200, 46 | "errorMsg": "请求成功", 47 | "data":1 48 | }; 49 | setTimeout(function () { 50 | res.json(resp); 51 | }, 500); 52 | }, 53 | 54 | 'POST /api/person/queryList': function (req, res, next) { 55 | var data = Mock.mock({ 56 | 'content|10': [{ 57 | id: "@integer(100,200)",//主键 58 | name : "@word(5,10)",// 联系人姓名 59 | phoneNo : "@word(5,10)",// 联系人电话 60 | busId: "@integer(100,200)",//业务id 61 | busType: "@integer(100,200)",//业务类型 62 | }] 63 | }); 64 | var resp = { 65 | "code": 200, 66 | "errorMsg": "请求成功", 67 | "data":data.content 68 | }; 69 | 70 | setTimeout(function () { 71 | res.json(resp); 72 | }, 500); 73 | 74 | }, 75 | 76 | 'POST /api/person/delete': function (req, res, next) { 77 | var resp = { 78 | "code": 200, 79 | "errorMsg": "请求成功", 80 | "data":1 81 | }; 82 | setTimeout(function () { 83 | res.json(resp); 84 | }, 500); 85 | }, 86 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/person/PersonService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.person; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 联系人--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class PersonService { 18 | 19 | 20 | @Autowired 21 | private PersonDao dao; //注入联系人数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[联系人]记录 25 | */ 26 | @Transactional 27 | public int save(Person person) { 28 | return dao.save(person); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除联系人记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新联系人记录 42 | */ 43 | @Transactional 44 | public int update(Person person) { 45 | return dao.update(person); 46 | } 47 | 48 | /** 49 | * @方法说明:更新联系人记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Person person) { 53 | return dao.updateNotNull(person); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页联系人列表 58 | */ 59 | public Page queryPage(PersonCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页联系人列表(使用范型) 67 | */ 68 | public List queryList(PersonCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 联系人 对象 74 | */ 75 | public Person findOne(PersonCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个联系人记录 81 | */ 82 | public Person findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询联系人记录个数 88 | */ 89 | public long queryCount(PersonCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 联系人 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/product/ProductDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.product; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 产品--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface ProductDao { 10 | 11 | /** 12 | * @方法说明:物理删除产品记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新产品记录 18 | */ 19 | int update(Product vo) ; 20 | 21 | /** 22 | * @方法说明:更新产品记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Product vo); 25 | 26 | /** 27 | * @方法说明:新增产品记录 28 | */ 29 | int save(Product vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页产品列表 33 | */ 34 | List queryList(ProductCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 产品 对象 38 | */ 39 | Product findOne(ProductCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个产品实体 43 | */ 44 | Product findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询产品记录个数 49 | */ 50 | long queryCount(ProductCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询产品记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 产品 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/product/ProductService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.product; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 产品--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class ProductService { 18 | 19 | 20 | @Autowired 21 | private ProductDao dao; //注入产品数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[产品]记录 25 | */ 26 | @Transactional 27 | public int save(Product product) { 28 | return dao.save(product); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除产品记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新产品记录 42 | */ 43 | @Transactional 44 | public int update(Product product) { 45 | return dao.update(product); 46 | } 47 | 48 | /** 49 | * @方法说明:更新产品记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Product product) { 53 | return dao.updateNotNull(product); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页产品列表 58 | */ 59 | public Page queryPage(ProductCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页产品列表(使用范型) 67 | */ 68 | public List queryList(ProductCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 产品 对象 74 | */ 75 | public Product findOne(ProductCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个产品记录 81 | */ 82 | public Product findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询产品记录个数 88 | */ 89 | public long queryCount(ProductCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 产品 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/quote/Quote.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.quote ; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | /** 6 | * @类说明: 报价--实体类 7 | * @author: alvin198761@163.com 8 | * @date : 2019-11-17 21:00:17 9 | **/ 10 | @ApiModel(value = "Quote", description = "报价实体") 11 | public class Quote { 12 | 13 | //数据库中的字段 14 | @ApiModelProperty(value = "主键", dataType = "Long") 15 | private Long id ;// 主键 16 | @ApiModelProperty(value = "客户id", dataType = "Long") 17 | private Long cusId ;// 客户id 18 | @ApiModelProperty(value = "报价日期", dataType = "Date") 19 | private Date date ;// 报价日期 20 | @ApiModelProperty(value = "备注", dataType = "String") 21 | private String remark ;// 备注 22 | @ApiModelProperty(value = "单据状态", dataType = "String") 23 | private String status ;// 单据状态 24 | 25 | //此处可添加查询显示辅助字段 26 | 27 | //getters and setters 28 | /** 29 | * @return 主键 30 | */ 31 | public Long getId(){ 32 | return this.id ; 33 | } 34 | 35 | /** 36 | * @param 主键 37 | */ 38 | public void setId(Long id){ 39 | this.id = id; 40 | } 41 | 42 | /** 43 | * @return 客户id 44 | */ 45 | public Long getCusId(){ 46 | return this.cusId ; 47 | } 48 | 49 | /** 50 | * @param 客户id 51 | */ 52 | public void setCusId(Long cusId){ 53 | this.cusId = cusId; 54 | } 55 | 56 | /** 57 | * @return 报价日期 58 | */ 59 | public Date getDate(){ 60 | return this.date ; 61 | } 62 | 63 | /** 64 | * @param 报价日期 65 | */ 66 | public void setDate(Date date){ 67 | this.date = date; 68 | } 69 | 70 | /** 71 | * @return 备注 72 | */ 73 | public String getRemark(){ 74 | return this.remark ; 75 | } 76 | 77 | /** 78 | * @param 备注 79 | */ 80 | public void setRemark(String remark){ 81 | this.remark = remark; 82 | } 83 | 84 | /** 85 | * @return 单据状态 86 | */ 87 | public String getStatus(){ 88 | return this.status ; 89 | } 90 | 91 | /** 92 | * @param 单据状态 93 | */ 94 | public void setStatus(String status){ 95 | this.status = status; 96 | } 97 | 98 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/quote/QuoteDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.quote; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 报价--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface QuoteDao { 10 | 11 | /** 12 | * @方法说明:物理删除报价记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新报价记录 18 | */ 19 | int update(Quote vo) ; 20 | 21 | /** 22 | * @方法说明:更新报价记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Quote vo); 25 | 26 | /** 27 | * @方法说明:新增报价记录 28 | */ 29 | int save(Quote vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页报价列表 33 | */ 34 | List queryList(QuoteCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 报价 对象 38 | */ 39 | Quote findOne(QuoteCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个报价实体 43 | */ 44 | Quote findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询报价记录个数 49 | */ 50 | long queryCount(QuoteCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询报价记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 报价 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/quote/QuoteListExpand.vue: -------------------------------------------------------------------------------- 1 | 27 | 32 | 42 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/quote/QuoteMock.js: -------------------------------------------------------------------------------- 1 | /*报价模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/quote/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | cusId: "@integer(100,200)",//客户id 12 | date: "@integer(100,200)",//报价日期 13 | remark : "@word(5,10)",// 备注 14 | status : "@word(5,10)",// 单据状态 15 | }], 16 | 'number': '@integer(100,200)', 17 | 'size': 10, 18 | 'totalElements': 500, 19 | }); 20 | 21 | var resp = { 22 | "code": 200, 23 | "errorMsg": "请求成功", 24 | "data":data 25 | }; 26 | 27 | setTimeout(function () { 28 | res.json(resp); 29 | }, 500); 30 | }, 31 | 32 | 'POST /api/quote/update': function (req, res, next) { 33 | var resp = { 34 | "code": 200, 35 | "errorMsg": "请求成功", 36 | "data":1 37 | }; 38 | setTimeout(function () { 39 | res.json(resp); 40 | }, 500); 41 | }, 42 | 43 | 'POST /api/quote/save': function (req, res, next) { 44 | var resp = { 45 | "code": 200, 46 | "errorMsg": "请求成功", 47 | "data":1 48 | }; 49 | setTimeout(function () { 50 | res.json(resp); 51 | }, 500); 52 | }, 53 | 54 | 'POST /api/quote/queryList': function (req, res, next) { 55 | var data = Mock.mock({ 56 | 'content|10': [{ 57 | id: "@integer(100,200)",//主键 58 | cusId: "@integer(100,200)",//客户id 59 | date: "@integer(100,200)",//报价日期 60 | remark : "@word(5,10)",// 备注 61 | status : "@word(5,10)",// 单据状态 62 | }] 63 | }); 64 | var resp = { 65 | "code": 200, 66 | "errorMsg": "请求成功", 67 | "data":data.content 68 | }; 69 | 70 | setTimeout(function () { 71 | res.json(resp); 72 | }, 500); 73 | 74 | }, 75 | 76 | 'POST /api/quote/delete': function (req, res, next) { 77 | var resp = { 78 | "code": 200, 79 | "errorMsg": "请求成功", 80 | "data":1 81 | }; 82 | setTimeout(function () { 83 | res.json(resp); 84 | }, 500); 85 | }, 86 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/quote/QuoteService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.quote; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 报价--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class QuoteService { 18 | 19 | 20 | @Autowired 21 | private QuoteDao dao; //注入报价数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[报价]记录 25 | */ 26 | @Transactional 27 | public int save(Quote quote) { 28 | return dao.save(quote); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除报价记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新报价记录 42 | */ 43 | @Transactional 44 | public int update(Quote quote) { 45 | return dao.update(quote); 46 | } 47 | 48 | /** 49 | * @方法说明:更新报价记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Quote quote) { 53 | return dao.updateNotNull(quote); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页报价列表 58 | */ 59 | public Page queryPage(QuoteCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页报价列表(使用范型) 67 | */ 68 | public List queryList(QuoteCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 报价 对象 74 | */ 75 | public Quote findOne(QuoteCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个报价记录 81 | */ 82 | public Quote findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询报价记录个数 88 | */ 89 | public long queryCount(QuoteCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 报价 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/record/RecordDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.record; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 产品信息记录--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface RecordDao { 10 | 11 | /** 12 | * @方法说明:物理删除产品信息记录记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新产品信息记录记录 18 | */ 19 | int update(Record vo) ; 20 | 21 | /** 22 | * @方法说明:更新产品信息记录记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Record vo); 25 | 26 | /** 27 | * @方法说明:新增产品信息记录记录 28 | */ 29 | int save(Record vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页产品信息记录列表 33 | */ 34 | List queryList(RecordCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 产品信息记录 对象 38 | */ 39 | Record findOne(RecordCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个产品信息记录实体 43 | */ 44 | Record findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询产品信息记录记录个数 49 | */ 50 | long queryCount(RecordCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询产品信息记录记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 产品信息记录 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/record/RecordListExpand.vue: -------------------------------------------------------------------------------- 1 | 35 | 40 | 50 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/record/RecordMock.js: -------------------------------------------------------------------------------- 1 | /*产品信息记录模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/record/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | prodId: "@integer(100,200)",//产品id 12 | total: "@integer(100,200)",//总价 13 | priice: "@integer(100,200)",//单价 14 | num: "@integer(100,200)",//数量 15 | busId: "@integer(100,200)",//业务ID 16 | busType: "@integer(100,200)",//业务类型 17 | }], 18 | 'number': '@integer(100,200)', 19 | 'size': 10, 20 | 'totalElements': 500, 21 | }); 22 | 23 | var resp = { 24 | "code": 200, 25 | "errorMsg": "请求成功", 26 | "data":data 27 | }; 28 | 29 | setTimeout(function () { 30 | res.json(resp); 31 | }, 500); 32 | }, 33 | 34 | 'POST /api/record/update': function (req, res, next) { 35 | var resp = { 36 | "code": 200, 37 | "errorMsg": "请求成功", 38 | "data":1 39 | }; 40 | setTimeout(function () { 41 | res.json(resp); 42 | }, 500); 43 | }, 44 | 45 | 'POST /api/record/save': function (req, res, next) { 46 | var resp = { 47 | "code": 200, 48 | "errorMsg": "请求成功", 49 | "data":1 50 | }; 51 | setTimeout(function () { 52 | res.json(resp); 53 | }, 500); 54 | }, 55 | 56 | 'POST /api/record/queryList': function (req, res, next) { 57 | var data = Mock.mock({ 58 | 'content|10': [{ 59 | id: "@integer(100,200)",//主键 60 | prodId: "@integer(100,200)",//产品id 61 | total: "@integer(100,200)",//总价 62 | priice: "@integer(100,200)",//单价 63 | num: "@integer(100,200)",//数量 64 | busId: "@integer(100,200)",//业务ID 65 | busType: "@integer(100,200)",//业务类型 66 | }] 67 | }); 68 | var resp = { 69 | "code": 200, 70 | "errorMsg": "请求成功", 71 | "data":data.content 72 | }; 73 | 74 | setTimeout(function () { 75 | res.json(resp); 76 | }, 500); 77 | 78 | }, 79 | 80 | 'POST /api/record/delete': function (req, res, next) { 81 | var resp = { 82 | "code": 200, 83 | "errorMsg": "请求成功", 84 | "data":1 85 | }; 86 | setTimeout(function () { 87 | res.json(resp); 88 | }, 500); 89 | }, 90 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/record/RecordService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.record; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 产品信息记录--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class RecordService { 18 | 19 | 20 | @Autowired 21 | private RecordDao dao; //注入产品信息记录数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[产品信息记录]记录 25 | */ 26 | @Transactional 27 | public int save(Record record) { 28 | return dao.save(record); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除产品信息记录记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新产品信息记录记录 42 | */ 43 | @Transactional 44 | public int update(Record record) { 45 | return dao.update(record); 46 | } 47 | 48 | /** 49 | * @方法说明:更新产品信息记录记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Record record) { 53 | return dao.updateNotNull(record); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页产品信息记录列表 58 | */ 59 | public Page queryPage(RecordCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页产品信息记录列表(使用范型) 67 | */ 68 | public List queryList(RecordCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 产品信息记录 对象 74 | */ 75 | public Record findOne(RecordCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个产品信息记录记录 81 | */ 82 | public Record findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询产品信息记录记录个数 88 | */ 89 | public long queryCount(RecordCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 产品信息记录 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/role/Role.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.role ; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | /** 6 | * @类说明: admin_role--实体类 7 | * @author: alvin198761@163.com 8 | * @date : 2019-11-17 21:00:17 9 | **/ 10 | @ApiModel(value = "Role", description = "admin_role实体") 11 | public class Role { 12 | 13 | //数据库中的字段 14 | @ApiModelProperty(value = "主键", dataType = "Integer") 15 | private Integer id ;// 主键 16 | @ApiModelProperty(value = "主键", dataType = "Integer") 17 | private Integer id ;// 主键 18 | @ApiModelProperty(value = "名称", dataType = "String") 19 | private String name ;// 名称 20 | @ApiModelProperty(value = "名称", dataType = "String") 21 | private String name ;// 名称 22 | @ApiModelProperty(value = "备注", dataType = "String") 23 | private String remark ;// 备注 24 | @ApiModelProperty(value = "备注", dataType = "String") 25 | private String remark ;// 备注 26 | 27 | //此处可添加查询显示辅助字段 28 | 29 | //getters and setters 30 | /** 31 | * @return 主键 32 | */ 33 | public Integer getId(){ 34 | return this.id ; 35 | } 36 | 37 | /** 38 | * @param 主键 39 | */ 40 | public void setId(Integer id){ 41 | this.id = id; 42 | } 43 | 44 | /** 45 | * @return 主键 46 | */ 47 | public Integer getId(){ 48 | return this.id ; 49 | } 50 | 51 | /** 52 | * @param 主键 53 | */ 54 | public void setId(Integer id){ 55 | this.id = id; 56 | } 57 | 58 | /** 59 | * @return 名称 60 | */ 61 | public String getName(){ 62 | return this.name ; 63 | } 64 | 65 | /** 66 | * @param 名称 67 | */ 68 | public void setName(String name){ 69 | this.name = name; 70 | } 71 | 72 | /** 73 | * @return 名称 74 | */ 75 | public String getName(){ 76 | return this.name ; 77 | } 78 | 79 | /** 80 | * @param 名称 81 | */ 82 | public void setName(String name){ 83 | this.name = name; 84 | } 85 | 86 | /** 87 | * @return 备注 88 | */ 89 | public String getRemark(){ 90 | return this.remark ; 91 | } 92 | 93 | /** 94 | * @param 备注 95 | */ 96 | public void setRemark(String remark){ 97 | this.remark = remark; 98 | } 99 | 100 | /** 101 | * @return 备注 102 | */ 103 | public String getRemark(){ 104 | return this.remark ; 105 | } 106 | 107 | /** 108 | * @param 备注 109 | */ 110 | public void setRemark(String remark){ 111 | this.remark = remark; 112 | } 113 | 114 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/role/RoleDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.role; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: admin_role--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface RoleDao { 10 | 11 | /** 12 | * @方法说明:物理删除admin_role记录(多条) 13 | */ 14 | int delete(Integer ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新admin_role记录 18 | */ 19 | int update(Role vo) ; 20 | 21 | /** 22 | * @方法说明:更新admin_role记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Role vo); 25 | 26 | /** 27 | * @方法说明:新增admin_role记录 28 | */ 29 | int save(Role vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页admin_role列表 33 | */ 34 | List queryList(RoleCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 admin_role 对象 38 | */ 39 | Role findOne(RoleCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个admin_role实体 43 | */ 44 | Role findById(Integer id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询admin_role记录个数 49 | */ 50 | long queryCount(RoleCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询admin_role记录个数 54 | */ 55 | int deleteLogic(Integer ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 admin_role 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/role/RoleListExpand.vue: -------------------------------------------------------------------------------- 1 | 31 | 36 | 46 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/role/RoleMock.js: -------------------------------------------------------------------------------- 1 | /*admin_role模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/role/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | id: "@integer(100,200)",//主键 12 | name : "@word(5,10)",// 名称 13 | name : "@word(5,10)",// 名称 14 | remark : "@word(5,10)",// 备注 15 | remark : "@word(5,10)",// 备注 16 | }], 17 | 'number': '@integer(100,200)', 18 | 'size': 10, 19 | 'totalElements': 500, 20 | }); 21 | 22 | var resp = { 23 | "code": 200, 24 | "errorMsg": "请求成功", 25 | "data":data 26 | }; 27 | 28 | setTimeout(function () { 29 | res.json(resp); 30 | }, 500); 31 | }, 32 | 33 | 'POST /api/role/update': function (req, res, next) { 34 | var resp = { 35 | "code": 200, 36 | "errorMsg": "请求成功", 37 | "data":1 38 | }; 39 | setTimeout(function () { 40 | res.json(resp); 41 | }, 500); 42 | }, 43 | 44 | 'POST /api/role/save': function (req, res, next) { 45 | var resp = { 46 | "code": 200, 47 | "errorMsg": "请求成功", 48 | "data":1 49 | }; 50 | setTimeout(function () { 51 | res.json(resp); 52 | }, 500); 53 | }, 54 | 55 | 'POST /api/role/queryList': function (req, res, next) { 56 | var data = Mock.mock({ 57 | 'content|10': [{ 58 | id: "@integer(100,200)",//主键 59 | id: "@integer(100,200)",//主键 60 | name : "@word(5,10)",// 名称 61 | name : "@word(5,10)",// 名称 62 | remark : "@word(5,10)",// 备注 63 | remark : "@word(5,10)",// 备注 64 | }] 65 | }); 66 | var resp = { 67 | "code": 200, 68 | "errorMsg": "请求成功", 69 | "data":data.content 70 | }; 71 | 72 | setTimeout(function () { 73 | res.json(resp); 74 | }, 500); 75 | 76 | }, 77 | 78 | 'POST /api/role/delete': function (req, res, next) { 79 | var resp = { 80 | "code": 200, 81 | "errorMsg": "请求成功", 82 | "data":1 83 | }; 84 | setTimeout(function () { 85 | res.json(resp); 86 | }, 500); 87 | }, 88 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/role/RoleService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.role; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: admin_role--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class RoleService { 18 | 19 | 20 | @Autowired 21 | private RoleDao dao; //注入admin_role数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[admin_role]记录 25 | */ 26 | @Transactional 27 | public int save(Role role) { 28 | return dao.save(role); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除admin_role记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Integer ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新admin_role记录 42 | */ 43 | @Transactional 44 | public int update(Role role) { 45 | return dao.update(role); 46 | } 47 | 48 | /** 49 | * @方法说明:更新admin_role记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Role role) { 53 | return dao.updateNotNull(role); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页admin_role列表 58 | */ 59 | public Page queryPage(RoleCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页admin_role列表(使用范型) 67 | */ 68 | public List queryList(RoleCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 admin_role 对象 74 | */ 75 | public Role findOne(RoleCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个admin_role记录 81 | */ 82 | public Role findById(Integer id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询admin_role记录个数 88 | */ 89 | public long queryCount(RoleCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 admin_role 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/roledept/RoleDept.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.roledept ; 2 | 3 | import io.swagger.annotations.ApiModel; 4 | import io.swagger.annotations.ApiModelProperty; 5 | /** 6 | * @类说明: admin_role_dept--实体类 7 | * @author: alvin198761@163.com 8 | * @date : 2019-11-17 21:00:17 9 | **/ 10 | @ApiModel(value = "RoleDept", description = "admin_role_dept实体") 11 | public class RoleDept { 12 | 13 | //数据库中的字段 14 | @ApiModelProperty(value = "主键", dataType = "Long") 15 | private Long id ;// 主键 16 | @ApiModelProperty(value = "主键", dataType = "Long") 17 | private Long id ;// 主键 18 | @ApiModelProperty(value = "角色主键", dataType = "Integer") 19 | private Integer roleId ;// 角色主键 20 | @ApiModelProperty(value = "角色主键", dataType = "Integer") 21 | private Integer roleId ;// 角色主键 22 | @ApiModelProperty(value = "菜单主键", dataType = "Integer") 23 | private Integer deptId ;// 菜单主键 24 | @ApiModelProperty(value = "菜单主键", dataType = "Integer") 25 | private Integer deptId ;// 菜单主键 26 | 27 | //此处可添加查询显示辅助字段 28 | 29 | //getters and setters 30 | /** 31 | * @return 主键 32 | */ 33 | public Long getId(){ 34 | return this.id ; 35 | } 36 | 37 | /** 38 | * @param 主键 39 | */ 40 | public void setId(Long id){ 41 | this.id = id; 42 | } 43 | 44 | /** 45 | * @return 主键 46 | */ 47 | public Long getId(){ 48 | return this.id ; 49 | } 50 | 51 | /** 52 | * @param 主键 53 | */ 54 | public void setId(Long id){ 55 | this.id = id; 56 | } 57 | 58 | /** 59 | * @return 角色主键 60 | */ 61 | public Integer getRoleId(){ 62 | return this.roleId ; 63 | } 64 | 65 | /** 66 | * @param 角色主键 67 | */ 68 | public void setRoleId(Integer roleId){ 69 | this.roleId = roleId; 70 | } 71 | 72 | /** 73 | * @return 角色主键 74 | */ 75 | public Integer getRoleId(){ 76 | return this.roleId ; 77 | } 78 | 79 | /** 80 | * @param 角色主键 81 | */ 82 | public void setRoleId(Integer roleId){ 83 | this.roleId = roleId; 84 | } 85 | 86 | /** 87 | * @return 菜单主键 88 | */ 89 | public Integer getDeptId(){ 90 | return this.deptId ; 91 | } 92 | 93 | /** 94 | * @param 菜单主键 95 | */ 96 | public void setDeptId(Integer deptId){ 97 | this.deptId = deptId; 98 | } 99 | 100 | /** 101 | * @return 菜单主键 102 | */ 103 | public Integer getDeptId(){ 104 | return this.deptId ; 105 | } 106 | 107 | /** 108 | * @param 菜单主键 109 | */ 110 | public void setDeptId(Integer deptId){ 111 | this.deptId = deptId; 112 | } 113 | 114 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/roledept/RoleDeptDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.roledept; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: admin_role_dept--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface RoleDeptDao { 10 | 11 | /** 12 | * @方法说明:物理删除admin_role_dept记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新admin_role_dept记录 18 | */ 19 | int update(RoleDept vo) ; 20 | 21 | /** 22 | * @方法说明:更新admin_role_dept记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(RoleDept vo); 25 | 26 | /** 27 | * @方法说明:新增admin_role_dept记录 28 | */ 29 | int save(RoleDept vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页admin_role_dept列表 33 | */ 34 | List queryList(RoleDeptCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 admin_role_dept 对象 38 | */ 39 | RoleDept findOne(RoleDeptCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个admin_role_dept实体 43 | */ 44 | RoleDept findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询admin_role_dept记录个数 49 | */ 50 | long queryCount(RoleDeptCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询admin_role_dept记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 admin_role_dept 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/roledept/RoleDeptListExpand.vue: -------------------------------------------------------------------------------- 1 | 31 | 36 | 46 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/roledept/RoleDeptMock.js: -------------------------------------------------------------------------------- 1 | /*admin_role_dept模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/roleDept/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | id: "@integer(100,200)",//主键 12 | roleId: "@integer(100,200)",//角色主键 13 | roleId: "@integer(100,200)",//角色主键 14 | deptId: "@integer(100,200)",//菜单主键 15 | deptId: "@integer(100,200)",//菜单主键 16 | }], 17 | 'number': '@integer(100,200)', 18 | 'size': 10, 19 | 'totalElements': 500, 20 | }); 21 | 22 | var resp = { 23 | "code": 200, 24 | "errorMsg": "请求成功", 25 | "data":data 26 | }; 27 | 28 | setTimeout(function () { 29 | res.json(resp); 30 | }, 500); 31 | }, 32 | 33 | 'POST /api/roleDept/update': function (req, res, next) { 34 | var resp = { 35 | "code": 200, 36 | "errorMsg": "请求成功", 37 | "data":1 38 | }; 39 | setTimeout(function () { 40 | res.json(resp); 41 | }, 500); 42 | }, 43 | 44 | 'POST /api/roleDept/save': function (req, res, next) { 45 | var resp = { 46 | "code": 200, 47 | "errorMsg": "请求成功", 48 | "data":1 49 | }; 50 | setTimeout(function () { 51 | res.json(resp); 52 | }, 500); 53 | }, 54 | 55 | 'POST /api/roleDept/queryList': function (req, res, next) { 56 | var data = Mock.mock({ 57 | 'content|10': [{ 58 | id: "@integer(100,200)",//主键 59 | id: "@integer(100,200)",//主键 60 | roleId: "@integer(100,200)",//角色主键 61 | roleId: "@integer(100,200)",//角色主键 62 | deptId: "@integer(100,200)",//菜单主键 63 | deptId: "@integer(100,200)",//菜单主键 64 | }] 65 | }); 66 | var resp = { 67 | "code": 200, 68 | "errorMsg": "请求成功", 69 | "data":data.content 70 | }; 71 | 72 | setTimeout(function () { 73 | res.json(resp); 74 | }, 500); 75 | 76 | }, 77 | 78 | 'POST /api/roleDept/delete': function (req, res, next) { 79 | var resp = { 80 | "code": 200, 81 | "errorMsg": "请求成功", 82 | "data":1 83 | }; 84 | setTimeout(function () { 85 | res.json(resp); 86 | }, 500); 87 | }, 88 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/roledept/RoleDeptService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.roledept; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: admin_role_dept--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class RoleDeptService { 18 | 19 | 20 | @Autowired 21 | private RoleDeptDao dao; //注入admin_role_dept数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[admin_role_dept]记录 25 | */ 26 | @Transactional 27 | public int save(RoleDept roleDept) { 28 | return dao.save(roleDept); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除admin_role_dept记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新admin_role_dept记录 42 | */ 43 | @Transactional 44 | public int update(RoleDept roleDept) { 45 | return dao.update(roleDept); 46 | } 47 | 48 | /** 49 | * @方法说明:更新admin_role_dept记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(RoleDept roleDept) { 53 | return dao.updateNotNull(roleDept); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页admin_role_dept列表 58 | */ 59 | public Page queryPage(RoleDeptCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页admin_role_dept列表(使用范型) 67 | */ 68 | public List queryList(RoleDeptCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 admin_role_dept 对象 74 | */ 75 | public RoleDept findOne(RoleDeptCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个admin_role_dept记录 81 | */ 82 | public RoleDept findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询admin_role_dept记录个数 88 | */ 89 | public long queryCount(RoleDeptCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 admin_role_dept 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/rolefunc/RoleFuncDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.rolefunc; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: admin_role_func--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface RoleFuncDao { 10 | 11 | /** 12 | * @方法说明:物理删除admin_role_func记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新admin_role_func记录 18 | */ 19 | int update(RoleFunc vo) ; 20 | 21 | /** 22 | * @方法说明:更新admin_role_func记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(RoleFunc vo); 25 | 26 | /** 27 | * @方法说明:新增admin_role_func记录 28 | */ 29 | int save(RoleFunc vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页admin_role_func列表 33 | */ 34 | List queryList(RoleFuncCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 admin_role_func 对象 38 | */ 39 | RoleFunc findOne(RoleFuncCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个admin_role_func实体 43 | */ 44 | RoleFunc findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询admin_role_func记录个数 49 | */ 50 | long queryCount(RoleFuncCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询admin_role_func记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 admin_role_func 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/rolefunc/RoleFuncListExpand.vue: -------------------------------------------------------------------------------- 1 | 31 | 36 | 46 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/rolefunc/RoleFuncMock.js: -------------------------------------------------------------------------------- 1 | /*admin_role_func模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/roleFunc/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | id: "@integer(100,200)",//主键 12 | roleId: "@integer(100,200)",//角色主键 13 | roleId: "@integer(100,200)",//角色主键 14 | userId: "@integer(100,200)",//菜单主键 15 | userId: "@integer(100,200)",//菜单主键 16 | }], 17 | 'number': '@integer(100,200)', 18 | 'size': 10, 19 | 'totalElements': 500, 20 | }); 21 | 22 | var resp = { 23 | "code": 200, 24 | "errorMsg": "请求成功", 25 | "data":data 26 | }; 27 | 28 | setTimeout(function () { 29 | res.json(resp); 30 | }, 500); 31 | }, 32 | 33 | 'POST /api/roleFunc/update': function (req, res, next) { 34 | var resp = { 35 | "code": 200, 36 | "errorMsg": "请求成功", 37 | "data":1 38 | }; 39 | setTimeout(function () { 40 | res.json(resp); 41 | }, 500); 42 | }, 43 | 44 | 'POST /api/roleFunc/save': function (req, res, next) { 45 | var resp = { 46 | "code": 200, 47 | "errorMsg": "请求成功", 48 | "data":1 49 | }; 50 | setTimeout(function () { 51 | res.json(resp); 52 | }, 500); 53 | }, 54 | 55 | 'POST /api/roleFunc/queryList': function (req, res, next) { 56 | var data = Mock.mock({ 57 | 'content|10': [{ 58 | id: "@integer(100,200)",//主键 59 | id: "@integer(100,200)",//主键 60 | roleId: "@integer(100,200)",//角色主键 61 | roleId: "@integer(100,200)",//角色主键 62 | userId: "@integer(100,200)",//菜单主键 63 | userId: "@integer(100,200)",//菜单主键 64 | }] 65 | }); 66 | var resp = { 67 | "code": 200, 68 | "errorMsg": "请求成功", 69 | "data":data.content 70 | }; 71 | 72 | setTimeout(function () { 73 | res.json(resp); 74 | }, 500); 75 | 76 | }, 77 | 78 | 'POST /api/roleFunc/delete': function (req, res, next) { 79 | var resp = { 80 | "code": 200, 81 | "errorMsg": "请求成功", 82 | "data":1 83 | }; 84 | setTimeout(function () { 85 | res.json(resp); 86 | }, 500); 87 | }, 88 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/rolefunc/RoleFuncService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.rolefunc; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: admin_role_func--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class RoleFuncService { 18 | 19 | 20 | @Autowired 21 | private RoleFuncDao dao; //注入admin_role_func数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[admin_role_func]记录 25 | */ 26 | @Transactional 27 | public int save(RoleFunc roleFunc) { 28 | return dao.save(roleFunc); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除admin_role_func记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新admin_role_func记录 42 | */ 43 | @Transactional 44 | public int update(RoleFunc roleFunc) { 45 | return dao.update(roleFunc); 46 | } 47 | 48 | /** 49 | * @方法说明:更新admin_role_func记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(RoleFunc roleFunc) { 53 | return dao.updateNotNull(roleFunc); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页admin_role_func列表 58 | */ 59 | public Page queryPage(RoleFuncCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页admin_role_func列表(使用范型) 67 | */ 68 | public List queryList(RoleFuncCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 admin_role_func 对象 74 | */ 75 | public RoleFunc findOne(RoleFuncCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个admin_role_func记录 81 | */ 82 | public RoleFunc findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询admin_role_func记录个数 88 | */ 89 | public long queryCount(RoleFuncCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 admin_role_func 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/sysuser/SysUserDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.sysuser; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: admin_sys_user--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface SysUserDao { 10 | 11 | /** 12 | * @方法说明:物理删除admin_sys_user记录(多条) 13 | */ 14 | int delete(Integer ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新admin_sys_user记录 18 | */ 19 | int update(SysUser vo) ; 20 | 21 | /** 22 | * @方法说明:更新admin_sys_user记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(SysUser vo); 25 | 26 | /** 27 | * @方法说明:新增admin_sys_user记录 28 | */ 29 | int save(SysUser vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页admin_sys_user列表 33 | */ 34 | List queryList(SysUserCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 admin_sys_user 对象 38 | */ 39 | SysUser findOne(SysUserCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个admin_sys_user实体 43 | */ 44 | SysUser findById(Integer id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询admin_sys_user记录个数 49 | */ 50 | long queryCount(SysUserCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询admin_sys_user记录个数 54 | */ 55 | int deleteLogic(Integer ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 admin_sys_user 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/sysuser/SysUserService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.sysuser; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: admin_sys_user--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class SysUserService { 18 | 19 | 20 | @Autowired 21 | private SysUserDao dao; //注入admin_sys_user数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[admin_sys_user]记录 25 | */ 26 | @Transactional 27 | public int save(SysUser sysUser) { 28 | return dao.save(sysUser); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除admin_sys_user记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Integer ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新admin_sys_user记录 42 | */ 43 | @Transactional 44 | public int update(SysUser sysUser) { 45 | return dao.update(sysUser); 46 | } 47 | 48 | /** 49 | * @方法说明:更新admin_sys_user记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(SysUser sysUser) { 53 | return dao.updateNotNull(sysUser); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页admin_sys_user列表 58 | */ 59 | public Page queryPage(SysUserCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页admin_sys_user列表(使用范型) 67 | */ 68 | public List queryList(SysUserCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 admin_sys_user 对象 74 | */ 75 | public SysUser findOne(SysUserCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个admin_sys_user记录 81 | */ 82 | public SysUser findById(Integer id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询admin_sys_user记录个数 88 | */ 89 | public long queryCount(SysUserCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 admin_sys_user 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/ticket/TicketDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.ticket; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 进销项发票录入--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface TicketDao { 10 | 11 | /** 12 | * @方法说明:物理删除进销项发票录入记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新进销项发票录入记录 18 | */ 19 | int update(Ticket vo) ; 20 | 21 | /** 22 | * @方法说明:更新进销项发票录入记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Ticket vo); 25 | 26 | /** 27 | * @方法说明:新增进销项发票录入记录 28 | */ 29 | int save(Ticket vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页进销项发票录入列表 33 | */ 34 | List queryList(TicketCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 进销项发票录入 对象 38 | */ 39 | Ticket findOne(TicketCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个进销项发票录入实体 43 | */ 44 | Ticket findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询进销项发票录入记录个数 49 | */ 50 | long queryCount(TicketCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询进销项发票录入记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 进销项发票录入 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/ticket/TicketListExpand.vue: -------------------------------------------------------------------------------- 1 | 47 | 52 | 62 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/ticket/TicketService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.ticket; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 进销项发票录入--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class TicketService { 18 | 19 | 20 | @Autowired 21 | private TicketDao dao; //注入进销项发票录入数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[进销项发票录入]记录 25 | */ 26 | @Transactional 27 | public int save(Ticket ticket) { 28 | return dao.save(ticket); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除进销项发票录入记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新进销项发票录入记录 42 | */ 43 | @Transactional 44 | public int update(Ticket ticket) { 45 | return dao.update(ticket); 46 | } 47 | 48 | /** 49 | * @方法说明:更新进销项发票录入记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Ticket ticket) { 53 | return dao.updateNotNull(ticket); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页进销项发票录入列表 58 | */ 59 | public Page queryPage(TicketCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页进销项发票录入列表(使用范型) 67 | */ 68 | public List queryList(TicketCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 进销项发票录入 对象 74 | */ 75 | public Ticket findOne(TicketCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个进销项发票录入记录 81 | */ 82 | public Ticket findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询进销项发票录入记录个数 88 | */ 89 | public long queryCount(TicketCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 进销项发票录入 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/vendor/VendorDao.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.vendor; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: 供应商--数据访问层 6 | * @author: alvin198761@163.com 7 | * @date : 2019-11-17 21:00:17 8 | **/ 9 | public interface VendorDao { 10 | 11 | /** 12 | * @方法说明:物理删除供应商记录(多条) 13 | */ 14 | int delete(Long ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新供应商记录 18 | */ 19 | int update(Vendor vo) ; 20 | 21 | /** 22 | * @方法说明:更新供应商记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(Vendor vo); 25 | 26 | /** 27 | * @方法说明:新增供应商记录 28 | */ 29 | int save(Vendor vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页供应商列表 33 | */ 34 | List queryList(VendorCond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 供应商 对象 38 | */ 39 | Vendor findOne(VendorCond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个供应商实体 43 | */ 44 | Vendor findById(Long id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询供应商记录个数 49 | */ 50 | long queryCount(VendorCond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询供应商记录个数 54 | */ 55 | int deleteLogic(Long ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 供应商 59 | */ 60 | int insertBatch(List list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/vendor/VendorListExpand.vue: -------------------------------------------------------------------------------- 1 | 31 | 36 | 46 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/vendor/VendorMock.js: -------------------------------------------------------------------------------- 1 | /*供应商模拟数据},作者:alvin198761@163.com,日期:2019-11-17 21:00:17*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/vendor/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | id: "@integer(100,200)",//主键 11 | vendorNo : "@word(5,10)",// 供应商编号 12 | vendorName : "@word(5,10)",// 供应商名称 13 | address : "@word(5,10)",// 供应商地址 14 | level: "@integer(100,200)",//供应商级别 15 | remark : "@word(5,10)",// 备注 16 | }], 17 | 'number': '@integer(100,200)', 18 | 'size': 10, 19 | 'totalElements': 500, 20 | }); 21 | 22 | var resp = { 23 | "code": 200, 24 | "errorMsg": "请求成功", 25 | "data":data 26 | }; 27 | 28 | setTimeout(function () { 29 | res.json(resp); 30 | }, 500); 31 | }, 32 | 33 | 'POST /api/vendor/update': function (req, res, next) { 34 | var resp = { 35 | "code": 200, 36 | "errorMsg": "请求成功", 37 | "data":1 38 | }; 39 | setTimeout(function () { 40 | res.json(resp); 41 | }, 500); 42 | }, 43 | 44 | 'POST /api/vendor/save': function (req, res, next) { 45 | var resp = { 46 | "code": 200, 47 | "errorMsg": "请求成功", 48 | "data":1 49 | }; 50 | setTimeout(function () { 51 | res.json(resp); 52 | }, 500); 53 | }, 54 | 55 | 'POST /api/vendor/queryList': function (req, res, next) { 56 | var data = Mock.mock({ 57 | 'content|10': [{ 58 | id: "@integer(100,200)",//主键 59 | vendorNo : "@word(5,10)",// 供应商编号 60 | vendorName : "@word(5,10)",// 供应商名称 61 | address : "@word(5,10)",// 供应商地址 62 | level: "@integer(100,200)",//供应商级别 63 | remark : "@word(5,10)",// 备注 64 | }] 65 | }); 66 | var resp = { 67 | "code": 200, 68 | "errorMsg": "请求成功", 69 | "data":data.content 70 | }; 71 | 72 | setTimeout(function () { 73 | res.json(resp); 74 | }, 500); 75 | 76 | }, 77 | 78 | 'POST /api/vendor/delete': function (req, res, next) { 79 | var resp = { 80 | "code": 200, 81 | "errorMsg": "请求成功", 82 | "data":1 83 | }; 84 | setTimeout(function () { 85 | res.json(resp); 86 | }, 500); 87 | }, 88 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/dist/vendor/VendorService.java: -------------------------------------------------------------------------------- 1 | package org.alvin.test.vendor; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: 供应商--数据逻辑层 12 | * @author: alvin198761@163.com 13 | * @date : 2019-11-17 21:00:17 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class VendorService { 18 | 19 | 20 | @Autowired 21 | private VendorDao dao; //注入供应商数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[供应商]记录 25 | */ 26 | @Transactional 27 | public int save(Vendor vendor) { 28 | return dao.save(vendor); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除供应商记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(Long ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新供应商记录 42 | */ 43 | @Transactional 44 | public int update(Vendor vendor) { 45 | return dao.update(vendor); 46 | } 47 | 48 | /** 49 | * @方法说明:更新供应商记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(Vendor vendor) { 53 | return dao.updateNotNull(vendor); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页供应商列表 58 | */ 59 | public Page queryPage(VendorCond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页供应商列表(使用范型) 67 | */ 68 | public List queryList(VendorCond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 供应商 对象 74 | */ 75 | public Vendor findOne(VendorCond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个供应商记录 81 | */ 82 | public Vendor findById(Long id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询供应商记录个数 88 | */ 89 | public long queryCount(VendorCond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 供应商 95 | */ 96 | @Transactional 97 | public int insertBatch(List list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/templates/mjwxmp_mybatis_java/ModelCond_java.vm: -------------------------------------------------------------------------------- 1 | package $pName ; 2 | 3 | #foreach($importItem in $importList) 4 | $importItem 5 | #end 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | import java.util.List; 9 | 10 | 11 | /** 12 | * @类说明: ${cName}--查询条件实体类 13 | * @author: ${auth} 14 | * @date : ${time} 15 | **/ 16 | @ApiModel(value = "${clsUpp}Cond", description = "${cName}查询条件实体") 17 | public class ${clsUpp}Cond { 18 | 19 | //feilds 20 | #foreach ($fie in $fList) 21 | @ApiModelProperty(value = "${fie.comment}", dataType = "${fie.type}") 22 | private ${fie.type} ${fie.lower_camel} ;// ${fie.comment} 23 | #end 24 | // 通用变量 25 | private List<${idType}> ids;// 主键列表 26 | private Integer pageSize = 10; //每页条数 27 | private Integer total; //总条数 28 | private Integer pageNum; //当前页码 29 | 30 | 31 | //getters and setters 32 | #foreach ($fi in $fList) 33 | /** 34 | * @return ${fi.comment} 35 | */ 36 | public ${fi.type} get${fi.upper_camel}(){ 37 | return this.${fi.lower_camel} ; 38 | } 39 | 40 | /** 41 | * @param ${fi.comment} 42 | */ 43 | public void set${fi.upper_camel}(${fi.type} ${fi.lower_camel}){ 44 | this.${fi.lower_camel} = ${fi.lower_camel}; 45 | } 46 | 47 | #end 48 | /** 49 | * @return 主键列表 50 | */ 51 | public List<${idType}> getIds(){ 52 | return this.ids; 53 | } 54 | 55 | /** 56 | *@param 主键列表 57 | */ 58 | public void setIds(${idType} ids){ 59 | this.ids = ids; 60 | } 61 | 62 | /** 63 | * @return 每页条数 64 | */ 65 | public Integer getPageSize(){ 66 | return this.pageSize; 67 | } 68 | 69 | /** 70 | *@param 每页条数 71 | */ 72 | public void setPageSize(Integer pageSize){ 73 | this.pageSize = pageSize; 74 | } 75 | 76 | /** 77 | * @return 总条数 78 | */ 79 | public Integer getTotal(){ 80 | return this.total; 81 | } 82 | 83 | /** 84 | *@param 总条数 85 | */ 86 | public void setTotal(Integer total){ 87 | this.total = total; 88 | } 89 | 90 | /** 91 | * @return 当前页码 92 | */ 93 | public Integer getPageNum(){ 94 | return this.pageNum; 95 | } 96 | 97 | /** 98 | *@param 当前页码 99 | */ 100 | public void setPageNum(Integer pageNum){ 101 | this.pageNum = pageNum; 102 | } 103 | 104 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/templates/mjwxmp_mybatis_java/ModelDao_java.vm: -------------------------------------------------------------------------------- 1 | package ${pName}; 2 | import java.util.List; 3 | 4 | /** 5 | * @类说明: ${cName}--数据访问层 6 | * @author: ${auth} 7 | * @date : ${time} 8 | **/ 9 | public interface ${clsUpp}Dao { 10 | 11 | /** 12 | * @方法说明:物理删除${cName}记录(多条) 13 | */ 14 | int delete(${idType} ids[]) ; 15 | 16 | /** 17 | * @方法说明:更新${cName}记录 18 | */ 19 | int update(${clsUpp} vo) ; 20 | 21 | /** 22 | * @方法说明:更新${cName}记录,不为空的都更新掉 23 | */ 24 | int updateNotNull(${clsUpp} vo); 25 | 26 | /** 27 | * @方法说明:新增${cName}记录 28 | */ 29 | int save(${clsUpp} vo); 30 | 31 | /** 32 | * @方法说明:按条件查询不分页${cName}列表 33 | */ 34 | List<${clsUpp}> queryList(${clsUpp}Cond cond) ; 35 | 36 | /** 37 | * @方法说明:按条件查询一个 ${cName} 对象 38 | */ 39 | ${clsUpp} findOne(${clsUpp}Cond cond) ; 40 | 41 | /** 42 | * @方法说明:按ID查找单个${cName}实体 43 | */ 44 | ${clsUpp} findById(${idType} id); 45 | 46 | 47 | /** 48 | * @方法说明:按条件查询${cName}记录个数 49 | */ 50 | long queryCount(${clsUpp}Cond cond); 51 | 52 | /** 53 | * @方法说明:按条件查询${cName}记录个数 54 | */ 55 | int deleteLogic(${idType} ids[]); 56 | 57 | /** 58 | * @方法说明: 批量添加 ${cName} 59 | */ 60 | int insertBatch(List<${clsUpp}> list); 61 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/templates/mjwxmp_mybatis_java/ModelService_java.vm: -------------------------------------------------------------------------------- 1 | package ${pName}; 2 | import java.util.List; 3 | import org.alvin.code.gen.utils.Page; 4 | import com.github.pagehelper.PageHelper; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * @类说明: ${cName}--数据逻辑层 12 | * @author: ${auth} 13 | * @date : ${time} 14 | **/ 15 | @Slf4j 16 | @Service 17 | public class ${clsUpp}Service { 18 | 19 | 20 | @Autowired 21 | private ${clsUpp}Dao dao; //注入${cName}数据访问层 22 | 23 | /** 24 | * @方法说明: 新增[${cName}]记录 25 | */ 26 | @Transactional 27 | public int save(${clsUpp} ${lowUpp}) { 28 | return dao.save(${lowUpp}); 29 | } 30 | 31 | /** 32 | * @方法说明: 删除${cName}记录(多条) 33 | */ 34 | @Transactional 35 | public int delete(${idType} ids[]) { 36 | //return dao.deleteLogic(ids);//逻辑删除 37 | return dao.delete(ids);//物理删除 38 | } 39 | 40 | /** 41 | * @方法说明: 更新${cName}记录 42 | */ 43 | @Transactional 44 | public int update(${clsUpp} ${lowUpp}) { 45 | return dao.update(${lowUpp}); 46 | } 47 | 48 | /** 49 | * @方法说明:更新${cName}记录,不为空的都更新掉 50 | */ 51 | @Transactional 52 | public int updateNotNull(${clsUpp} ${lowUpp}) { 53 | return dao.updateNotNull(${lowUpp}); 54 | } 55 | 56 | /** 57 | * @方法说明: 按条件查询分页${cName}列表 58 | */ 59 | public Page<${clsUpp}> queryPage(${clsUpp}Cond cond) { 60 | com.github.pagehelper.Page page = PageHelper.startPage(cond.getPage(), cond.getSize(), true); 61 | dao.queryList(cond); 62 | return new Page(page.getPageNum() ,page.getPageSize() ,page.getTotal() ,page.getResult()); 63 | } 64 | 65 | /** 66 | * @方法说明: 按条件查询不分页${cName}列表(使用范型) 67 | */ 68 | public List<${clsUpp}> queryList(${clsUpp}Cond cond) { 69 | return dao.queryList(cond); 70 | } 71 | 72 | /** 73 | * @方法说明: 按条件查询一个 ${cName} 对象 74 | */ 75 | public ${clsUpp} findOne(${clsUpp}Cond cond) { 76 | return dao.findOne(cond); 77 | } 78 | 79 | /** 80 | * @方法说明: 按ID查找单个${cName}记录 81 | */ 82 | public ${clsUpp} findById(${idType} id) { 83 | return dao.findById(id); 84 | } 85 | 86 | /** 87 | * @方法说明: 按条件查询${cName}记录个数 88 | */ 89 | public long queryCount(${clsUpp}Cond cond) { 90 | return dao.queryCount(cond); 91 | } 92 | 93 | /** 94 | * @方法说明: 批量添加 ${cName} 95 | */ 96 | @Transactional 97 | public int insertBatch(List<${clsUpp}> list){ 98 | return dao.insertBatch(list); 99 | } 100 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/templates/mjwxmp_mybatis_java/Model_java.vm: -------------------------------------------------------------------------------- 1 | package $pName ; 2 | 3 | #foreach($importItem in $importList) 4 | $importItem 5 | #end 6 | import io.swagger.annotations.ApiModel; 7 | import io.swagger.annotations.ApiModelProperty; 8 | /** 9 | * @类说明: ${cName}--实体类 10 | * @author: ${auth} 11 | * @date : ${time} 12 | **/ 13 | @ApiModel(value = "${upp}", description = "${cName}实体") 14 | public class ${upp} { 15 | 16 | //数据库中的字段 17 | #foreach ($fi in $fList) 18 | #if ($fi.type == "java.util.Date") 19 | // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 20 | #end 21 | @ApiModelProperty(value = "${fi.comment}", dataType = "${fi.type}") 22 | private ${fi.type} ${fi.lower_camel} ;// ${fi.comment} 23 | #end 24 | 25 | //此处可添加查询显示辅助字段 26 | 27 | //getters and setters 28 | #foreach ($fi in $fList) 29 | /** 30 | * @return ${fi.comment} 31 | */ 32 | public ${fi.type} get${fi.upper_camel}(){ 33 | return this.${fi.lower_camel} ; 34 | } 35 | 36 | /** 37 | * @param ${fi.comment} 38 | */ 39 | public void set${fi.upper_camel}(${fi.type} ${fi.lower_camel}){ 40 | this.${fi.lower_camel} = ${fi.lower_camel}; 41 | } 42 | 43 | #end 44 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/templates/mjwxmp_web_iview/ModelListExpand_vue.vm: -------------------------------------------------------------------------------- 1 | 13 | 18 | 28 | -------------------------------------------------------------------------------- /test-maven-plugin/src/main/config/templates/mjwxmp_web_iview/ModelMock_js.vm: -------------------------------------------------------------------------------- 1 | /*${cName}模拟数据},作者:${auth},日期:${time}*/ 2 | 'use strict'; 3 | var Mock = require('mockjs') 4 | var Random = Mock.Random; 5 | module.exports = { 6 | 7 | 'POST /api/${lowUpp}/queryPage': function (req, res, next) { 8 | var data = Mock.mock({ 9 | 'content|10': [{ 10 | #foreach($field in $fList) 11 | #if (${field.type} == "String") 12 | ${field.lower_camel} : "@word(5,10)",// ${field.comment} 13 | #else 14 | ${field.lower_camel}: "@integer(100,200)",//${field.comment} 15 | #end 16 | #end 17 | }], 18 | 'number': '@integer(100,200)', 19 | 'size': 10, 20 | 'totalElements': 500, 21 | }); 22 | 23 | var resp = { 24 | "code": 200, 25 | "errorMsg": "请求成功", 26 | "data":data 27 | }; 28 | 29 | setTimeout(function () { 30 | res.json(resp); 31 | }, 500); 32 | }, 33 | 34 | 'POST /api/${lowUpp}/update': function (req, res, next) { 35 | var resp = { 36 | "code": 200, 37 | "errorMsg": "请求成功", 38 | "data":1 39 | }; 40 | setTimeout(function () { 41 | res.json(resp); 42 | }, 500); 43 | }, 44 | 45 | 'POST /api/${lowUpp}/save': function (req, res, next) { 46 | var resp = { 47 | "code": 200, 48 | "errorMsg": "请求成功", 49 | "data":1 50 | }; 51 | setTimeout(function () { 52 | res.json(resp); 53 | }, 500); 54 | }, 55 | 56 | 'POST /api/${lowUpp}/queryList': function (req, res, next) { 57 | var data = Mock.mock({ 58 | 'content|10': [{ 59 | #foreach($field in $fList) 60 | #if (${field.type} == "String") 61 | ${field.lower_camel} : "@word(5,10)",// ${field.comment} 62 | #else 63 | ${field.lower_camel}: "@integer(100,200)",//${field.comment} 64 | #end 65 | #end 66 | }] 67 | }); 68 | var resp = { 69 | "code": 200, 70 | "errorMsg": "请求成功", 71 | "data":data.content 72 | }; 73 | 74 | setTimeout(function () { 75 | res.json(resp); 76 | }, 500); 77 | 78 | }, 79 | 80 | 'POST /api/${lowUpp}/delete': function (req, res, next) { 81 | var resp = { 82 | "code": 200, 83 | "errorMsg": "请求成功", 84 | "data":1 85 | }; 86 | setTimeout(function () { 87 | res.json(resp); 88 | }, 500); 89 | }, 90 | } -------------------------------------------------------------------------------- /test-maven-plugin/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alvin198761/gencode-maven-plugin/a8dac13cba10dffd01f45b0ae57c281df9c3223b/test-maven-plugin/src/main/resources/application.properties -------------------------------------------------------------------------------- /test.txt: -------------------------------------------------------------------------------- 1 | 111 --------------------------------------------------------------------------------