| | |
| | | import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.generator.FastAutoGenerator; |
| | | import com.baomidou.mybatisplus.generator.config.*; |
| | | import com.baomidou.mybatisplus.generator.config.GlobalConfig; |
| | | import com.baomidou.mybatisplus.generator.config.OutputFile; |
| | | import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert; |
| | | import com.baomidou.mybatisplus.generator.config.po.TableField; |
| | | import com.baomidou.mybatisplus.generator.config.rules.DbColumnType; |
| | |
| | | // 演示例子,执行 main 方法控制台输入模块表名回车自动生成对应项目目录中 |
| | | public class CodeGenerator { |
| | | |
| | | public static String database_url = "jdbc:mysql://127.0.0.1:3306/product-inventory-management"; |
| | | public static String database_url = "jdbc:mysql://localhost:3307/product-inventory-management-new-pro"; |
| | | public static String database_username = "root"; |
| | | public static String database_password= "123456"; |
| | | public static String author = "芯导软件(江苏)有限公司"; |
| | | public static String model = "quality"; // 模块 |
| | | public static String model = "technology"; // 模块 |
| | | public static String setParent = "com.ruoyi."+ model; // 包路径 |
| | | public static String tablePrefix = ""; // 设置过滤表前缀 |
| | | public static void main(String[] args) { |
| | |
| | | new Column("update_time", FieldFill.INSERT_UPDATE), |
| | | new Column("create_user", FieldFill.INSERT), |
| | | new Column("update_user", FieldFill.INSERT_UPDATE), |
| | | new Column("tenant_id", FieldFill.INSERT) |
| | | new Column("dept_id", FieldFill.INSERT) |
| | | ) |
| | | .idType(IdType.AUTO) // 自增主键 |
| | | |
| | |
| | | StringBuilder help = new StringBuilder(); |
| | | help.append("请输入" + tip + ":"); |
| | | System.out.println(help.toString()); |
| | | if (scanner.hasNext()) { |
| | | String ipt = scanner.next(); |
| | | |
| | | if (scanner.hasNextLine()) { |
| | | String ipt = scanner.nextLine(); |
| | | if (StringUtils.isNotBlank(ipt)) { |
| | | return ipt; |
| | | } |