模板管理
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.cczsa.xinghe.codegen.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cczsa.xinghe.codegen.entity.TemplateEntity;
|
||||
|
||||
/**
|
||||
* 映射层。
|
||||
*
|
||||
* @author My
|
||||
* @since 0.0.1
|
||||
*/
|
||||
@Mapper
|
||||
public interface TemplateMapper extends BaseMapper<TemplateEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.cczsa.xinghe.codegen.mapper.def;
|
||||
|
||||
import com.mybatisflex.core.query.QueryColumn;
|
||||
import com.mybatisflex.core.table.TableDef;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 表定义层。
|
||||
*
|
||||
* @author My
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public class TemplateDef extends TableDef {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static final TemplateDef TEMPLATE_ENTITY = new TemplateDef();
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
public final QueryColumn ID = new QueryColumn(this, "id");
|
||||
|
||||
/**
|
||||
* 是否使用
|
||||
*/
|
||||
public final QueryColumn IS_USE = new QueryColumn(this, "is_use");
|
||||
|
||||
/**
|
||||
* 正文
|
||||
*/
|
||||
public final QueryColumn CONTENT = new QueryColumn(this, "content");
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
public final QueryColumn TEMPLATE_NAME = new QueryColumn(this, "template_name");
|
||||
|
||||
/**
|
||||
* 模板类型
|
||||
*/
|
||||
public final QueryColumn TEMPLATE_TYPE = new QueryColumn(this, "template_type");
|
||||
|
||||
/**
|
||||
* 所有字段。
|
||||
*/
|
||||
public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");
|
||||
|
||||
/**
|
||||
* 默认字段,不包含逻辑删除或者 large 等字段。
|
||||
*/
|
||||
public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, IS_USE, TEMPLATE_NAME, TEMPLATE_TYPE, CONTENT};
|
||||
|
||||
public TemplateDef() {
|
||||
super("", "cg_template");
|
||||
}
|
||||
|
||||
private TemplateDef(String schema, String name, String alisa) {
|
||||
super(schema, name, alisa);
|
||||
}
|
||||
|
||||
public TemplateDef as(String alias) {
|
||||
String key = getNameWithSchema() + "." + alias;
|
||||
return getCache(key, k -> new TemplateDef("", "cg_template", alias));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user