新增mybatis逆向工程

master
xiaoCJ 2 years ago
parent 47bdb8ccf8
commit 9919817637

@ -16,7 +16,12 @@
</description>
<dependencies>
<!--逆向工程-->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.4.0</version>
</dependency>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>

@ -0,0 +1,39 @@
package com.ruoyi;
import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.internal.DefaultShellCallback;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
public class GeneratorUtil {
public static void generate() {
try {
List<String> warnings = new ArrayList<>();
boolean overwrite = true;
// 获取 generatorConfig.xml 文件路径
URL resourceUrl = GeneratorUtil.class.getResource("/generatorConfig.xml");
String configFilePath = resourceUrl.getFile();
File configFileObj = new File(configFilePath);
ConfigurationParser cp = new ConfigurationParser(warnings);
Configuration config = cp.parseConfiguration(configFileObj);
DefaultShellCallback callback = new DefaultShellCallback(overwrite);
MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
myBatisGenerator.generate(null);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
generate();
}
}

@ -3,6 +3,16 @@ package com.ruoyi.biemo.business.domain;
public class EmotionResult {
private String downName;
private String upName;
private String text;
public void setText(String text) {
this.text = text;
}
public String getText() {
return text;
}
private int downCount;
private int upCount;

@ -0,0 +1,96 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.SysTrainingScore;
import com.ruoyi.system.domain.SysTrainingScoreExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysTrainingScoreMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
long countByExample(SysTrainingScoreExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
int deleteByExample(SysTrainingScoreExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
int insert(SysTrainingScore record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
int insertSelective(SysTrainingScore record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
List<SysTrainingScore> selectByExample(SysTrainingScoreExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
SysTrainingScore selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
int updateByExampleSelective(@Param("record") SysTrainingScore record, @Param("example") SysTrainingScoreExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
int updateByExample(@Param("record") SysTrainingScore record, @Param("example") SysTrainingScoreExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
int updateByPrimaryKeySelective(SysTrainingScore record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table sys_training_score
*
* @mbg.generated Thu Aug 10 10:19:07 CST 2023
*/
int updateByPrimaryKey(SysTrainingScore record);
}
Loading…
Cancel
Save