RuoYi Code Generator Tutorial

RuoYi Code Generator Tutorial

Hello! If you want to learn how to use RuoYi code generator, you can read this article carefully to understand the basic knowledge of RuoYi code generator.

Create a new data table (note that the fields must be commented)

USE ry;

/*Table structure for table sys_zyq */

DROP TABLE IF EXISTS sys_zyq;

CREATE TABLE sys_zyq (
id int(4) NOT NULL AUTO_INCREMENT COMMENT ‘id’,
a1 int(4) DEFAULT NULL COMMENT ‘a1字段’,
a2 int(4) DEFAULT NULL COMMENT ‘a2字段’,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE /;
/
!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS /;
/
!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS /;
/
!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

Open the code editor module and select the table import just now

insert image description here

Fill in the basic information

insert image description here

Fill in the generated information

insert image description hereNote that the most important thing here is the module name and business name.
The module name involves the path of the module.

Then click generate code

insert image description hereThen click generate code
to download the code package

How to copy the code to the corresponding directory (this is the key point! The official document has been written in one stroke and many people have taken a detour)

1. insert image description hereRun zyqmenu.sql to the database
2.
insert image description hereCopy this to
insert image description here3. Put the other three into the mydemo package under ruoyi-system java
insert image description hereinsert image description here4. Put the mydemo in the mapper into the mapper under ruoyi-system resources
insert image description hereinsert image description here5. template Put the mydemo under ruoyi-admin resources in the templates and pay attention to the directory structure
insert image description hereinsert image description here

Finish

insert image description hereFinally, thanks to so many open source frameworks that allow us to accept outsourcing projects and shorten the development cycle

Guess you like

Origin blog.csdn.net/zyqytsoft/article/details/104945328