parent
94b7301fd4
commit
83f5b8dc44
@ -1,134 +0,0 @@
|
||||
package ${basePackage}.action.ajax.system;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import ${basePackage}.frame.auth.LocalData;
|
||||
import ${basePackage}.frame.base.ErrorType;
|
||||
import ${basePackage}.frame.utils.CookieUtil;
|
||||
import ${basePackage}.frame.utils.MD5Util;
|
||||
import ${basePackage}.frame.utils.RequestUtil;
|
||||
import ${basePackage}.frame.utils.ValidationUtil;
|
||||
import ${basePackage}.module.system.ent.User;
|
||||
import ${basePackage}.module.system.mgr.TokensManager;
|
||||
import ${basePackage}.module.system.mgr.UserManager;
|
||||
import ${basePackage}.module.system.req.AuthLoginRequest;
|
||||
import ${basePackage}.module.system.req.TokensCreateRequest;
|
||||
import ${basePackage}.module.system.req.UserFindRequest;
|
||||
import ${basePackage}.module.system.rsp.AuthLoginResponse;
|
||||
import ${basePackage}.module.system.rsp.TokensCreateResponse;
|
||||
import ${basePackage}.module.system.rsp.UserFindResponse;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
public class AuthAjax {
|
||||
@Value("${r'${web.url.auth.admin}'}")
|
||||
private String admin;
|
||||
@Value("${r'${web.url.auth.pwd}'}")
|
||||
private String pwd;
|
||||
@Autowired
|
||||
private TokensManager tokensManager;
|
||||
@Autowired
|
||||
private UserManager userManager;
|
||||
|
||||
public AuthLoginResponse login(AuthLoginRequest request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
AuthLoginResponse response = new AuthLoginResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
if (request.getUsername().equals(admin)) {//超级管理员登录
|
||||
String generatePwd = MD5Util.generatePwd(request.getPassword());
|
||||
if (!generatePwd.equals(pwd)) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, "登录密码错误");
|
||||
} else {
|
||||
Date current = new Date();
|
||||
Calendar instance = Calendar.getInstance();
|
||||
instance.setTime(current);
|
||||
instance.add(Calendar.HOUR_OF_DAY, 1);//默认一个小时内有效
|
||||
|
||||
TokensCreateRequest tokensCreateRequest = new TokensCreateRequest();
|
||||
tokensCreateRequest.setToken(UUID.randomUUID().toString());
|
||||
tokensCreateRequest.setUserId(0L);
|
||||
tokensCreateRequest.setUserName("超级管理员");
|
||||
tokensCreateRequest.setLoginTime(current);
|
||||
tokensCreateRequest.setValidTime(instance.getTime());
|
||||
tokensCreateRequest.setValid(true);
|
||||
tokensCreateRequest.setDeptId(null);
|
||||
tokensCreateRequest.setDeptCode(null);
|
||||
tokensCreateRequest.setDeptName(null);
|
||||
tokensCreateRequest.setTerminalType("WEB");
|
||||
tokensCreateRequest.setTerminalIp(RequestUtil.getIp(httpServletRequest));
|
||||
tokensCreateRequest.setTerminalInfo(RequestUtil.getUserAgent(httpServletRequest));
|
||||
TokensCreateResponse tokensCreateResponse = tokensManager.create(tokensCreateRequest, LocalData.getSysToken());
|
||||
|
||||
if (tokensCreateResponse.hasError()) {
|
||||
response.addErrors(tokensCreateResponse.getErrors());
|
||||
return response;
|
||||
}
|
||||
Cookie cookie = CookieUtil.newCookie("token", tokensCreateRequest.getToken());
|
||||
cookie.setPath("/");
|
||||
httpServletResponse.addCookie(cookie);
|
||||
}
|
||||
} else {//管理员登录
|
||||
UserFindRequest userFindRequest = new UserFindRequest();
|
||||
userFindRequest.setUserName(request.getUsername());
|
||||
UserFindResponse userFindResponse = userManager.find(userFindRequest, LocalData.getSysToken());
|
||||
|
||||
if (userFindResponse.hasError()) {
|
||||
response.addErrors(userFindResponse.getErrors());
|
||||
return response;
|
||||
} else if (userFindResponse.getResult().size() == 0) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, "用户名或密码错误!");
|
||||
return response;
|
||||
} else if (userFindResponse.getResult().size() > 1) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, "用户信息异常!");
|
||||
return response;
|
||||
}
|
||||
|
||||
User user = userFindResponse.getResult().get(0);
|
||||
|
||||
String generatePwd = MD5Util.generatePwd(request.getPassword());
|
||||
if (!generatePwd.equals(user.getUserPwd())) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, "用户名或密码错误!");
|
||||
return response;
|
||||
}
|
||||
|
||||
Date current = new Date();
|
||||
Calendar instance = Calendar.getInstance();
|
||||
instance.setTime(current);
|
||||
instance.add(Calendar.HOUR_OF_DAY, 1);//默认一个小时内有效
|
||||
|
||||
TokensCreateRequest tokensCreateRequest = new TokensCreateRequest();
|
||||
tokensCreateRequest.setToken(UUID.randomUUID().toString());
|
||||
tokensCreateRequest.setUserId(user.getId());
|
||||
tokensCreateRequest.setUserName(user.getUserName());
|
||||
tokensCreateRequest.setLoginTime(current);
|
||||
tokensCreateRequest.setValidTime(instance.getTime());
|
||||
tokensCreateRequest.setValid(true);
|
||||
tokensCreateRequest.setDeptId(user.getDeptId());
|
||||
tokensCreateRequest.setDeptCode(user.getDeptCode());
|
||||
tokensCreateRequest.setDeptName(user.getDeptName());
|
||||
tokensCreateRequest.setTerminalType("WEB");
|
||||
tokensCreateRequest.setTerminalIp(RequestUtil.getIp(httpServletRequest));
|
||||
tokensCreateRequest.setTerminalInfo(RequestUtil.getUserAgent(httpServletRequest));
|
||||
TokensCreateResponse tokensCreateResponse = tokensManager.create(tokensCreateRequest, LocalData.getSysToken());
|
||||
|
||||
if (tokensCreateResponse.hasError()) {
|
||||
response.addErrors(tokensCreateResponse.getErrors());
|
||||
return response;
|
||||
}
|
||||
Cookie cookie = CookieUtil.newCookie("token", tokensCreateRequest.getToken());
|
||||
cookie.setPath("/");
|
||||
httpServletResponse.addCookie(cookie);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package ${basePackage}.action.api.system;
|
||||
|
||||
import ${basePackage}.module.system.req.AuthLoginRequest;
|
||||
import ${basePackage}.module.system.rsp.AuthLoginResponse;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class AuthApi {
|
||||
|
||||
public AuthLoginResponse login(AuthLoginRequest request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
AuthLoginResponse response = new AuthLoginResponse();
|
||||
|
||||
// todo 设置cookie
|
||||
Cookie token = new Cookie("token", "");
|
||||
token.setDomain(httpServletRequest.getServerName());
|
||||
token.setPath("/");
|
||||
httpServletResponse.addCookie(token);
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
@ -0,0 +1,364 @@
|
||||
<?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="${basePackage}.module.${moduleName}.mpr.${table.getCName()}Mapper">
|
||||
|
||||
<#if dataBase == 'Oracle'>
|
||||
<sql id="table">"${module.modulePrefix?default("")}${table.tableName}"</sql>
|
||||
<#elseif dataBase='MySQL'>
|
||||
<sql id="table">`${module.modulePrefix?default("")}${table.tableName}`</sql>
|
||||
<#elseif dataBase='SQLite'>
|
||||
<sql id="table">"${module.modulePrefix?default("")}${table.tableName}"</sql>
|
||||
</#if>
|
||||
|
||||
<sql id="entityColumnList">
|
||||
<#if dataBase == 'Oracle'>
|
||||
<#list table.fields as f>"${f.fieldName}"<#if f_has_next>,</#if></#list>
|
||||
<#elseif dataBase='MySQL'>
|
||||
<#list table.fields as f>`${f.fieldName}`<#if f_has_next>,</#if></#list>
|
||||
<#elseif dataBase='SQLite'>
|
||||
<#list table.fields as f>"${f.fieldName}"<#if f_has_next>,</#if></#list>
|
||||
</#if>
|
||||
</sql>
|
||||
|
||||
<resultMap id="${table.getFName()}" type="${basePackage}.module.${moduleName}.ent.${table.getCName()}">
|
||||
<#list table.fields as f>
|
||||
<result column="${f.fieldName}" jdbcType="${f.fieldType.jdbcType()}" property="${f.getFName()}"/>
|
||||
</#list>
|
||||
</resultMap>
|
||||
|
||||
<select id="find" resultMap="${table.getFName()}">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
<#if dataBase == 'Oracle'>
|
||||
"IS_DELETED" = 0
|
||||
<#elseif dataBase='MySQL'>
|
||||
`IS_DELETED` = 0
|
||||
<#elseif dataBase='SQLite'>
|
||||
"IS_DELETED" = 0
|
||||
</#if>
|
||||
<#list table.fields as f>
|
||||
<#if f.isQuery>
|
||||
<#if dataBase == 'Oracle'>
|
||||
<#if f.fieldType.javaType() == "Boolean">
|
||||
<if test="request.${f.getFName()} != null">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Byte">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Short">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Integer">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Long">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Float">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Double">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Character">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "String">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Date">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND to_char("${f.fieldName}",'yyyy-MM-dd HH24:mi:ss') = to_char(${r"#{"}request.${f.getFName()}},'yyyy-MM-dd HH24:mi:ss')
|
||||
</if>
|
||||
</#if>
|
||||
<#elseif dataBase='MySQL'>
|
||||
<#if f.fieldType.javaType() == "Boolean">
|
||||
<if test="request.${f.getFName()} != null">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Byte">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Short">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Integer">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Long">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Float">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Double">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Character">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "String">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Date">
|
||||
<if test="request.${f.getFName()} != null">
|
||||
AND DATE_FORMAT(`${f.fieldName}`,"%Y-%m-%d %T") = DATE_FORMAT(${r"#{"}request.${f.getFName()}},"%Y-%m-%d %T")
|
||||
</if>
|
||||
</#if>
|
||||
<#elseif dataBase='SQLite'>
|
||||
<#if f.fieldType.javaType() == "Boolean">
|
||||
<if test="request.${f.getFName()} != null">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Byte">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Short">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Integer">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Long">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Float">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Double">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Character">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "String">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Date">
|
||||
<if test="request.${f.getFName()} != null">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</select>
|
||||
|
||||
<select id="search" resultMap="${table.getFName()}">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
<#if dataBase == 'Oracle'>
|
||||
"IS_DELETED" = 0
|
||||
<#elseif dataBase='MySQL'>
|
||||
`IS_DELETED` = 0
|
||||
</#if>
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
1 = 2
|
||||
<#list table.fields as f>
|
||||
<#if f.isSearch>
|
||||
<#if dataBase == 'Oracle'>
|
||||
OR "${f.fieldName}" LIKE CONCAT(CONCAT('%',${r"#{"}request.keyword}),'%')
|
||||
<#elseif dataBase='MySQL'>
|
||||
OR `${f.fieldName}` LIKE CONCAT('%',${r"#{request.keyword}"},'%')
|
||||
</#if>
|
||||
<#elseif dataBase='SQLite'>
|
||||
OR ${f.fieldName} LIKE CONCAT('%',${r"#{request.keyword}"},'%')
|
||||
</#if>
|
||||
</#list>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
${r"#{"}request.id},
|
||||
<#list table.fields as f>
|
||||
<#if !f.isSystem>
|
||||
${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
|
||||
</#if>
|
||||
</#list>
|
||||
0,
|
||||
0,
|
||||
${r"#{"}token.userId,jdbcType=NUMERIC},
|
||||
<#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now','localtime')</#if>,
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item= "item" index ="index" separator=",">
|
||||
(
|
||||
${r"#{"}item.id},
|
||||
<#list table.fields as f>
|
||||
<#if !f.isSystem>
|
||||
${r"#{"}item.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
|
||||
</#if>
|
||||
</#list>
|
||||
0,
|
||||
0,
|
||||
${r"#{"}token.userId,jdbcType=NUMERIC},
|
||||
<#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now','localtime')</#if>,
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</foreach >
|
||||
</insert>
|
||||
|
||||
<update id="delete">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
<#if dataBase == 'Oracle'>
|
||||
SET "IS_DELETED" = 1
|
||||
WHERE "IS_DELETED" = 0
|
||||
AND "ID" = ${r"#{"}request.id}
|
||||
<#elseif dataBase='MySQL'>
|
||||
SET `IS_DELETED` = 1
|
||||
WHERE `IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{"}request.id}
|
||||
</#if>
|
||||
</update>
|
||||
|
||||
<update id="update">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET
|
||||
<#if dataBase == 'Oracle'>
|
||||
<#list table.fields as f>
|
||||
<#if !f.isPrimaryKey>
|
||||
<#if !f.isSystem || f.fieldName == 'ID'>
|
||||
"${f.fieldName}" = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
"ROW_VERSION" = "ROW_VERSION" + 1,
|
||||
"LAST_UPDATE_BY" = ${r"#{"}token.userId},
|
||||
"LAST_UPDATE_TIME" = sysdate
|
||||
<#elseif dataBase='MySQL'>
|
||||
<#list table.fields as f>
|
||||
<#if !f.isPrimaryKey>
|
||||
<#if !f.isSystem || f.fieldName == 'ID'>
|
||||
`${f.fieldName}` = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
`ROW_VERSION` = `ROW_VERSION` + 1,
|
||||
`LAST_UPDATE_BY` = ${r"#{"}token.userId},
|
||||
`LAST_UPDATE_TIME` = sysdate()
|
||||
<#elseif dataBase='SQLite'>
|
||||
<#list table.fields as f>
|
||||
<#if !f.isPrimaryKey>
|
||||
<#if !f.isSystem || f.fieldName == 'ID'>
|
||||
${f.fieldName} = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
ROW_VERSION = ROW_VERSION + 1,
|
||||
LAST_UPDATE_BY = ${r"#{"}token.userId},
|
||||
LAST_UPDATE_TIME = datetime('now','localtime')
|
||||
</#if>
|
||||
WHERE
|
||||
<#if dataBase == 'Oracle'>
|
||||
"IS_DELETED" = 0
|
||||
AND "ID" = ${r"#{"}request.id}
|
||||
AND "ROW_VERSION" = ${r"#{"}request.rowVersion}
|
||||
<#elseif dataBase='MySQL'>
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{"}request.id}
|
||||
AND `ROW_VERSION` = ${r"#{"}request.rowVersion}
|
||||
<#elseif dataBase='SQLite'>
|
||||
IS_DELETED = 0
|
||||
AND ID = ${r"#{"}request.id}
|
||||
AND ROW_VERSION = ${r"#{"}request.rowVersion}
|
||||
</#if>
|
||||
</update>
|
||||
|
||||
<select id="get" resultMap="${table.getFName()}">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
<#if dataBase == 'Oracle'>
|
||||
"IS_DELETED" = 0
|
||||
AND "ID" = ${r"#{request.id}"}
|
||||
<#elseif dataBase='MySQL'>
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{request.id}"}
|
||||
<#elseif dataBase='SQLite'>
|
||||
IS_DELETED = 0
|
||||
AND ID = ${r"#{request.id}"}
|
||||
</#if>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,364 @@
|
||||
<?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="${basePackage}.module.${moduleName}.mpr.${table.getCName()}Mapper">
|
||||
|
||||
<#if dataBase == 'Oracle'>
|
||||
<sql id="table">"${module.modulePrefix?default("")}${table.tableName}"</sql>
|
||||
<#elseif dataBase='MySQL'>
|
||||
<sql id="table">`${module.modulePrefix?default("")}${table.tableName}`</sql>
|
||||
<#elseif dataBase='SQLite'>
|
||||
<sql id="table">"${module.modulePrefix?default("")}${table.tableName}"</sql>
|
||||
</#if>
|
||||
|
||||
<sql id="entityColumnList">
|
||||
<#if dataBase == 'Oracle'>
|
||||
<#list table.fields as f>"${f.fieldName}"<#if f_has_next>,</#if></#list>
|
||||
<#elseif dataBase='MySQL'>
|
||||
<#list table.fields as f>`${f.fieldName}`<#if f_has_next>,</#if></#list>
|
||||
<#elseif dataBase='SQLite'>
|
||||
<#list table.fields as f>"${f.fieldName}"<#if f_has_next>,</#if></#list>
|
||||
</#if>
|
||||
</sql>
|
||||
|
||||
<resultMap id="${table.getFName()}" type="${basePackage}.module.${moduleName}.ent.${table.getCName()}">
|
||||
<#list table.fields as f>
|
||||
<result column="${f.fieldName}" jdbcType="${f.fieldType.jdbcType()}" property="${f.getFName()}"/>
|
||||
</#list>
|
||||
</resultMap>
|
||||
|
||||
<select id="find" resultMap="${table.getFName()}">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
<#if dataBase == 'Oracle'>
|
||||
"IS_DELETED" = 0
|
||||
<#elseif dataBase='MySQL'>
|
||||
`IS_DELETED` = 0
|
||||
<#elseif dataBase='SQLite'>
|
||||
"IS_DELETED" = 0
|
||||
</#if>
|
||||
<#list table.fields as f>
|
||||
<#if f.isQuery>
|
||||
<#if dataBase == 'Oracle'>
|
||||
<#if f.fieldType.javaType() == "Boolean">
|
||||
<if test="request.${f.getFName()} != null">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Byte">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Short">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Integer">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Long">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Float">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Double">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Character">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "String">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Date">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND to_char("${f.fieldName}",'yyyy-MM-dd HH24:mi:ss') = to_char(${r"#{"}request.${f.getFName()}},'yyyy-MM-dd HH24:mi:ss')
|
||||
</if>
|
||||
</#if>
|
||||
<#elseif dataBase='MySQL'>
|
||||
<#if f.fieldType.javaType() == "Boolean">
|
||||
<if test="request.${f.getFName()} != null">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Byte">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Short">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Integer">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Long">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Float">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Double">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Character">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "String">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Date">
|
||||
<if test="request.${f.getFName()} != null">
|
||||
AND DATE_FORMAT(`${f.fieldName}`,"%Y-%m-%d %T") = DATE_FORMAT(${r"#{"}request.${f.getFName()}},"%Y-%m-%d %T")
|
||||
</if>
|
||||
</#if>
|
||||
<#elseif dataBase='SQLite'>
|
||||
<#if f.fieldType.javaType() == "Boolean">
|
||||
<if test="request.${f.getFName()} != null">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Byte">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Short">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Integer">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Long">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Float">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Double">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Character">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "String">
|
||||
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
<#if f.fieldType.javaType() == "Date">
|
||||
<if test="request.${f.getFName()} != null">
|
||||
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
|
||||
</if>
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</select>
|
||||
|
||||
<select id="search" resultMap="${table.getFName()}">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
<#if dataBase == 'Oracle'>
|
||||
"IS_DELETED" = 0
|
||||
<#elseif dataBase='MySQL'>
|
||||
`IS_DELETED` = 0
|
||||
</#if>
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
1 = 2
|
||||
<#list table.fields as f>
|
||||
<#if f.isSearch>
|
||||
<#if dataBase == 'Oracle'>
|
||||
OR "${f.fieldName}" LIKE CONCAT(CONCAT('%',${r"#{"}request.keyword}),'%')
|
||||
<#elseif dataBase='MySQL'>
|
||||
OR `${f.fieldName}` LIKE CONCAT('%',${r"#{request.keyword}"},'%')
|
||||
</#if>
|
||||
<#elseif dataBase='SQLite'>
|
||||
OR ${f.fieldName} LIKE CONCAT('%',${r"#{request.keyword}"},'%')
|
||||
</#if>
|
||||
</#list>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
${r"#{"}request.id},
|
||||
<#list table.fields as f>
|
||||
<#if !f.isSystem>
|
||||
${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
|
||||
</#if>
|
||||
</#list>
|
||||
0,
|
||||
0,
|
||||
${r"#{"}token.userId,jdbcType=NUMERIC},
|
||||
<#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now','localtime')</#if>,
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item= "item" index ="index" separator=",">
|
||||
(
|
||||
${r"#{"}item.id},
|
||||
<#list table.fields as f>
|
||||
<#if !f.isSystem>
|
||||
${r"#{"}item.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
|
||||
</#if>
|
||||
</#list>
|
||||
0,
|
||||
0,
|
||||
${r"#{"}token.userId,jdbcType=NUMERIC},
|
||||
<#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now','localtime')</#if>,
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</foreach >
|
||||
</insert>
|
||||
|
||||
<update id="delete">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
<#if dataBase == 'Oracle'>
|
||||
SET "IS_DELETED" = 1
|
||||
WHERE "IS_DELETED" = 0
|
||||
AND "ID" = ${r"#{"}request.id}
|
||||
<#elseif dataBase='MySQL'>
|
||||
SET `IS_DELETED` = 1
|
||||
WHERE `IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{"}request.id}
|
||||
</#if>
|
||||
</update>
|
||||
|
||||
<update id="update">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET
|
||||
<#if dataBase == 'Oracle'>
|
||||
<#list table.fields as f>
|
||||
<#if !f.isPrimaryKey>
|
||||
<#if !f.isSystem || f.fieldName == 'ID'>
|
||||
"${f.fieldName}" = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
"ROW_VERSION" = "ROW_VERSION" + 1,
|
||||
"LAST_UPDATE_BY" = ${r"#{"}token.userId},
|
||||
"LAST_UPDATE_TIME" = sysdate
|
||||
<#elseif dataBase='MySQL'>
|
||||
<#list table.fields as f>
|
||||
<#if !f.isPrimaryKey>
|
||||
<#if !f.isSystem || f.fieldName == 'ID'>
|
||||
`${f.fieldName}` = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
`ROW_VERSION` = `ROW_VERSION` + 1,
|
||||
`LAST_UPDATE_BY` = ${r"#{"}token.userId},
|
||||
`LAST_UPDATE_TIME` = sysdate()
|
||||
<#elseif dataBase='SQLite'>
|
||||
<#list table.fields as f>
|
||||
<#if !f.isPrimaryKey>
|
||||
<#if !f.isSystem || f.fieldName == 'ID'>
|
||||
${f.fieldName} = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
ROW_VERSION = ROW_VERSION + 1,
|
||||
LAST_UPDATE_BY = ${r"#{"}token.userId},
|
||||
LAST_UPDATE_TIME = datetime('now','localtime')
|
||||
</#if>
|
||||
WHERE
|
||||
<#if dataBase == 'Oracle'>
|
||||
"IS_DELETED" = 0
|
||||
AND "ID" = ${r"#{"}request.id}
|
||||
AND "ROW_VERSION" = ${r"#{"}request.rowVersion}
|
||||
<#elseif dataBase='MySQL'>
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{"}request.id}
|
||||
AND `ROW_VERSION` = ${r"#{"}request.rowVersion}
|
||||
<#elseif dataBase='SQLite'>
|
||||
IS_DELETED = 0
|
||||
AND ID = ${r"#{"}request.id}
|
||||
AND ROW_VERSION = ${r"#{"}request.rowVersion}
|
||||
</#if>
|
||||
</update>
|
||||
|
||||
<select id="get" resultMap="${table.getFName()}">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
<#if dataBase == 'Oracle'>
|
||||
"IS_DELETED" = 0
|
||||
AND "ID" = ${r"#{request.id}"}
|
||||
<#elseif dataBase='MySQL'>
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{request.id}"}
|
||||
<#elseif dataBase='SQLite'>
|
||||
IS_DELETED = 0
|
||||
AND ID = ${r"#{request.id}"}
|
||||
</#if>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,102 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* DeptCreateRequest - 部门新增
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class DeptCreateRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 部门代码
|
||||
*/
|
||||
@NotEmpty(message = "[deptCode]部门代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[deptCode]部门代码长度不合法(0-50)")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotEmpty(message = "[deptName]部门名称不能为空")
|
||||
@Length(min = 0, max = 100, message = "[deptName]部门名称长度不合法(0-100)")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 部门别名
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "[deptAlias]部门别名长度不合法(0-50)")
|
||||
private String deptAlias;
|
||||
|
||||
/**
|
||||
* 父部门代码
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "[supCode]父部门代码长度不合法(0-50)")
|
||||
private String supCode;
|
||||
|
||||
/**
|
||||
* 父部门名称
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "[supName]父部门名称长度不合法(0-100)")
|
||||
private String supName;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
@NotNull(message = "[valid]是否有效不能为NULL")
|
||||
private Boolean valid;
|
||||
|
||||
public String getDeptCode() {
|
||||
return this.deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return this.deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getDeptAlias() {
|
||||
return this.deptAlias;
|
||||
}
|
||||
|
||||
public void setDeptAlias(String deptAlias) {
|
||||
this.deptAlias = deptAlias;
|
||||
}
|
||||
|
||||
public String getSupCode() {
|
||||
return this.supCode;
|
||||
}
|
||||
|
||||
public void setSupCode(String supCode) {
|
||||
this.supCode = supCode;
|
||||
}
|
||||
|
||||
public String getSupName() {
|
||||
return this.supName;
|
||||
}
|
||||
|
||||
public void setSupName(String supName) {
|
||||
this.supName = supName;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DeptDeleteRequest - 部门删除
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class DeptDeleteRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindRequest;
|
||||
|
||||
/**
|
||||
* DeptRequest - 部门查询
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class DeptFindRequest extends BaseFindRequest {
|
||||
|
||||
/**
|
||||
* 部门代码
|
||||
*/
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 部门别名
|
||||
*/
|
||||
private String deptAlias;
|
||||
|
||||
/**
|
||||
* 父部门代码
|
||||
*/
|
||||
private String supCode;
|
||||
|
||||
/**
|
||||
* 父部门名称
|
||||
*/
|
||||
private String supName;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean valid;
|
||||
|
||||
public String getDeptCode() {
|
||||
return this.deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return this.deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getDeptAlias() {
|
||||
return this.deptAlias;
|
||||
}
|
||||
|
||||
public void setDeptAlias(String deptAlias) {
|
||||
this.deptAlias = deptAlias;
|
||||
}
|
||||
|
||||
public String getSupCode() {
|
||||
return this.supCode;
|
||||
}
|
||||
|
||||
public void setSupCode(String supCode) {
|
||||
this.supCode = supCode;
|
||||
}
|
||||
|
||||
public String getSupName() {
|
||||
return this.supName;
|
||||
}
|
||||
|
||||
public void setSupName(String supName) {
|
||||
this.supName = supName;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DeptGetRequest - 部门获取
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class DeptGetRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* DeptUpdateRequest - 部门更新
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class DeptUpdateRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为NULL")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门代码
|
||||
*/
|
||||
@NotEmpty(message = "[deptCode]部门代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[deptCode]部门代码长度不合法(0-50)")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotEmpty(message = "[deptName]部门名称不能为空")
|
||||
@Length(min = 0, max = 100, message = "[deptName]部门名称长度不合法(0-100)")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 部门别名
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "[deptAlias]部门别名长度不合法(0-50)")
|
||||
private String deptAlias;
|
||||
|
||||
/**
|
||||
* 父部门代码
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "[supCode]父部门代码长度不合法(0-50)")
|
||||
private String supCode;
|
||||
|
||||
/**
|
||||
* 父部门名称
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "[supName]父部门名称长度不合法(0-100)")
|
||||
private String supName;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
@NotNull(message = "[valid]是否有效不能为NULL")
|
||||
private Boolean valid;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDeptCode() {
|
||||
return this.deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return this.deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getDeptAlias() {
|
||||
return this.deptAlias;
|
||||
}
|
||||
|
||||
public void setDeptAlias(String deptAlias) {
|
||||
this.deptAlias = deptAlias;
|
||||
}
|
||||
|
||||
public String getSupCode() {
|
||||
return this.supCode;
|
||||
}
|
||||
|
||||
public void setSupCode(String supCode) {
|
||||
this.supCode = supCode;
|
||||
}
|
||||
|
||||
public String getSupName() {
|
||||
return this.supName;
|
||||
}
|
||||
|
||||
public void setSupName(String supName) {
|
||||
this.supName = supName;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* RoleResourceCreateRequest - 角色资源关系新增
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class RoleResourceCreateRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 角色主键
|
||||
*/
|
||||
@NotNull(message = "[roleId]角色主键不能为NULL")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 资源主键
|
||||
*/
|
||||
@NotNull(message = "[resourceId]资源主键不能为NULL")
|
||||
private Long resourceId;
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public Long getResourceId() {
|
||||
return this.resourceId;
|
||||
}
|
||||
|
||||
public void setResourceId(Long resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* RoleResourceDeleteRequest - 角色资源关系删除
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class RoleResourceDeleteRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindRequest;
|
||||
|
||||
/**
|
||||
* RoleResourceRequest - 角色资源关系查询
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class RoleResourceFindRequest extends BaseFindRequest {
|
||||
|
||||
/**
|
||||
* 角色主键
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 资源主键
|
||||
*/
|
||||
private Long resourceId;
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public Long getResourceId() {
|
||||
return this.resourceId;
|
||||
}
|
||||
|
||||
public void setResourceId(Long resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* RoleResourceGetRequest - 角色资源关系获取
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class RoleResourceGetRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* RoleResourceUpdateRequest - 角色资源关系更新
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class RoleResourceUpdateRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为NULL")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色主键
|
||||
*/
|
||||
@NotNull(message = "[roleId]角色主键不能为NULL")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 资源主键
|
||||
*/
|
||||
@NotNull(message = "[resourceId]资源主键不能为NULL")
|
||||
private Long resourceId;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public Long getResourceId() {
|
||||
return this.resourceId;
|
||||
}
|
||||
|
||||
public void setResourceId(Long resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* UserCreateRequest - 用户新增
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class UserCreateRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 用户账户
|
||||
*/
|
||||
@NotEmpty(message = "[userName]用户账户不能为空")
|
||||
@Length(min = 0, max = 100, message = "[userName]用户账户长度不合法(0-100)")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户代码
|
||||
*/
|
||||
@NotEmpty(message = "[userCode]用户代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[userCode]用户代码长度不合法(0-50)")
|
||||
private String userCode;
|
||||
|
||||
/**
|
||||
* 用户别名
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "[userAlias]用户别名长度不合法(0-50)")
|
||||
private String userAlias;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
@NotEmpty(message = "[userPwd]用户密码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[userPwd]用户密码长度不合法(0-50)")
|
||||
private String userPwd;
|
||||
|
||||
/**
|
||||
* 用户状态
|
||||
*/
|
||||
@NotNull(message = "[userStatus]用户状态不能为NULL")
|
||||
@Dict(name = "USER_STATUS")
|
||||
private String userStatus;
|
||||
|
||||
/**
|
||||
* 部门主键
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门代码
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "[deptCode]部门代码长度不合法(0-50)")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "[deptName]部门名称长度不合法(0-100)")
|
||||
private String deptName;
|
||||
|
||||
public String getUserName() {
|
||||
return this.userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserCode() {
|
||||
return this.userCode;
|
||||
}
|
||||
|
||||
public void setUserCode(String userCode) {
|
||||
this.userCode = userCode;
|
||||
}
|
||||
|
||||
public String getUserAlias() {
|
||||
return this.userAlias;
|
||||
}
|
||||
|
||||
public void setUserAlias(String userAlias) {
|
||||
this.userAlias = userAlias;
|
||||
}
|
||||
|
||||
public String getUserPwd() {
|
||||
return this.userPwd;
|
||||
}
|
||||
|
||||
public void setUserPwd(String userPwd) {
|
||||
this.userPwd = userPwd;
|
||||
}
|
||||
|
||||
public String getUserStatus() {
|
||||
return this.userStatus;
|
||||
}
|
||||
|
||||
public void setUserStatus(String userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return this.deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptCode() {
|
||||
return this.deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return this.deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* UserDeleteRequest - 用户删除
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class UserDeleteRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindRequest;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* UserRequest - 用户查询
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class UserFindRequest extends BaseFindRequest {
|
||||
|
||||
/**
|
||||
* 用户账户
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户代码
|
||||
*/
|
||||
private String userCode;
|
||||
|
||||
/**
|
||||
* 用户别名
|
||||
*/
|
||||
private String userAlias;
|
||||
|
||||
/**
|
||||
* 用户状态
|
||||
*/
|
||||
@Dict(name = "USER_STATUS")
|
||||
private String userStatus;
|
||||
|
||||
/**
|
||||
* 部门主键
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门代码
|
||||
*/
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
public String getUserName() {
|
||||
return this.userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserCode() {
|
||||
return this.userCode;
|
||||
}
|
||||
|
||||
public void setUserCode(String userCode) {
|
||||
this.userCode = userCode;
|
||||
}
|
||||
|
||||
public String getUserAlias() {
|
||||
return this.userAlias;
|
||||
}
|
||||
|
||||
public void setUserAlias(String userAlias) {
|
||||
this.userAlias = userAlias;
|
||||
}
|
||||
|
||||
public String getUserStatus() {
|
||||
return this.userStatus;
|
||||
}
|
||||
|
||||
public void setUserStatus(String userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return this.deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptCode() {
|
||||
return this.deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return this.deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* UserGetRequest - 用户获取
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class UserGetRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* UserRoleCreateRequest - 用户角色授权新增
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class UserRoleCreateRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 用户主键
|
||||
*/
|
||||
@NotNull(message = "[userId]用户主键不能为NULL")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色主键
|
||||
*/
|
||||
@NotNull(message = "[roleId]角色主键不能为NULL")
|
||||
private Long roleId;
|
||||
|
||||
public Long getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* UserRoleDeleteRequest - 用户角色授权删除
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class UserRoleDeleteRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindRequest;
|
||||
|
||||
/**
|
||||
* UserRoleRequest - 用户角色授权查询
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class UserRoleFindRequest extends BaseFindRequest {
|
||||
|
||||
/**
|
||||
* 用户主键
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色主键
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
public Long getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* UserRoleGetRequest - 用户角色授权获取
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class UserRoleGetRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* UserRoleUpdateRequest - 用户角色授权更新
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class UserRoleUpdateRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为NULL")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户主键
|
||||
*/
|
||||
@NotNull(message = "[userId]用户主键不能为NULL")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 角色主键
|
||||
*/
|
||||
@NotNull(message = "[roleId]角色主键不能为NULL")
|
||||
private Long roleId;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* UserUpdateRequest - 用户更新
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class UserUpdateRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为NULL")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户账户
|
||||
*/
|
||||
@NotEmpty(message = "[userName]用户账户不能为空")
|
||||
@Length(min = 0, max = 100, message = "[userName]用户账户长度不合法(0-100)")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户代码
|
||||
*/
|
||||
@NotEmpty(message = "[userCode]用户代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[userCode]用户代码长度不合法(0-50)")
|
||||
private String userCode;
|
||||
|
||||
/**
|
||||
* 用户别名
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "[userAlias]用户别名长度不合法(0-50)")
|
||||
private String userAlias;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
@NotEmpty(message = "[userPwd]用户密码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[userPwd]用户密码长度不合法(0-50)")
|
||||
private String userPwd;
|
||||
|
||||
/**
|
||||
* 用户状态
|
||||
*/
|
||||
@NotNull(message = "[userStatus]用户状态不能为NULL")
|
||||
@Dict(name = "USER_STATUS")
|
||||
private String userStatus;
|
||||
|
||||
/**
|
||||
* 部门主键
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门代码
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "[deptCode]部门代码长度不合法(0-50)")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "[deptName]部门名称长度不合法(0-100)")
|
||||
private String deptName;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return this.userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserCode() {
|
||||
return this.userCode;
|
||||
}
|
||||
|
||||
public void setUserCode(String userCode) {
|
||||
this.userCode = userCode;
|
||||
}
|
||||
|
||||
public String getUserAlias() {
|
||||
return this.userAlias;
|
||||
}
|
||||
|
||||
public void setUserAlias(String userAlias) {
|
||||
this.userAlias = userAlias;
|
||||
}
|
||||
|
||||
public String getUserPwd() {
|
||||
return this.userPwd;
|
||||
}
|
||||
|
||||
public void setUserPwd(String userPwd) {
|
||||
this.userPwd = userPwd;
|
||||
}
|
||||
|
||||
public String getUserStatus() {
|
||||
return this.userStatus;
|
||||
}
|
||||
|
||||
public void setUserStatus(String userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return this.deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptCode() {
|
||||
return this.deptCode;
|
||||
}
|
||||
|
||||
public void setDeptCode(String deptCode) {
|
||||
this.deptCode = deptCode;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return this.deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* DeptCreateResponse - 部门
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class DeptCreateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* DeptDeleteResponse - 部门
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class DeptDeleteResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 删除数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindResponse;
|
||||
import ${basePackage}.module.system.ent.Dept;
|
||||
|
||||
/**
|
||||
* DeptFindResponse - 部门
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class DeptFindResponse extends BaseFindResponse<Dept> {
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.module.system.ent.Dept;
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* DeptGetResponse - 部门
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class DeptGetResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private Dept dept;
|
||||
|
||||
public Dept getDept() {
|
||||
return this.dept;
|
||||
}
|
||||
|
||||
public void setDept(Dept dept) {
|
||||
this.dept = dept;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* DeptUpdateResponse - 部门
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class DeptUpdateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 更新数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue