@@ -26,7 +26,7 @@ | |||
</modules> | |||
<properties> | |||
<java.version>1.8</java.version> | |||
<java.version>11</java.version> | |||
<!-- 表示打包时跳过mvn test --> | |||
<maven.test.skip>true</maven.test.skip> | |||
<!--全局配置项目版本号--> |
@@ -13,7 +13,7 @@ | |||
<artifactId>tuoheng-admin</artifactId> | |||
<packaging>jar</packaging> | |||
<name>tuoheng-admin</name> | |||
<description>Demo project for Spring Boot</description> | |||
<description>拓恒机场统一管理后台</description> | |||
@@ -39,11 +39,6 @@ | |||
<artifactId>lombok</artifactId> | |||
<optional>true</optional> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework.amqp</groupId> | |||
<artifactId>spring-rabbit-test</artifactId> | |||
<scope>test</scope> | |||
</dependency> | |||
<!-- 引入阿里数据库连接池 --> | |||
<dependency> | |||
<groupId>com.alibaba</groupId> | |||
@@ -57,16 +52,6 @@ | |||
<version>1.2.17</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.hibernate</groupId> | |||
<artifactId>hibernate-validator</artifactId> | |||
<version>6.0.15.Final</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.google.protobuf</groupId> | |||
<artifactId>protobuf-java</artifactId> | |||
<version>3.9.2</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework.boot</groupId> | |||
<artifactId>spring-boot-starter-websocket</artifactId> |
@@ -1,36 +0,0 @@ | |||
#错误消息 | |||
not.null=* 必须填写 | |||
user.jcaptcha.error=验证码错误 | |||
user.jcaptcha.expire=验证码已失效 | |||
user.not.exists=用户不存在/密码错误 | |||
user.password.not.match=用户不存在/密码错误 | |||
user.password.retry.limit.count=密码输入错误{0}次 | |||
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟 | |||
user.password.delete=对不起,您的账号已被删除 | |||
user.blocked=用户已封禁,请联系管理员 | |||
role.blocked=角色已封禁,请联系管理员 | |||
user.logout.success=退出成功 | |||
length.not.valid=长度必须在{min}到{max}个字符之间 | |||
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 | |||
user.password.not.valid=* 5-50个字符 | |||
user.email.not.valid=邮箱格式错误 | |||
user.mobile.phone.number.not.valid=手机号格式错误 | |||
user.login.success=登录成功 | |||
user.notfound=请重新登录 | |||
user.forcelogout=管理员强制退出,请重新登录 | |||
user.unknown.error=未知错误,请重新登录 | |||
##文件上传消息 | |||
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB! | |||
upload.filename.exceed.length=上传的文件名最长{0}个字符 | |||
##权限 | |||
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] | |||
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] | |||
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] | |||
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] | |||
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] | |||
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] |
@@ -1,116 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.tuoheng.generator.mapper.GenTableColumnMapper"> | |||
<resultMap type="com.tuoheng.generator.entity.GenTableColumn" id="GenTableColumnResult"> | |||
<id property="id" column="id"/> | |||
<result property="tableId" column="table_id"/> | |||
<result property="columnName" column="column_name"/> | |||
<result property="columnComment" column="column_comment"/> | |||
<result property="columnType" column="column_type"/> | |||
<result property="javaType" column="java_type"/> | |||
<result property="javaField" column="java_field"/> | |||
<result property="isPk" column="is_pk"/> | |||
<result property="isIncrement" column="is_increment"/> | |||
<result property="isRequired" column="is_required"/> | |||
<result property="isInsert" column="is_insert"/> | |||
<result property="isEdit" column="is_edit"/> | |||
<result property="isList" column="is_list"/> | |||
<result property="isQuery" column="is_query"/> | |||
<result property="queryType" column="query_type"/> | |||
<result property="htmlType" column="html_type"/> | |||
<result property="dictType" column="dict_type"/> | |||
<result property="sort" column="sort"/> | |||
<result property="createUser" column="create_user"/> | |||
<result property="createTime" column="create_time"/> | |||
<result property="updateUser" column="update_user"/> | |||
<result property="updateTime" column="update_time"/> | |||
</resultMap> | |||
<!-- 根据表明获取列信息 --> | |||
<select id="selectDbTableColumnsByName" parameterType="String" resultMap="GenTableColumnResult"> | |||
select column_name, (case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else null end) as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, column_comment, (case when extra = 'auto_increment' then '1' else '0' end) as is_increment, column_type | |||
from information_schema.columns where table_schema = (select database()) and table_name = (#{tableName}) | |||
order by ordinal_position | |||
</select> | |||
<!-- 插入表列信息 --> | |||
<insert id="insertGenTableColumn" parameterType="com.tuoheng.generator.entity.GenTableColumn" useGeneratedKeys="true" | |||
keyProperty="id"> | |||
insert into gen_table_column ( | |||
<if test="tableId != null and tableId != ''">table_id,</if> | |||
<if test="columnName != null and columnName != ''">column_name,</if> | |||
<if test="columnComment != null and columnComment != ''">column_comment,</if> | |||
<if test="columnType != null and columnType != ''">column_type,</if> | |||
<if test="javaType != null and javaType != ''">java_type,</if> | |||
<if test="javaField != null and javaField != ''">java_field,</if> | |||
<if test="isPk != null and isPk != ''">is_pk,</if> | |||
<if test="isIncrement != null and isIncrement != ''">is_increment,</if> | |||
<if test="isRequired != null and isRequired != ''">is_required,</if> | |||
<if test="isInsert != null and isInsert != ''">is_insert,</if> | |||
<if test="isEdit != null and isEdit != ''">is_edit,</if> | |||
<if test="isList != null and isList != ''">is_list,</if> | |||
<if test="isQuery != null and isQuery != ''">is_query,</if> | |||
<if test="queryType != null and queryType != ''">query_type,</if> | |||
<if test="htmlType != null and htmlType != ''">html_type,</if> | |||
<if test="dictType != null and dictType != ''">dict_type,</if> | |||
<if test="sort != null">sort,</if> | |||
<if test="createUser != null and createUser != ''">create_user,</if> | |||
create_time | |||
)values( | |||
<if test="tableId != null and tableId != ''">#{tableId},</if> | |||
<if test="columnName != null and columnName != ''">#{columnName},</if> | |||
<if test="columnComment != null and columnComment != ''">#{columnComment},</if> | |||
<if test="columnType != null and columnType != ''">#{columnType},</if> | |||
<if test="javaType != null and javaType != ''">#{javaType},</if> | |||
<if test="javaField != null and javaField != ''">#{javaField},</if> | |||
<if test="isPk != null and isPk != ''">#{isPk},</if> | |||
<if test="isIncrement != null and isIncrement != ''">#{isIncrement},</if> | |||
<if test="isRequired != null and isRequired != ''">#{isRequired},</if> | |||
<if test="isInsert != null and isInsert != ''">#{isInsert},</if> | |||
<if test="isEdit != null and isEdit != ''">#{isEdit},</if> | |||
<if test="isList != null and isList != ''">#{isList},</if> | |||
<if test="isQuery != null and isQuery != ''">#{isQuery},</if> | |||
<if test="queryType != null and queryType != ''">#{queryType},</if> | |||
<if test="htmlType != null and htmlType != ''">#{htmlType},</if> | |||
<if test="dictType != null and dictType != ''">#{dictType},</if> | |||
<if test="sort != null">#{sort},</if> | |||
<if test="createUser != null and createUser != ''">#{createUser},</if> | |||
sysdate() | |||
) | |||
</insert> | |||
<sql id="selectGenTableColumnVo"> | |||
select id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_user, create_time, update_user, update_time from gen_table_column | |||
</sql> | |||
<!-- 获取表字段列表 --> | |||
<select id="selectGenTableColumnListByTableId" parameterType="Integer" resultMap="GenTableColumnResult"> | |||
<include refid="selectGenTableColumnVo"/> | |||
where table_id = #{tableId} | |||
order by sort | |||
</select> | |||
<!-- 更新业务表字段 --> | |||
<update id="updateGenTableColumn" parameterType="com.tuoheng.generator.entity.GenTableColumn"> | |||
update gen_table_column | |||
<set> | |||
column_comment = #{columnComment}, | |||
java_type = #{javaType}, | |||
java_field = #{javaField}, | |||
is_insert = #{isInsert}, | |||
is_edit = #{isEdit}, | |||
is_list = #{isList}, | |||
is_query = #{isQuery}, | |||
is_required = #{isRequired}, | |||
query_type = #{queryType}, | |||
html_type = #{htmlType}, | |||
dict_type = #{dictType}, | |||
sort = #{sort}, | |||
update_user = #{updateUser}, | |||
update_time = sysdate() | |||
</set> | |||
where id = #{id} | |||
</update> | |||
</mapper> |
@@ -1,162 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.tuoheng.generator.mapper.GenTableMapper"> | |||
<resultMap type="com.tuoheng.generator.entity.GenTable" id="GenTableResult"> | |||
<id property="id" column="id"/> | |||
<result property="tableName" column="table_name"/> | |||
<result property="tableComment" column="table_comment"/> | |||
<result property="className" column="class_name"/> | |||
<result property="tplCategory" column="tpl_category"/> | |||
<result property="packageName" column="package_name"/> | |||
<result property="moduleName" column="module_name"/> | |||
<result property="businessName" column="business_name"/> | |||
<result property="functionName" column="function_name"/> | |||
<result property="functionAuthor" column="function_author"/> | |||
<result property="options" column="options"/> | |||
<result property="createUser" column="create_user"/> | |||
<result property="createTime" column="create_time"/> | |||
<result property="updateUser" column="update_user"/> | |||
<result property="updateTime" column="update_time"/> | |||
<result property="note" column="note"/> | |||
<collection property="columns" javaType="java.util.List" resultMap="GenTableColumnResult"/> | |||
</resultMap> | |||
<resultMap type="com.tuoheng.generator.entity.GenTableColumn" id="GenTableColumnResult"> | |||
<id property="id" column="id"/> | |||
<result property="tableId" column="table_id"/> | |||
<result property="columnName" column="column_name"/> | |||
<result property="columnComment" column="column_comment"/> | |||
<result property="columnType" column="column_type"/> | |||
<result property="javaType" column="java_type"/> | |||
<result property="javaField" column="java_field"/> | |||
<result property="isPk" column="is_pk"/> | |||
<result property="isIncrement" column="is_increment"/> | |||
<result property="isRequired" column="is_required"/> | |||
<result property="isInsert" column="is_insert"/> | |||
<result property="isEdit" column="is_edit"/> | |||
<result property="isList" column="is_list"/> | |||
<result property="isQuery" column="is_query"/> | |||
<result property="queryType" column="query_type"/> | |||
<result property="htmlType" column="html_type"/> | |||
<result property="dictType" column="dict_type"/> | |||
<result property="sort" column="sort"/> | |||
<result property="createUser" column="create_user"/> | |||
<result property="createTime" column="create_time"/> | |||
<result property="updateUser" column="update_user"/> | |||
<result property="updateTime" column="update_time"/> | |||
</resultMap> | |||
<sql id="selectGenTableVo"> | |||
select id, table_name, table_comment, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, options, note, create_user, create_time, update_user, update_time, mark from gen_table | |||
</sql> | |||
<!-- 获取数据表列表 --> | |||
<select id="selectGenTableList" parameterType="com.tuoheng.generator.entity.GenTable" resultMap="GenTableResult"> | |||
<include refid="selectGenTableVo"/> | |||
<where> | |||
<if test="param.tableName != null and param.tableName != ''"> | |||
AND lower(table_name) like lower(concat('%', #{param.tableName}, '%')) | |||
</if> | |||
<if test="param.tableComment != null and param.tableComment != ''"> | |||
AND lower(table_comment) like lower(concat('%', #{param.tableComment}, '%')) | |||
</if> | |||
AND mark = 1 | |||
</where> | |||
</select> | |||
<!-- 获取数据库表 --> | |||
<select id="selectDbTableList" parameterType="com.tuoheng.generator.entity.GenTable" resultMap="GenTableResult"> | |||
select table_name, table_comment, create_time, update_time from information_schema.tables | |||
where table_schema = (select database()) | |||
AND table_name NOT LIKE 'gen_%' | |||
AND table_name NOT IN (select table_name from gen_table) | |||
<if test="param.tableName != null and param.tableName != ''"> | |||
AND lower(table_name) like lower(concat('%', #{param.tableName}, '%')) | |||
</if> | |||
</select> | |||
<!-- 根据表名获取数据表 --> | |||
<select id="selectDbTableListByNames" resultMap="GenTableResult"> | |||
select table_name, table_comment, create_time, update_time from information_schema.tables | |||
where table_name NOT LIKE 'gen_%' and table_schema = (select database()) | |||
and table_name in | |||
<foreach collection="array" item="name" open="(" separator="," close=")"> | |||
#{name} | |||
</foreach> | |||
</select> | |||
<!-- 插入表结构 --> | |||
<insert id="insertGenTable" parameterType="com.tuoheng.generator.entity.GenTable" useGeneratedKeys="true" | |||
keyProperty="id"> | |||
insert into gen_table ( | |||
<if test="tableName != null">table_name,</if> | |||
<if test="tableComment != null and tableComment != ''">table_comment,</if> | |||
<if test="className != null and className != ''">class_name,</if> | |||
<if test="tplCategory != null and tplCategory != ''">tpl_category,</if> | |||
<if test="packageName != null and packageName != ''">package_name,</if> | |||
<if test="moduleName != null and moduleName != ''">module_name,</if> | |||
<if test="businessName != null and businessName != ''">business_name,</if> | |||
<if test="functionName != null and functionName != ''">function_name,</if> | |||
<if test="functionAuthor != null and functionAuthor != ''">function_author,</if> | |||
<if test="note != null and note != ''">note,</if> | |||
<if test="createUser != null and createUser != ''">create_user,</if> | |||
create_time | |||
)values( | |||
<if test="tableName != null">#{tableName},</if> | |||
<if test="tableComment != null and tableComment != ''">#{tableComment},</if> | |||
<if test="className != null and className != ''">#{className},</if> | |||
<if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if> | |||
<if test="packageName != null and packageName != ''">#{packageName},</if> | |||
<if test="moduleName != null and moduleName != ''">#{moduleName},</if> | |||
<if test="businessName != null and businessName != ''">#{businessName},</if> | |||
<if test="functionName != null and functionName != ''">#{functionName},</if> | |||
<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if> | |||
<if test="note != null and note != ''">#{note},</if> | |||
<if test="createUser != null and createUser != ''">#{createUser},</if> | |||
sysdate() | |||
) | |||
</insert> | |||
<!-- 获取表详情信息 --> | |||
<select id="selectGenTableById" parameterType="Integer" resultMap="GenTableResult"> | |||
SELECT t.id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.note, | |||
c.id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort | |||
FROM gen_table t | |||
LEFT JOIN gen_table_column c ON t.id = c.table_id | |||
where c.table_id = #{tableId} | |||
</select> | |||
<!-- 更新业务表 --> | |||
<update id="updateGenTable" parameterType="com.tuoheng.generator.entity.GenTable"> | |||
update gen_table | |||
<set> | |||
<if test="tableName != null">table_name = #{tableName},</if> | |||
<if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if> | |||
<if test="className != null and className != ''">class_name = #{className},</if> | |||
<if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if> | |||
<if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if> | |||
<if test="packageName != null and packageName != ''">package_name = #{packageName},</if> | |||
<if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if> | |||
<if test="businessName != null and businessName != ''">business_name = #{businessName},</if> | |||
<if test="functionName != null and functionName != ''">function_name = #{functionName},</if> | |||
<if test="options != null and options != ''">options = #{options},</if> | |||
<if test="updateUser != null and updateUser != ''">update_user = #{updateUser},</if> | |||
<if test="note != null">note = #{note},</if> | |||
update_time = sysdate() | |||
</set> | |||
where id = #{id} | |||
</update> | |||
<!-- 根据表名获取业务表 --> | |||
<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult"> | |||
SELECT t.id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.note, | |||
c.id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort | |||
FROM gen_table t | |||
LEFT JOIN gen_table_column c ON t.id = c.table_id | |||
where t.table_name = #{tableName} | |||
</select> | |||
</mapper> |
@@ -1,46 +0,0 @@ | |||
package ${packageName}.constant; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
/** | |||
* <p> | |||
* ${tableAnnotation} 模块常量 | |||
* </p> | |||
* | |||
* @author ${author} | |||
* @since ${date} | |||
*/ | |||
public class ${entityName}Constant { | |||
<#if model_column?exists> | |||
<#list model_column as model> | |||
<#if model.hasColumnCommentValue = true> | |||
/** | |||
* ${model.columnCommentName} | |||
*/ | |||
<#if model.columnNumberValue = true> | |||
public static Map<Integer, String> ${entityName?upper_case}_${model.changeColumnName?upper_case}_LIST = new HashMap<Integer, String>() { | |||
{ | |||
<#if model.columnCommentValue?exists> | |||
<#list model.columnCommentValue?keys as key> | |||
put(${key}, "${model.columnCommentValue[key]}"); | |||
</#list> | |||
</#if> | |||
} | |||
}; | |||
<#else> | |||
public static Map<String, String> ${entityName?upper_case}_${model.changeColumnName?upper_case}_LIST = new HashMap<String, String>() { | |||
{ | |||
<#if model.columnCommentValue?exists> | |||
<#list model.columnCommentValue?keys as key> | |||
put("${key}", "${model.columnCommentValue[key]}"); | |||
</#list> | |||
</#if> | |||
} | |||
}; | |||
</#if> | |||
</#if> | |||
</#list> | |||
</#if> | |||
} |
@@ -1,109 +0,0 @@ | |||
package ${packageName}.controller; | |||
import LogType; | |||
import BaseController; | |||
import ${packageName}.entity.${entityName}; | |||
import ${packageName}.query.${entityName}Query; | |||
import ${packageName}.service.I${entityName}Service; | |||
import Log; | |||
import JsonResult; | |||
import org.apache.shiro.authz.annotation.RequiresPermissions; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.*; | |||
/** | |||
* <p> | |||
* ${tableAnnotation} 前端控制器 | |||
* </p> | |||
* | |||
* @author ${author} | |||
* @since ${date} | |||
*/ | |||
@RestController | |||
@RequestMapping("/${entityName?lower_case}") | |||
public class ${entityName}Controller extends BaseController { | |||
@Autowired | |||
private I${entityName}Service ${entityName?uncap_first}Service; | |||
/** | |||
* 获取数据列表 | |||
* | |||
* @param query 查询条件 | |||
* @return | |||
*/ | |||
//@RequiresPermissions("sys:${entityName?lower_case}:index") | |||
@GetMapping("/index") | |||
public JsonResult index(${entityName}Query query) { | |||
return ${entityName?uncap_first}Service.getList(query); | |||
} | |||
/** | |||
* 添加记录 | |||
* | |||
* @param entity 实体对象 | |||
* @return | |||
*/ | |||
@Log(title = "${tableAnnotation}", logType = LogType.INSERT) | |||
//@RequiresPermissions("sys:${entityName?lower_case}:add") | |||
@PostMapping("/add") | |||
public JsonResult add(@RequestBody ${entityName} entity) { | |||
return ${entityName?uncap_first}Service.edit(entity); | |||
} | |||
/** | |||
* 获取详情 | |||
* | |||
* @param ${entityName?lower_case}Id 记录ID | |||
* @return | |||
*/ | |||
@GetMapping("/info/{${entityName?lower_case}Id}") | |||
public JsonResult info(@PathVariable("${entityName?lower_case}Id") Integer ${entityName?lower_case}Id) { | |||
return ${entityName?uncap_first}Service.info(${entityName?lower_case}Id); | |||
} | |||
/** | |||
* 更新记录 | |||
* | |||
* @param entity 实体对象 | |||
* @return | |||
*/ | |||
@Log(title = "${tableAnnotation}", logType = LogType.UPDATE) | |||
//@RequiresPermissions("sys:${entityName?lower_case}:edit") | |||
@PutMapping("/edit") | |||
public JsonResult edit(@RequestBody ${entityName} entity) { | |||
return ${entityName?uncap_first}Service.edit(entity); | |||
} | |||
/** | |||
* 删除记录 | |||
* | |||
* @param ${entityName?lower_case}Ids 记录ID | |||
* @return | |||
*/ | |||
@Log(title = "${tableAnnotation}", logType = LogType.DELETE) | |||
//@RequiresPermissions("sys:${entityName?lower_case}:drop") | |||
@DeleteMapping("/delete/{${entityName?lower_case}Ids}") | |||
public JsonResult delete(@PathVariable("${entityName?lower_case}Ids") Integer[] ${entityName?lower_case}Ids) { | |||
return ${entityName?uncap_first}Service.deleteByIds(${entityName?lower_case}Ids); | |||
} | |||
<#if model_column?exists> | |||
<#list model_column as model> | |||
<#if model.columnSwitch == true> | |||
/** | |||
* 设置${model.columnCommentName} | |||
* | |||
* @param entity 实体对象 | |||
* @return | |||
*/ | |||
@Log(title = "${tableAnnotation}", logType = LogType.STATUS) | |||
//@RequiresPermissions("sys:${entityName?lower_case}:${model.columnName}") | |||
@PutMapping("/set${model.changeColumnName?cap_first}") | |||
public JsonResult set${model.changeColumnName?cap_first}(@RequestBody ${entityName} entity) { | |||
return ${entityName?uncap_first}Service.set${model.changeColumnName?cap_first}(entity); | |||
} | |||
</#if> | |||
</#list> | |||
</#if> | |||
} |
@@ -1,16 +0,0 @@ | |||
package ${packageName}.mapper; | |||
import ${packageName}.entity.${entityName}; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
/** | |||
* <p> | |||
* ${tableAnnotation} Mapper 接口 | |||
* </p> | |||
* | |||
* @author ${author} | |||
* @since ${date} | |||
*/ | |||
public interface ${entityName}Mapper extends BaseMapper<${entityName}> { | |||
} |
@@ -1,82 +0,0 @@ | |||
package ${packageName}.entity; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import BaseEntity; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import lombok.experimental.Accessors; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.util.Date; | |||
/** | |||
* <p> | |||
* ${tableAnnotation} | |||
* </p> | |||
* | |||
* @author ${author} | |||
* @since ${date} | |||
*/ | |||
@Data | |||
@EqualsAndHashCode(callSuper = true) | |||
@Accessors(chain = true) | |||
@TableName("${tableName}") | |||
public class ${entityName} extends BaseEntity { | |||
private static final long serialVersionUID = 1L; | |||
<#if model_column?exists> | |||
<#list model_column as model> | |||
<#if model.changeColumnName?uncap_first != 'createUser' && model.changeColumnName?uncap_first != 'createTime' && model.changeColumnName?uncap_first != 'updateUser' && model.changeColumnName?uncap_first != 'updateTime' && model.changeColumnName?uncap_first != 'mark'> | |||
/** | |||
* ${model.columnComment!} | |||
*/ | |||
<#if (model.columnType = 'VARCHAR' || model.columnType = 'CHAR' || model.columnType = 'TEXT' || model.columnType = 'MEDIUMTEXT')> | |||
private String ${model.changeColumnName?uncap_first}; | |||
</#if> | |||
<#if (model.columnType = 'DATETIME' || model.columnType = 'DATE' || model.columnType = 'TIME' || model.columnType = 'YEAR' || model.columnType = 'TIMESTAMP') > | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date ${model.changeColumnName?uncap_first}; | |||
</#if> | |||
<#if (model.columnType = 'TINYINT UNSIGNED' || model.columnType = 'TINYINT')> | |||
private Integer ${model.changeColumnName?uncap_first}; | |||
</#if> | |||
<#if (model.columnType = 'SMALLINT UNSIGNED' || model.columnType = 'SMALLINT' || model.columnType = 'MEDIUMINT UNSIGNED' || model.columnType = 'MEDIUMINT')> | |||
private Integer ${model.changeColumnName?uncap_first}; | |||
</#if> | |||
<#if (model.columnType = 'INT UNSIGNED' || model.columnType = 'INT')> | |||
private Integer ${model.changeColumnName?uncap_first}; | |||
</#if> | |||
<#if (model.columnType = 'BIGINT UNSIGNED' || model.columnType = 'BIGINT')> | |||
private Integer ${model.changeColumnName?uncap_first}; | |||
</#if> | |||
<#if (model.columnType = 'DECIMAL UNSIGNED' || model.columnType = 'DECIMAL')> | |||
private BigDecimal ${model.changeColumnName?uncap_first}; | |||
</#if> | |||
<#if (model.columnType = 'FLOAT UNSIGNED' || model.columnType = 'FLOAT')> | |||
private Float ${model.changeColumnName?uncap_first}; | |||
</#if> | |||
<#if (model.columnType = 'DOUBLE UNSIGNED' || model.columnType = 'DOUBLE')> | |||
private Double ${model.changeColumnName?uncap_first}; | |||
</#if> | |||
<#if model.columnType = 'BLOB'> | |||
private byte[] ${model.changeColumnName?uncap_first}; | |||
</#if> | |||
</#if> | |||
</#list> | |||
</#if> | |||
} |