parent
cf8d1fa9b5
commit
aa7fd9af4c
@ -0,0 +1,44 @@
|
||||
package ${basePackage}.action.ajax.system;
|
||||
|
||||
import ${basePackage}.frame.auth.LocalData;
|
||||
import ${basePackage}.frame.utils.MapperUtil;
|
||||
import ${basePackage}.module.system.mgr.DictManager;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
public class DictAjax {
|
||||
|
||||
@Autowired
|
||||
private DictManager dictManager;
|
||||
|
||||
public DictCreateResponse create(String jsonParam) {
|
||||
DictCreateRequest request = MapperUtil.toJava(jsonParam, DictCreateRequest.class);
|
||||
return dictManager.create(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public DictDeleteResponse delete(String jsonParam) {
|
||||
DictDeleteRequest request = MapperUtil.toJava(jsonParam, DictDeleteRequest.class);
|
||||
return dictManager.delete(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public DictUpdateResponse update(String jsonParam) {
|
||||
DictUpdateRequest request = MapperUtil.toJava(jsonParam, DictUpdateRequest.class);
|
||||
return dictManager.update(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public DictFindResponse find(String jsonParam) {
|
||||
DictFindRequest request = MapperUtil.toJava(jsonParam, DictFindRequest.class);
|
||||
return dictManager.find(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public DictGetResponse get(String jsonParam) {
|
||||
DictGetRequest request = MapperUtil.toJava(jsonParam, DictGetRequest.class);
|
||||
return dictManager.get(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public DictLoadResponse load(String jsonParam) {
|
||||
DictLoadRequest request = MapperUtil.toJava(jsonParam, DictLoadRequest.class);
|
||||
return dictManager.load(request, LocalData.getToken());
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package ${basePackage}.action.ajax.system;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import ${basePackage}.frame.auth.LocalData;
|
||||
import ${basePackage}.frame.utils.MapperUtil;
|
||||
import ${basePackage}.module.system.mgr.DictItemManager;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
public class DictItemAjax {
|
||||
|
||||
@Autowired
|
||||
private DictItemManager dictManager;
|
||||
|
||||
public DictItemCreateResponse create(String jsonParam) {
|
||||
DictItemCreateRequest request = MapperUtil.toJava(jsonParam, DictItemCreateRequest.class);
|
||||
return dictManager.create(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public DictItemDeleteResponse delete(String jsonParam) {
|
||||
DictItemDeleteRequest request = MapperUtil.toJava(jsonParam, DictItemDeleteRequest.class);
|
||||
return dictManager.delete(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public DictItemUpdateResponse update(String jsonParam) {
|
||||
DictItemUpdateRequest request = MapperUtil.toJava(jsonParam, DictItemUpdateRequest.class);
|
||||
return dictManager.update(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public DictItemFindResponse find(String jsonParam) {
|
||||
DictItemFindRequest request = MapperUtil.toJava(jsonParam, DictItemFindRequest.class);
|
||||
return dictManager.find(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public DictItemGetResponse get(String jsonParam) {
|
||||
DictItemGetRequest request = MapperUtil.toJava(jsonParam, DictItemGetRequest.class);
|
||||
return dictManager.get(request, LocalData.getToken());
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package ${basePackage}.module.system.ent;
|
||||
|
||||
import ${basePackage}.frame.base.BaseEntity;
|
||||
|
||||
/**
|
||||
* DICT - 字典
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class Dict extends BaseEntity {
|
||||
|
||||
/**
|
||||
* ID - 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* DICT_NAME - 字典名称
|
||||
*/
|
||||
private String dictName;
|
||||
/**
|
||||
* DICT_CODE - 字典代码
|
||||
*/
|
||||
private String dictCode;
|
||||
/**
|
||||
* VERSION - 字典版本号
|
||||
*/
|
||||
private String version;
|
||||
/**
|
||||
* VALID - 是否有效
|
||||
*/
|
||||
private Boolean valid;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDictName() {
|
||||
return this.dictName;
|
||||
}
|
||||
|
||||
public void setDictName(String dictName) {
|
||||
this.dictName = dictName;
|
||||
}
|
||||
|
||||
public String getDictCode() {
|
||||
return this.dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(String dictCode) {
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package ${basePackage}.module.system.ent;
|
||||
|
||||
import ${basePackage}.frame.base.BaseEntity;
|
||||
|
||||
/**
|
||||
* DICT_ITEM - 字典项
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItem extends BaseEntity {
|
||||
|
||||
/**
|
||||
* ID - 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* DICT_ID - 字典ID
|
||||
*/
|
||||
private Long dictId;
|
||||
/**
|
||||
* KEY - 字典KEY
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* VALUE - 字典VALUE
|
||||
*/
|
||||
private String value;
|
||||
/**
|
||||
* SORT - 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* VALID - 是否有效
|
||||
*/
|
||||
private Boolean valid;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getDictId() {
|
||||
return this.dictId;
|
||||
}
|
||||
|
||||
public void setDictId(Long dictId) {
|
||||
this.dictId = dictId;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return this.sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
/**
|
||||
* 字典项
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public interface DictItemManager {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictItemCreateResponse create(DictItemCreateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictItemDeleteResponse delete(DictItemDeleteRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictItemUpdateResponse update(DictItemUpdateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictItemFindResponse find(DictItemFindRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictItemGetResponse get(DictItemGetRequest request, Token token);
|
||||
}
|
@ -0,0 +1,167 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ${basePackage}.frame.base.ErrorType;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.frame.utils.IDgenerator;
|
||||
import ${basePackage}.frame.utils.MapperUtil;
|
||||
import ${basePackage}.frame.utils.Message;
|
||||
import ${basePackage}.frame.utils.ValidationUtil;
|
||||
import ${basePackage}.module.system.ent.DictItem;
|
||||
import ${basePackage}.module.system.mpr.DictItemMapper;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
/**
|
||||
* DICT_ITEM - 字典项
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
@Transactional
|
||||
@Service
|
||||
public class DictItemManagerImpl implements DictItemManager {
|
||||
|
||||
@Autowired
|
||||
private DictItemMapper dictItemMapper;
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public DictItemCreateResponse create(DictItemCreateRequest request, Token token) {
|
||||
DictItemCreateResponse response = new DictItemCreateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long id = IDgenerator.nextId();
|
||||
DictItem entity = MapperUtil.map(request, DictItem.class);
|
||||
entity.setId(id);
|
||||
|
||||
long result = dictItemMapper.insert(entity, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.CREATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setId(id);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public DictItemDeleteResponse delete(DictItemDeleteRequest request, Token token) {
|
||||
DictItemDeleteResponse response = new DictItemDeleteResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = dictItemMapper.delete(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.DELETE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public DictItemUpdateResponse update(DictItemUpdateRequest request, Token token) {
|
||||
DictItemUpdateResponse response = new DictItemUpdateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = dictItemMapper.update(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.UPDATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public DictItemFindResponse find(DictItemFindRequest request, Token token) {
|
||||
DictItemFindResponse response = new DictItemFindResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
|
||||
if (StringUtil.isNotEmpty(request.getSortKey())) {
|
||||
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
|
||||
}
|
||||
PageInfo<DictItem> pageInfo = new PageInfo<>(dictItemMapper.find(request, token));
|
||||
|
||||
response.setResult(pageInfo.getList());
|
||||
response.setTotalCount(pageInfo.getTotal());
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public DictItemGetResponse get(DictItemGetRequest request, Token token) {
|
||||
DictItemGetResponse response = new DictItemGetResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
DictItem po = dictItemMapper.get(request, token);
|
||||
|
||||
if (po != null) {
|
||||
response.setDictItem(po);
|
||||
} else {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.GET_FAILURE);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
/**
|
||||
* 字典
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public interface DictManager {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictCreateResponse create(DictCreateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictDeleteResponse delete(DictDeleteRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictUpdateResponse update(DictUpdateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictFindResponse find(DictFindRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictGetResponse get(DictGetRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 加载字典
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
DictLoadResponse load(DictLoadRequest request, Token token);
|
||||
}
|
@ -0,0 +1,205 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ${basePackage}.frame.base.ErrorType;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.frame.utils.IDgenerator;
|
||||
import ${basePackage}.frame.utils.MapperUtil;
|
||||
import ${basePackage}.frame.utils.Message;
|
||||
import ${basePackage}.frame.utils.ValidationUtil;
|
||||
import ${basePackage}.module.system.ent.Dict;
|
||||
import ${basePackage}.module.system.mpr.DictMapper;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DICT - 字典
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
@Transactional
|
||||
@Service
|
||||
public class DictManagerImpl implements DictManager {
|
||||
|
||||
@Autowired
|
||||
private DictMapper dictMapper;
|
||||
|
||||
@Autowired
|
||||
private DictItemManager dictItemManager;
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public DictCreateResponse create(DictCreateRequest request, Token token) {
|
||||
DictCreateResponse response = new DictCreateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long id = IDgenerator.nextId();
|
||||
Dict entity = MapperUtil.map(request, Dict.class);
|
||||
entity.setId(id);
|
||||
|
||||
long result = dictMapper.insert(entity, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.CREATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setId(id);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public DictDeleteResponse delete(DictDeleteRequest request, Token token) {
|
||||
DictDeleteResponse response = new DictDeleteResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = dictMapper.delete(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.DELETE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public DictUpdateResponse update(DictUpdateRequest request, Token token) {
|
||||
DictUpdateResponse response = new DictUpdateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = dictMapper.update(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.UPDATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public DictFindResponse find(DictFindRequest request, Token token) {
|
||||
DictFindResponse response = new DictFindResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
|
||||
if (StringUtil.isNotEmpty(request.getSortKey())) {
|
||||
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
|
||||
}
|
||||
PageInfo<Dict> pageInfo = new PageInfo<>(dictMapper.find(request, token));
|
||||
|
||||
response.setResult(pageInfo.getList());
|
||||
response.setTotalCount(pageInfo.getTotal());
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public DictGetResponse get(DictGetRequest request, Token token) {
|
||||
DictGetResponse response = new DictGetResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
Dict po = dictMapper.get(request, token);
|
||||
|
||||
if (po != null) {
|
||||
response.setDict(po);
|
||||
} else {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.GET_FAILURE);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictLoadResponse load(DictLoadRequest request, Token token) {
|
||||
DictLoadResponse response = new DictLoadResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
DictFindRequest dictFindRequest = new DictFindRequest();
|
||||
dictFindRequest.setDictCode(request.getDictCode());
|
||||
dictFindRequest.setValid(true);
|
||||
List<Dict> dicts = dictMapper.find(dictFindRequest, token);
|
||||
if (dicts.size() == 0) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, "字典不存在");
|
||||
return response;
|
||||
} else if (dicts.size() > 1) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, "字典库异常");
|
||||
return response;
|
||||
}
|
||||
|
||||
response.setDict(dicts.get(0));
|
||||
DictItemFindRequest dictItemFindRequest = new DictItemFindRequest();
|
||||
dictItemFindRequest.setDictId(response.getDict().getId());
|
||||
DictItemFindResponse dictItemFindResponse = dictItemManager.find(dictItemFindRequest, token);
|
||||
if (dictItemFindResponse.hasError()) {
|
||||
response.addErrors(dictItemFindResponse.getErrors());
|
||||
return response;
|
||||
}
|
||||
response.setDictItems(dictItemFindResponse.getResult());
|
||||
return response;
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package ${basePackage}.module.system.mpr;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.ent.DictItem;
|
||||
import ${basePackage}.module.system.req.DictItemDeleteRequest;
|
||||
import ${basePackage}.module.system.req.DictItemFindRequest;
|
||||
import ${basePackage}.module.system.req.DictItemGetRequest;
|
||||
import ${basePackage}.module.system.req.DictItemUpdateRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DICT_ITEM - 字典项
|
||||
*
|
||||
* @author wangbing
|
||||
* @date 2019-07-20
|
||||
*/
|
||||
@Mapper
|
||||
public interface DictItemMapper {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long insert(@Param("request") DictItem request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long delete(@Param("request") DictItemDeleteRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long update(@Param("request") DictItemUpdateRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
List<DictItem> find(@Param("request") DictItemFindRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
DictItem get(@Param("request") DictItemGetRequest request, @Param("token") Token token);
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
<?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.system.mpr.DictItemMapper">
|
||||
|
||||
|
||||
<sql id="table">`SYS_DICT_ITEM`</sql>
|
||||
|
||||
<sql id="entityColumnList">
|
||||
`ID`,`DICT_ID`,`KEY`,`VALUE`,`SORT`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME`
|
||||
</sql>
|
||||
|
||||
<resultMap id="dictItem" type="${basePackage}.module.system.ent.DictItem">
|
||||
<result column="ID" jdbcType="BIGINT" property="id"/>
|
||||
<result column="DICT_ID" jdbcType="BIGINT" property="dictId"/>
|
||||
<result column="KEY" jdbcType="CHAR" property="key"/>
|
||||
<result column="VALUE" jdbcType="VARCHAR" property="value"/>
|
||||
<result column="SORT" jdbcType="INTEGER" property="sort"/>
|
||||
<result column="VALID" jdbcType="BIT" property="valid"/>
|
||||
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
|
||||
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
|
||||
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
|
||||
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="LAST_UPDATE_BY" jdbcType="BIGINT" property="lastUpdateBy"/>
|
||||
<result column="LAST_UPDATE_TIME" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="find" resultMap="dictItem">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.id != null and request.id != ''">
|
||||
AND `ID` = ${r"#{"}request.id}
|
||||
</if>
|
||||
<if test="request.dictId != null and request.dictId != ''">
|
||||
AND `DICT_ID` = ${r"#{"}request.dictId}
|
||||
</if>
|
||||
<if test="request.key != null and request.key != ''">
|
||||
AND `KEY` = ${r"#{"}request.key}
|
||||
</if>
|
||||
<if test="request.value != null and request.value != ''">
|
||||
AND `VALUE` = ${r"#{"}request.value}
|
||||
</if>
|
||||
<if test="request.valid != null">
|
||||
AND `VALID` = ${r"#{"}request.valid}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="search" resultMap="dictItem">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
1 = 2
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
${r"#{"}request.id},
|
||||
${r"#{"}request.dictId,jdbcType=BIGINT},
|
||||
${r"#{"}request.key,jdbcType=CHAR},
|
||||
${r"#{"}request.value,jdbcType=VARCHAR},
|
||||
${r"#{"}request.sort,jdbcType=INTEGER},
|
||||
${r"#{"}request.valid,jdbcType=BIT},
|
||||
0,
|
||||
0,
|
||||
${r"#{"}token.userId,jdbcType=NUMERIC},
|
||||
sysdate(),
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="delete">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET `IS_DELETED` = 1
|
||||
WHERE `IS_DELETED` = 0
|
||||
AND `ID` = ${r"#"}{request.id}
|
||||
</update>
|
||||
|
||||
<update id="update">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET
|
||||
`DICT_ID` = ${r"#{"}request.dictId,jdbcType=BIGINT},
|
||||
`KEY` = ${r"#{"}request.key,jdbcType=CHAR},
|
||||
`VALUE` = ${r"#{"}request.value,jdbcType=VARCHAR},
|
||||
`SORT` = ${r"#{"}request.sort,jdbcType=INTEGER},
|
||||
`VALID` = ${r"#{"}request.valid,jdbcType=BIT},
|
||||
`ROW_VERSION` = `ROW_VERSION` + 1,
|
||||
`LAST_UPDATE_BY` = ${r"#{"}token.userId},
|
||||
`LAST_UPDATE_TIME` = sysdate()
|
||||
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{"}request.id}
|
||||
AND `ROW_VERSION` = ${r"#{"}request.rowVersion}
|
||||
</update>
|
||||
|
||||
<select id="getAll" resultMap="dictItem">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
</select>
|
||||
|
||||
<select id="get" resultMap="dictItem">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{"}request.id}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,63 @@
|
||||
package ${basePackage}.module.system.mpr;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.ent.Dict;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DICT - 字典
|
||||
*
|
||||
* @author wangbing
|
||||
* @date 2019-07-20
|
||||
*/
|
||||
@Mapper
|
||||
public interface DictMapper {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long insert(@Param("request") Dict request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long delete(@Param("request") DictDeleteRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long update(@Param("request") DictUpdateRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
List<Dict> find(@Param("request") DictFindRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
Dict get(@Param("request") DictGetRequest request, @Param("token") Token token);
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
<?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.system.mpr.DictMapper">
|
||||
|
||||
|
||||
<sql id="table">`SYS_DICT`</sql>
|
||||
|
||||
<sql id="entityColumnList">
|
||||
`ID`,`DICT_NAME`,`DICT_CODE`,`VERSION`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME`
|
||||
</sql>
|
||||
|
||||
<resultMap id="dict" type="${basePackage}.module.system.ent.Dict">
|
||||
<result column="ID" jdbcType="BIGINT" property="id"/>
|
||||
<result column="DICT_NAME" jdbcType="VARCHAR" property="dictName"/>
|
||||
<result column="DICT_CODE" jdbcType="VARCHAR" property="dictCode"/>
|
||||
<result column="VERSION" jdbcType="VARCHAR" property="version"/>
|
||||
<result column="VALID" jdbcType="BIT" property="valid"/>
|
||||
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
|
||||
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
|
||||
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
|
||||
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="LAST_UPDATE_BY" jdbcType="BIGINT" property="lastUpdateBy"/>
|
||||
<result column="LAST_UPDATE_TIME" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="find" resultMap="dict">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.id != null and request.id != ''">
|
||||
AND `ID` = ${r"#"}{request.id}
|
||||
</if>
|
||||
<if test="request.dictName != null and request.dictName != ''">
|
||||
AND `DICT_NAME` = ${r"#"}{request.dictName}
|
||||
</if>
|
||||
<if test="request.dictCode != null and request.dictCode != ''">
|
||||
AND `DICT_CODE` = ${r"#"}{request.dictCode}
|
||||
</if>
|
||||
<if test="request.valid != null">
|
||||
AND `VALID` = ${r"#"}{request.valid}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="search" resultMap="dict">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
1 = 2
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
${r"#{"}request.id},
|
||||
${r"#{"}request.dictName,jdbcType=VARCHAR},
|
||||
${r"#{"}request.dictCode,jdbcType=VARCHAR},
|
||||
${r"#{"}request.version,jdbcType=VARCHAR},
|
||||
${r"#{"}request.valid,jdbcType=BIT},
|
||||
0,
|
||||
0,
|
||||
${r"#{"}token.userId,jdbcType=NUMERIC},
|
||||
sysdate(),
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="delete">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET `IS_DELETED` = 1
|
||||
WHERE `IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{"}request.id}
|
||||
</update>
|
||||
|
||||
<update id="update">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET
|
||||
`DICT_NAME` = ${r"#{"}request.dictName,jdbcType=VARCHAR},
|
||||
`DICT_CODE` = ${r"#{"}request.dictCode,jdbcType=VARCHAR},
|
||||
`VERSION` = ${r"#{"}request.version,jdbcType=VARCHAR},
|
||||
`VALID` = ${r"#{"}request.valid,jdbcType=BIT},
|
||||
`ROW_VERSION` = `ROW_VERSION` + 1,
|
||||
`LAST_UPDATE_BY` = ${r"#{"}token.userId},
|
||||
`LAST_UPDATE_TIME` = sysdate()
|
||||
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{"}request.id}
|
||||
AND `ROW_VERSION` = ${r"#{"}request.rowVersion}
|
||||
</update>
|
||||
|
||||
<select id="getAll" resultMap="dict">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
</select>
|
||||
|
||||
<select id="get" resultMap="dict">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r"#{"}request.id}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,76 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DictCreateRequest - 字典新增
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictCreateRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@NotEmpty(message = "字典名称不能为空")
|
||||
@Length(min = 1, max = 50, message = "字典名称长度不合法(1-50)")
|
||||
private String dictName;
|
||||
|
||||
/**
|
||||
* 字典代码
|
||||
*/
|
||||
@NotEmpty(message = "字典代码不能为空")
|
||||
@Length(min = 1, max = 50, message = "字典代码长度不合法(1-50)")
|
||||
private String dictCode;
|
||||
|
||||
/**
|
||||
* 字典版本号
|
||||
*/
|
||||
@NotEmpty(message = "字典版本号不能为空")
|
||||
@Length(min = 1, max = 50, message = "字典版本号长度不合法(1-50)")
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
@NotNull(message = "是否有效不能为NULL")
|
||||
private Boolean valid;
|
||||
|
||||
public String getDictName() {
|
||||
return this.dictName;
|
||||
}
|
||||
|
||||
public void setDictName(String dictName) {
|
||||
this.dictName = dictName;
|
||||
}
|
||||
|
||||
public String getDictCode() {
|
||||
return this.dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(String dictCode) {
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DictDeleteRequest - 字典删除
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictDeleteRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindRequest;
|
||||
|
||||
/**
|
||||
* DictRequest - 字典查询
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictFindRequest extends BaseFindRequest {
|
||||
|
||||
/**
|
||||
* 字典ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
private String dictName;
|
||||
|
||||
/**
|
||||
* 字典代码
|
||||
*/
|
||||
private String dictCode;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean valid;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDictName() {
|
||||
return this.dictName;
|
||||
}
|
||||
|
||||
public void setDictName(String dictName) {
|
||||
this.dictName = dictName;
|
||||
}
|
||||
|
||||
public String getDictCode() {
|
||||
return this.dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(String dictCode) {
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DictGetRequest - 字典获取
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictGetRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DictItemCreateRequest - 字典项新增
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItemCreateRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 字典ID
|
||||
*/
|
||||
private Long dictId;
|
||||
|
||||
/**
|
||||
* 字典KEY
|
||||
*/
|
||||
@Length(min = 0, max = 10, message = "字典KEY长度不合法(0-10)")
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 字典VALUE
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "字典VALUE长度不合法(0-100)")
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "字典项排序值不能为空")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean valid;
|
||||
|
||||
public Long getDictId() {
|
||||
return this.dictId;
|
||||
}
|
||||
|
||||
public void setDictId(Long dictId) {
|
||||
this.dictId = dictId;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return this.sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DictItemDeleteRequest - 字典项删除
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItemDeleteRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindRequest;
|
||||
|
||||
/**
|
||||
* DictItemRequest - 字典项查询
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItemFindRequest extends BaseFindRequest {
|
||||
|
||||
/**
|
||||
* 字典项ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 字典ID
|
||||
*/
|
||||
private Long dictId;
|
||||
|
||||
/**
|
||||
* 字典KEY
|
||||
*/
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 字典VALUE
|
||||
*/
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean valid;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getDictId() {
|
||||
return this.dictId;
|
||||
}
|
||||
|
||||
public void setDictId(Long dictId) {
|
||||
this.dictId = dictId;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return this.sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DictItemGetRequest - 字典项获取
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItemGetRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DictItemUpdateRequest - 字典项更新
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItemUpdateRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为NULL")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 字典ID
|
||||
*/
|
||||
private Long dictId;
|
||||
|
||||
/**
|
||||
* 字典KEY
|
||||
*/
|
||||
@Length(min = 0, max = 10, message = "字典KEY长度不合法(0-10)")
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 字典VALUE
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "字典VALUE长度不合法(0-100)")
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean valid;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getDictId() {
|
||||
return this.dictId;
|
||||
}
|
||||
|
||||
public void setDictId(Long dictId) {
|
||||
this.dictId = dictId;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return this.sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DictGetRequest - 字典获取
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictLoadRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "字典名称不能为空")
|
||||
@NotBlank(message = "字典名称不能为空")
|
||||
private String dictCode;
|
||||
|
||||
public String getDictCode() {
|
||||
return dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(String dictCode) {
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* DictUpdateRequest - 字典更新
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictUpdateRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为NULL")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@NotEmpty(message = "字典名称不能为空")
|
||||
@Length(min = 0, max = 50, message = "字典名称长度不合法(0-50)")
|
||||
private String dictName;
|
||||
|
||||
/**
|
||||
* 字典代码
|
||||
*/
|
||||
@NotEmpty(message = "字典代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "字典代码长度不合法(0-50)")
|
||||
private String dictCode;
|
||||
|
||||
/**
|
||||
* 字典版本号
|
||||
*/
|
||||
@NotEmpty(message = "字典版本号不能为空")
|
||||
@Length(min = 0, max = 50, message = "字典版本号长度不合法(0-50)")
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
@NotNull(message = "是否有效不能为NULL")
|
||||
private Boolean valid;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDictName() {
|
||||
return this.dictName;
|
||||
}
|
||||
|
||||
public void setDictName(String dictName) {
|
||||
this.dictName = dictName;
|
||||
}
|
||||
|
||||
public String getDictCode() {
|
||||
return this.dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(String dictCode) {
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* DictCreateResponse - 字典
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictCreateResponse 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;
|
||||
|
||||
/**
|
||||
* DictDeleteResponse - 字典
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictDeleteResponse 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.Dict;
|
||||
|
||||
/**
|
||||
* DictFindResponse - 字典
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictFindResponse extends BaseFindResponse<Dict> {
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
import ${basePackage}.module.system.ent.Dict;
|
||||
|
||||
/**
|
||||
* DictGetResponse - 字典
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictGetResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 字典
|
||||
*/
|
||||
private Dict dict;
|
||||
|
||||
public Dict getDict() {
|
||||
return this.dict;
|
||||
}
|
||||
|
||||
public void setDict(Dict dict) {
|
||||
this.dict = dict;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* DictItemCreateResponse - 字典项
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItemCreateResponse 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;
|
||||
|
||||
/**
|
||||
* DictItemDeleteResponse - 字典项
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItemDeleteResponse 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.DictItem;
|
||||
|
||||
/**
|
||||
* DictItemFindResponse - 字典项
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItemFindResponse extends BaseFindResponse<DictItem> {
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
import ${basePackage}.module.system.ent.DictItem;
|
||||
|
||||
/**
|
||||
* DictItemGetResponse - 字典项
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItemGetResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 字典项
|
||||
*/
|
||||
private DictItem dictItem;
|
||||
|
||||
public DictItem getDictItem() {
|
||||
return this.dictItem;
|
||||
}
|
||||
|
||||
public void setDictItem(DictItem dictItem) {
|
||||
this.dictItem = dictItem;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* DictItemUpdateResponse - 字典项
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictItemUpdateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 更新数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
import ${basePackage}.module.system.ent.Dict;
|
||||
import ${basePackage}.module.system.ent.DictItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DictGetResponse - 字典
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictLoadResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 字典
|
||||
*/
|
||||
private Dict dict;
|
||||
|
||||
/**
|
||||
* 字典项
|
||||
*/
|
||||
private List<DictItem> dictItems;
|
||||
|
||||
public List<DictItem> getDictItems() {
|
||||
return dictItems;
|
||||
}
|
||||
|
||||
public void setDictItems(List<DictItem> dictItems) {
|
||||
this.dictItems = dictItems;
|
||||
}
|
||||
|
||||
public Dict getDict() {
|
||||
return this.dict;
|
||||
}
|
||||
|
||||
public void setDict(Dict dict) {
|
||||
this.dict = dict;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* DictUpdateResponse - 字典
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-07-20
|
||||
*/
|
||||
public class DictUpdateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 更新数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
<#if dataBase == 'ORACLE'>
|
||||
/*
|
||||
Target : ORACLE
|
||||
Author
|
||||
Date: ${date?string("yyyy-MM-dd")}
|
||||
*/
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for ${table.tableName} - ${table.tableComment?default("")}
|
||||
-- ----------------------------
|
||||
|
||||
CREATE TABLE "${module.modulePrefix}${table.tableName}" (
|
||||
<#list table.fields as field>
|
||||
${dBmapper.getFieldSql(field)}<#if field_has_next>,</#if>
|
||||
</#list>
|
||||
);
|
||||
|
||||
COMMENT ON TABLE "${module.modulePrefix?default("")}${table.tableName}" is '${table.tableComment}';
|
||||
<#list table.fields as field>
|
||||
COMMENT ON COLUMN "${module.modulePrefix?default("")}${table.tableName}"."${field.fieldName?default("")}" is '${field.fieldComment?default("")}';
|
||||
</#list>
|
||||
</#if>
|
||||
<#if dataBase == 'MYSQL'>
|
||||
/*
|
||||
Target : MYSQL
|
||||
Author
|
||||
Date: ${date?string("yyyy-MM-dd")}
|
||||
*/
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for ${table.tableName} - ${table.tableComment?default("")}
|
||||
-- ----------------------------
|
||||
|
||||
CREATE TABLE `${module.modulePrefix?default("")}${table.tableName}` (
|
||||
<#list table.fields as field>
|
||||
${dBmapper.getFieldSql(field)}<#if field_has_next||module.hasSysFields>,</#if>
|
||||
</#list>
|
||||
<#if module.hasSysFields>
|
||||
PRIMARY KEY (`ID`)
|
||||
</#if>
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='${table.tableComment?default("")}';
|
||||
</#if>
|
@ -0,0 +1,34 @@
|
||||
<#if dataBase == 'ORACLE'>
|
||||
<#list module.tables as table>
|
||||
-- ----------------------------
|
||||
-- Table structure for ${table.tableName} - ${table.tableComment?default("")}
|
||||
-- ----------------------------
|
||||
CREATE TABLE "${module.modulePrefix?default("")}${table.tableName}" (
|
||||
<#list table.fields as field>
|
||||
${dBmapper.getFieldSql(field)}<#if field_has_next>,</#if>
|
||||
</#list>
|
||||
);
|
||||
COMMENT ON TABLE "${module.modulePrefix?default("")}${table.tableName}" is '${table.tableComment?default("")}';
|
||||
<#list table.fields as field>
|
||||
COMMENT ON COLUMN "${module.modulePrefix?default("")}${table.tableName}"."${field.fieldName?default("")}" is '${field.fieldComment?default("")}';
|
||||
</#list>
|
||||
|
||||
</#list>
|
||||
</#if>
|
||||
|
||||
<#if dataBase == 'MYSQL'>
|
||||
<#list module.tables as table>
|
||||
-- ----------------------------
|
||||
-- Table structure for ${table.tableName} - ${table.tableComment?default("")}
|
||||
-- ----------------------------
|
||||
CREATE TABLE `${module.modulePrefix?default("")}${table.tableName}` (
|
||||
<#list table.fields as field>
|
||||
${dBmapper.getFieldSql(field)}<#if field_has_next||module.hasSysFields>,</#if>
|
||||
</#list>
|
||||
<#if module.hasSysFields>
|
||||
PRIMARY KEY (`ID`)
|
||||
</#if>
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='${table.tableComment?default("")}';
|
||||
|
||||
</#list>
|
||||
</#if>
|
Loading…
Reference in new issue