Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projectArtifacture
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yangzhaojun
projectArtifacture
Commits
dce67f21
Commit
dce67f21
authored
Aug 31, 2018
by
xfxmcy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cy.code generator v2.0
parent
8b6bffa1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
18 deletions
+90
-18
GeneratorRepository.java
src/main/java/org/rcisoft/code/dao/GeneratorRepository.java
+22
-0
ResultExceptionEnum.java
...ain/java/org/rcisoft/core/result/ResultExceptionEnum.java
+12
-17
ResultServiceExceptionEnums.java
.../org/rcisoft/core/result/ResultServiceExceptionEnums.java
+1
-1
ResultSystemExceptionEnums.java
...a/org/rcisoft/core/result/ResultSystemExceptionEnums.java
+11
-0
DbUtil.java
src/main/java/org/rcisoft/core/util/DbUtil.java
+11
-0
GeneratorMapper.xml
...main/resources/mapper/sys/code/mapper/GeneratorMapper.xml
+33
-0
No files found.
src/main/java/org/rcisoft/code/dao/GeneratorRepository.java
0 → 100644
View file @
dce67f21
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
);
}
src/main/java/org/rcisoft/core/result/ResultExceptionEnum.java
View file @
dce67f21
...
@@ -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
();
}
}
src/main/java/org/rcisoft/core/result/ResultServiceEnums.java
→
src/main/java/org/rcisoft/core/result/ResultServiceE
xceptionE
nums.java
View file @
dce67f21
...
@@ -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
ResultServiceE
xceptionE
nums
{
SUCCESS
(
0
,
"操作成功"
),
SUCCESS
(
0
,
"操作成功"
),
EXCEL_IMPORT_DATA_NOT_EXIST
(
11
,
"Excel中没有找到任何完整有效的数据"
),
EXCEL_IMPORT_DATA_NOT_EXIST
(
11
,
"Excel中没有找到任何完整有效的数据"
),
...
...
src/main/java/org/rcisoft/core/result/ResultSystemExceptionEnums.java
0 → 100644
View file @
dce67f21
package
org
.
rcisoft
.
core
.
result
;
/**
* Created with family.
* author: cy
* Date: 18/8/30
* Time: 下午2:54
* description:
*/
public
class
ResultSystemExceptionEnum
{
}
src/main/java/org/rcisoft/core/util/DbUtil.java
0 → 100644
View file @
dce67f21
package
org
.
rcisoft
.
core
.
util
;
/**
* Created with family.
* author: cy
* Date: 18/8/30
* Time: 下午2:36
* description:
*/
public
class
DbUtil
{
}
src/main/resources/mapper/sys/code/mapper/GeneratorMapper.xml
0 → 100644
View file @
dce67f21
<?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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment