diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictAjax.java new file mode 100644 index 00000000..393bc0b3 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictAjax.java @@ -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()); + } +} diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictItemAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictItemAjax.java new file mode 100644 index 00000000..25fa7f99 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictItemAjax.java @@ -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()); + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/ent/Dict.java b/src/main/resources/modules/SpringBoot/java/module/system/ent/Dict.java new file mode 100644 index 00000000..0bc85fc2 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/ent/Dict.java @@ -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; + } +} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/ent/DictItem.java b/src/main/resources/modules/SpringBoot/java/module/system/ent/DictItem.java new file mode 100644 index 00000000..0b0dc791 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/ent/DictItem.java @@ -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; + } +} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManager.java new file mode 100644 index 00000000..5323ed60 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManager.java @@ -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); +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManagerImpl.java new file mode 100644 index 00000000..2211d59d --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManagerImpl.java @@ -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 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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManager.java new file mode 100644 index 00000000..1a14a921 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManager.java @@ -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); +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManagerImpl.java new file mode 100644 index 00000000..b949c056 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManagerImpl.java @@ -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 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 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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper.java new file mode 100644 index 00000000..8f7ba09c --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper.java @@ -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 find(@Param("request") DictItemFindRequest request, @Param("token") Token token); + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回对象 + */ + DictItem get(@Param("request") DictItemGetRequest request, @Param("token") Token token); +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper.xml new file mode 100644 index 00000000..e2c1c688 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper.xml @@ -0,0 +1,133 @@ + + + + + + `SYS_DICT_ITEM` + + + `ID`,`DICT_ID`,`KEY`,`VALUE`,`SORT`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + 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 + ) + + + + UPDATE + + SET `IS_DELETED` = 1 + WHERE `IS_DELETED` = 0 + AND `ID` = ${r"#"}{request.id} + + + + UPDATE + + 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} + + + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.java new file mode 100644 index 00000000..a1dd1a67 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.java @@ -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 find(@Param("request") DictFindRequest request, @Param("token") Token token); + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回对象 + */ + Dict get(@Param("request") DictGetRequest request, @Param("token") Token token); +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.xml new file mode 100644 index 00000000..0e5bf83e --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.xml @@ -0,0 +1,127 @@ + + + + + + `SYS_DICT` + + + `ID`,`DICT_NAME`,`DICT_CODE`,`VERSION`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + 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 + ) + + + + UPDATE + + SET `IS_DELETED` = 1 + WHERE `IS_DELETED` = 0 + AND `ID` = ${r"#{"}request.id} + + + + UPDATE + + 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} + + + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictCreateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictCreateRequest.java new file mode 100644 index 00000000..1c9f7cb6 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictCreateRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictDeleteRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictDeleteRequest.java new file mode 100644 index 00000000..8d3cccaf --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictDeleteRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictFindRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictFindRequest.java new file mode 100644 index 00000000..6c36f240 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictFindRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictGetRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictGetRequest.java new file mode 100644 index 00000000..2201d69a --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictGetRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemCreateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemCreateRequest.java new file mode 100644 index 00000000..1312da2c --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemCreateRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemDeleteRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemDeleteRequest.java new file mode 100644 index 00000000..46985524 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemDeleteRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemFindRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemFindRequest.java new file mode 100644 index 00000000..7bc8a1b1 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemFindRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemGetRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemGetRequest.java new file mode 100644 index 00000000..9a7ffb71 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemGetRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemUpdateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemUpdateRequest.java new file mode 100644 index 00000000..52f6c60d --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictItemUpdateRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictLoadRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictLoadRequest.java new file mode 100644 index 00000000..8fa86001 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictLoadRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/DictUpdateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/DictUpdateRequest.java new file mode 100644 index 00000000..ad10a248 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/DictUpdateRequest.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictCreateResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictCreateResponse.java new file mode 100644 index 00000000..d26e7934 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictCreateResponse.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictDeleteResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictDeleteResponse.java new file mode 100644 index 00000000..8fbd03bf --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictDeleteResponse.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictFindResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictFindResponse.java new file mode 100644 index 00000000..03a17406 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictFindResponse.java @@ -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 { +} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictGetResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictGetResponse.java new file mode 100644 index 00000000..1031cf11 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictGetResponse.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemCreateResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemCreateResponse.java new file mode 100644 index 00000000..373d8d3e --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemCreateResponse.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemDeleteResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemDeleteResponse.java new file mode 100644 index 00000000..a166cc9a --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemDeleteResponse.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemFindResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemFindResponse.java new file mode 100644 index 00000000..3cbc56e3 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemFindResponse.java @@ -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 { +} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemGetResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemGetResponse.java new file mode 100644 index 00000000..b0d66d36 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemGetResponse.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemUpdateResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemUpdateResponse.java new file mode 100644 index 00000000..ef70575f --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictItemUpdateResponse.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictLoadResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictLoadResponse.java new file mode 100644 index 00000000..28724cc7 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictLoadResponse.java @@ -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 dictItems; + + public List getDictItems() { + return dictItems; + } + + public void setDictItems(List dictItems) { + this.dictItems = dictItems; + } + + public Dict getDict() { + return this.dict; + } + + public void setDict(Dict dict) { + this.dict = dict; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictUpdateResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictUpdateResponse.java new file mode 100644 index 00000000..be81280d --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/DictUpdateResponse.java @@ -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; + } +} diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/table.ftl b/src/main/resources/modules/SpringBoot/resources/dbtool/table.ftl new file mode 100644 index 00000000..9ddc7a3a --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/table.ftl @@ -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>, + +); + +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("")}'; + + +<#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 module.hasSysFields> +PRIMARY KEY (`ID`) + +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='${table.tableComment?default("")}'; + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/tableAll.ftl b/src/main/resources/modules/SpringBoot/resources/dbtool/tableAll.ftl new file mode 100644 index 00000000..88f44f19 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/tableAll.ftl @@ -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>, + +); +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("")}'; + + + + + +<#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 module.hasSysFields> +PRIMARY KEY (`ID`) + +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='${table.tableComment?default("")}'; + + +