Commit 41ed864a authored by Ryan Loong's avatar Ryan Loong

update 表结构

parent d2b51d56
......@@ -71,6 +71,8 @@
<!-- autoScan为false,这里可以定义全局需要检查生成枚举类的列名 -->
<property name="enumColumns" value="type, status"/>
</plugin>
<!-- 增量插件 -->
<plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin" />
<commentGenerator>
<property name="suppressDate" value="true"/>
......@@ -123,6 +125,8 @@
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
<table tableName="student_info">
<!-- 配置需要进行增量操作的列名称(英文半角逗号分隔) -->
<property name="incrementColumns" value="call_times"/>
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
</context>
......
......@@ -3,6 +3,8 @@ package cn.exploring.engine.server.db.domain;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
public class StudentInfo {
/**
......@@ -102,6 +104,14 @@ public class StudentInfo {
*/
private Boolean deleted;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table student_info
*
* @mbg.generated
*/
protected final Map<String, Object> incrementColumnsInfoMap = new HashMap<>();
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column student_info.id
......@@ -416,6 +426,17 @@ public class StudentInfo {
return new StudentInfo.Builder();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table student_info
*
* @mbg.generated
*/
public StudentInfo increment(Increment.Item increment) {
this.incrementColumnsInfoMap.put(increment.getColumn().value(), increment);
return this;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table student_info
......@@ -857,4 +878,64 @@ public class StudentInfo {
return this.getEscapedColumnName();
}
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table student_info
*
* @mbg.generated
*/
public enum Increment {
callTimes(Column.callTimes);
private final Column column;
Increment(Column column) {
this.column = column;
}
public Column getColumn() {
return this.column;
}
public Increment.Item inc(Object value) {
return new Increment.Item(this.column, "+", value);
}
public Increment.Item dec(Object value) {
return new Increment.Item(this.column, "-", value);
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table student_info
*
* @mbg.generated
*/
class Item {
private Column column;
private String operate;
private Object value;
public Column getColumn() {
return this.column;
}
public String getOperate() {
return this.operate;
}
public Object getValue() {
return this.value;
}
public Item(Column column, String operate, Object value) {
this.column = column;
this.operate = operate;
this.value = value;
}
}
}
}
\ No newline at end of file
......@@ -4,11 +4,10 @@ import cn.exploring.engine.server.db.domain.StudentInfo;
import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.SearchBean;
import java.time.LocalDateTime;
@SearchBean(
tables = "(select * from student_info where deleted = false) st left join (select * from class_info where deleted = false) cl on cl.id = st.class_id",
autoMapTo = "st"
autoMapTo = "st",
ignoreFields = { "incrementColumnsInfoMap" }
)
public class StudentVo extends StudentInfo {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment