Commit dce67f21 authored by xfxmcy's avatar xfxmcy

cy.code generator v2.0

parent 8b6bffa1
package com.github.wxiaoqi.security.generator.mapper;
import java.util.List;
import java.util.Map;
/**
* 代码生成器
*
* @author Mr.AG
* @email 463540703@qq.com
* @date 2017年08月25日
*/
public interface GeneratorMapper {
List<Map<String, Object>> queryList(Map<String, Object> map);
int queryTotal(Map<String, Object> map);
Map<String, String> queryTable(String tableName);
List<Map<String, String>> queryColumns(String tableName);
}
...@@ -7,22 +7,17 @@ import lombok.NoArgsConstructor; ...@@ -7,22 +7,17 @@ import lombok.NoArgsConstructor;
/** /**
* Created by lcy on 17/11/24. * Created by lcy on 17/11/24.
*/ */
@Getter public interface ResultExceptionEnum {
@NoArgsConstructor /**
@AllArgsConstructor * code
public enum ResultExceptionEnum { * @return
*/
USER_EXISTS(4001,"用户已经存在"), Integer getCode();
USER_NOT_EXISTS(4002,"用户不存在"),
SAVE_ERROR(4003,"添加失败"),
PARAM_ERROR(4004,"参数错误"),
OS_NOT_FOUND(4005,"操作系统不存在"),
SERVER_NOT_FOUND(4006,"服务器不存在"),
SERVER_HAS_APP(4007,"服务器仍有关联应用,不可删除"),
OS_HAS_SERVER(4008,"操作系统仍有关联服务器,不可删除"),
;
private Integer code;
private String message;
/**
* message
* @return
*/
String getMessage();
} }
...@@ -3,7 +3,7 @@ package org.rcisoft.core.result; ...@@ -3,7 +3,7 @@ package org.rcisoft.core.result;
/** /**
* Created by Administrator on 2017/11/27. * Created by Administrator on 2017/11/27.
*/ */
public enum ResultServiceEnums { public enum ResultServiceExceptionEnums {
SUCCESS(0,"操作成功"), SUCCESS(0,"操作成功"),
EXCEL_IMPORT_DATA_NOT_EXIST(11,"Excel中没有找到任何完整有效的数据"), EXCEL_IMPORT_DATA_NOT_EXIST(11,"Excel中没有找到任何完整有效的数据"),
......
package org.rcisoft.core.result;
/**
* Created with family.
* author: cy
* Date: 18/8/30
* Time: 下午2:54
* description:
*/
public class ResultSystemExceptionEnum {
}
package org.rcisoft.core.util;
/**
* Created with family.
* author: cy
* Date: 18/8/30
* Time: 下午2:36
* description:
*/
public class DbUtil {
}
<?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="org.rcisoft.code.dao.GeneratorRepository">
<select id="queryList" resultType="map">
select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables
where table_schema = (select database())
<if test="tableName != null and tableName.trim() != ''">
and table_name like concat('%', #{tableName}, '%')
</if>
order by create_time desc
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from information_schema.tables where table_schema = (select database())
<if test="tableName != null and tableName.trim() != ''">
and table_name like concat('%', #{tableName}, '%')
</if>
</select>
<select id="queryTable" resultType="map">
select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables
where table_schema = (select database()) and table_name = #{tableName}
</select>
<select id="queryColumns" resultType="map">
select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra,is_nullable isnullAble,column_default columnDefault from information_schema.columns
where table_name = #{tableName} and table_schema = (select database()) order by ordinal_position
</select>
</mapper>
\ No newline at end of file
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