From 1dc6f78310e80909afe27071aa503d5445ef9921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Tue, 29 Jun 2021 11:36:39 +0800 Subject: [PATCH] =?UTF-8?q?DATA=5FFIELD=20=E5=92=8C=20DATA=5FFIELD=5FLIST?= =?UTF-8?q?=E8=A1=A8=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meapi/controller/DataFieldController.java | 131 ++++++ .../controller/DataFieldListController.java | 123 +++++ .../meapi/mapper/DataFieldListMapper.java | 18 + .../mesnac/meapi/mapper/DataFieldMapper.java | 18 + .../mesnac/meapi/model/DataField.java | 246 ++++++++++ .../mesnac/meapi/model/DataFieldList.java | 157 +++++++ .../meapi/service/DataFieldListService.java | 28 ++ .../meapi/service/DataFieldService.java | 28 ++ .../impl/DataFieldListServiceImpl.java | 46 ++ .../service/impl/DataFieldServiceImpl.java | 46 ++ .../resources/mapper/DataFieldListMapper.xml | 346 ++++++++++++++ .../main/resources/mapper/DataFieldMapper.xml | 444 ++++++++++++++++++ 12 files changed, 1631 insertions(+) create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/DataFieldController.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/DataFieldListController.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/DataFieldListMapper.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/DataFieldMapper.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/model/DataField.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/model/DataFieldList.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/service/DataFieldListService.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/service/DataFieldService.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/DataFieldListServiceImpl.java create mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/DataFieldServiceImpl.java create mode 100644 meapi/src/main/resources/mapper/DataFieldListMapper.xml create mode 100644 meapi/src/main/resources/mapper/DataFieldMapper.xml diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/DataFieldController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/DataFieldController.java new file mode 100644 index 00000000..e3c65c62 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/DataFieldController.java @@ -0,0 +1,131 @@ +package com.foreverwin.mesnac.meapi.controller; + +import com.foreverwin.modular.core.util.R; +import com.foreverwin.modular.core.util.FrontPage; +import com.foreverwin.modular.core.util.CommonMethods; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.foreverwin.mesnac.meapi.service.DataFieldService; +import com.foreverwin.mesnac.meapi.model.DataField; +import java.util.List; + +/** + * + * @author robert + * @since 2021-06-29 + */ +@RestController +@RequestMapping("/DATA-FIELD") +public class DataFieldController { + + @Autowired + public DataFieldService dataFieldService; + + /** + * 根据id查询 + * + * @param id 主键 + * @return + */ + @ResponseBody + @GetMapping("/{id:.+}") + public R getDataFieldById(@PathVariable String id) { + return R.ok( dataFieldService.getById(id)); + } + + /** + * 查询所有数据 + * + * @return + */ + @ResponseBody + @GetMapping("") + public R getDataFieldList(DataField dataField){ + List result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(dataField); + result = dataFieldService.list(queryWrapper); + return R.ok(result); + } + + /** + * 分页查询数据 + * + * @param frontPage 分页信息 + * @return + */ + @ResponseBody + @GetMapping("/page") + public R page(FrontPage frontPage, DataField dataField){ + IPage result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(dataField); + if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { + //TODO modify global query + queryWrapper.lambda().and(wrapper -> wrapper + .like(DataField::getHandle, frontPage.getGlobalQuery()) + .or().like(DataField::getDataTypeBo, frontPage.getGlobalQuery()) + .or().like(DataField::getDataField, frontPage.getGlobalQuery()) + .or().like(DataField::getFieldType, frontPage.getGlobalQuery()) + .or().like(DataField::getValidationType, frontPage.getGlobalQuery()) + .or().like(DataField::getDataDefault, frontPage.getGlobalQuery()) + .or().like(DataField::getSite, frontPage.getGlobalQuery()) + .or().like(DataField::getBrowseActivityBo, frontPage.getGlobalQuery()) + .or().like(DataField::getIsBrowse, frontPage.getGlobalQuery()) + .or().like(DataField::getIsErp, frontPage.getGlobalQuery()) + .or().like(DataField::getMaskGroupBo, frontPage.getGlobalQuery()) + .or().like(DataField::getDescription, frontPage.getGlobalQuery()) + .or().like(DataField::getValidationActivityBo, frontPage.getGlobalQuery()) + .or().like(DataField::getCategory, frontPage.getGlobalQuery()) + ); + } + result = dataFieldService.page(frontPage.getPagePlus(), queryWrapper); + return R.ok(result); + } + + /** + * 新增 + * @param dataField 传递的实体 + * @return null 失败 实体成功 + */ + @PostMapping + public R save(@RequestBody DataField dataField) { + return R.ok(dataFieldService.save(dataField)); + } + + /** + * 修改 + * @param dataField 传递的实体 + * @return null 失败 实体成功 + */ + @PutMapping + public R updateById(@RequestBody DataField dataField) { + return R.ok(dataFieldService.updateById(dataField)); + } + + /** + * 根据id删除对象 + * @param id 实体ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}") + public R removeById(@PathVariable("id") String id){ + return R.ok(dataFieldService.removeById(id)); + } + + /** + * 批量删除对象 + * @param ids 实体集合ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.POST, value = "/delete-batch") + public R removeByIds(List ids){ + return R.ok(dataFieldService.removeByIds(ids)); + } +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/DataFieldListController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/DataFieldListController.java new file mode 100644 index 00000000..f704488a --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/DataFieldListController.java @@ -0,0 +1,123 @@ +package com.foreverwin.mesnac.meapi.controller; + +import com.foreverwin.modular.core.util.R; +import com.foreverwin.modular.core.util.FrontPage; +import com.foreverwin.modular.core.util.CommonMethods; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.foreverwin.mesnac.meapi.service.DataFieldListService; +import com.foreverwin.mesnac.meapi.model.DataFieldList; +import java.util.List; + +/** + * + * @author robert + * @since 2021-06-29 + */ +@RestController +@RequestMapping("/DATA-FIELD-LIST") +public class DataFieldListController { + + @Autowired + public DataFieldListService dataFieldListService; + + /** + * 根据id查询 + * + * @param id 主键 + * @return + */ + @ResponseBody + @GetMapping("/{id:.+}") + public R getDataFieldListById(@PathVariable String id) { + return R.ok( dataFieldListService.getById(id)); + } + + /** + * 查询所有数据 + * + * @return + */ + @ResponseBody + @GetMapping("") + public R getDataFieldListList(DataFieldList dataFieldList){ + List result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(dataFieldList); + result = dataFieldListService.list(queryWrapper); + return R.ok(result); + } + + /** + * 分页查询数据 + * + * @param frontPage 分页信息 + * @return + */ + @ResponseBody + @GetMapping("/page") + public R page(FrontPage frontPage, DataFieldList dataFieldList){ + IPage result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(dataFieldList); + if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { + //TODO modify global query + queryWrapper.lambda().and(wrapper -> wrapper + .like(DataFieldList::getHandle, frontPage.getGlobalQuery()) + .or().like(DataFieldList::getDataFieldBo, frontPage.getGlobalQuery()) + .or().like(DataFieldList::getDataValue, frontPage.getGlobalQuery()) + .or().like(DataFieldList::getIsDefault, frontPage.getGlobalQuery()) + .or().like(DataFieldList::getValuation, frontPage.getGlobalQuery()) + .or().like(DataFieldList::getErpCodeGroup, frontPage.getGlobalQuery()) + ); + } + result = dataFieldListService.page(frontPage.getPagePlus(), queryWrapper); + return R.ok(result); + } + + /** + * 新增 + * @param dataFieldList 传递的实体 + * @return null 失败 实体成功 + */ + @PostMapping + public R save(@RequestBody DataFieldList dataFieldList) { + return R.ok(dataFieldListService.save(dataFieldList)); + } + + /** + * 修改 + * @param dataFieldList 传递的实体 + * @return null 失败 实体成功 + */ + @PutMapping + public R updateById(@RequestBody DataFieldList dataFieldList) { + return R.ok(dataFieldListService.updateById(dataFieldList)); + } + + /** + * 根据id删除对象 + * @param id 实体ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}") + public R removeById(@PathVariable("id") String id){ + return R.ok(dataFieldListService.removeById(id)); + } + + /** + * 批量删除对象 + * @param ids 实体集合ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.POST, value = "/delete-batch") + public R removeByIds(List ids){ + return R.ok(dataFieldListService.removeByIds(ids)); + } +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/DataFieldListMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/DataFieldListMapper.java new file mode 100644 index 00000000..c810a7fc --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/DataFieldListMapper.java @@ -0,0 +1,18 @@ +package com.foreverwin.mesnac.meapi.mapper; + +import com.foreverwin.mesnac.meapi.model.DataFieldList; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author robert + * @since 2021-06-29 + */ +@Repository +public interface DataFieldListMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/DataFieldMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/DataFieldMapper.java new file mode 100644 index 00000000..4bbb8ef3 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/DataFieldMapper.java @@ -0,0 +1,18 @@ +package com.foreverwin.mesnac.meapi.mapper; + +import com.foreverwin.mesnac.meapi.model.DataField; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author robert + * @since 2021-06-29 + */ +@Repository +public interface DataFieldMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/DataField.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/DataField.java new file mode 100644 index 00000000..2447e486 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/DataField.java @@ -0,0 +1,246 @@ +package com.foreverwin.mesnac.meapi.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author robert + * @since 2021-06-29 + */ + +@TableName("DATA_FIELD") + +public class DataField extends Model { + + private static final long serialVersionUID = 1L; + + @TableField("HANDLE") + private String handle; + @TableField("DATA_TYPE_BO") + private String dataTypeBo; + @TableField("DATA_FIELD") + private String dataField; + @TableField("FIELD_TYPE") + private String fieldType; + @TableField("VALIDATION_TYPE") + private String validationType; + @TableField("DATA_DEFAULT") + private String dataDefault; + @TableField("SITE") + private String site; + @TableField("BROWSE_ACTIVITY_BO") + private String browseActivityBo; + @TableField("IS_BROWSE") + private String isBrowse; + @TableField("IS_ERP") + private String isErp; + @TableField("MASK_GROUP_BO") + private String maskGroupBo; + @TableField("DESCRIPTION") + private String description; + @TableField("VALIDATION_ACTIVITY_BO") + private String validationActivityBo; + @TableField("CREATED_DATE_TIME") + private LocalDateTime createdDateTime; + @TableField("MODIFIED_DATE_TIME") + private LocalDateTime modifiedDateTime; + @TableField("CATEGORY") + private String category; + + + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public String getDataTypeBo() { + return dataTypeBo; + } + + public void setDataTypeBo(String dataTypeBo) { + this.dataTypeBo = dataTypeBo; + } + + public String getDataField() { + return dataField; + } + + public void setDataField(String dataField) { + this.dataField = dataField; + } + + public String getFieldType() { + return fieldType; + } + + public void setFieldType(String fieldType) { + this.fieldType = fieldType; + } + + public String getValidationType() { + return validationType; + } + + public void setValidationType(String validationType) { + this.validationType = validationType; + } + + public String getDataDefault() { + return dataDefault; + } + + public void setDataDefault(String dataDefault) { + this.dataDefault = dataDefault; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getBrowseActivityBo() { + return browseActivityBo; + } + + public void setBrowseActivityBo(String browseActivityBo) { + this.browseActivityBo = browseActivityBo; + } + + public String getIsBrowse() { + return isBrowse; + } + + public void setIsBrowse(String isBrowse) { + this.isBrowse = isBrowse; + } + + public String getIsErp() { + return isErp; + } + + public void setIsErp(String isErp) { + this.isErp = isErp; + } + + public String getMaskGroupBo() { + return maskGroupBo; + } + + public void setMaskGroupBo(String maskGroupBo) { + this.maskGroupBo = maskGroupBo; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getValidationActivityBo() { + return validationActivityBo; + } + + public void setValidationActivityBo(String validationActivityBo) { + this.validationActivityBo = validationActivityBo; + } + + public LocalDateTime getCreatedDateTime() { + return createdDateTime; + } + + public void setCreatedDateTime(LocalDateTime createdDateTime) { + this.createdDateTime = createdDateTime; + } + + public LocalDateTime getModifiedDateTime() { + return modifiedDateTime; + } + + public void setModifiedDateTime(LocalDateTime modifiedDateTime) { + this.modifiedDateTime = modifiedDateTime; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + +public static final String HANDLE = "HANDLE"; + +public static final String DATA_TYPE_BO = "DATA_TYPE_BO"; + +public static final String DATA_FIELD = "DATA_FIELD"; + +public static final String FIELD_TYPE = "FIELD_TYPE"; + +public static final String VALIDATION_TYPE = "VALIDATION_TYPE"; + +public static final String DATA_DEFAULT = "DATA_DEFAULT"; + +public static final String SITE = "SITE"; + +public static final String BROWSE_ACTIVITY_BO = "BROWSE_ACTIVITY_BO"; + +public static final String IS_BROWSE = "IS_BROWSE"; + +public static final String IS_ERP = "IS_ERP"; + +public static final String MASK_GROUP_BO = "MASK_GROUP_BO"; + +public static final String DESCRIPTION = "DESCRIPTION"; + +public static final String VALIDATION_ACTIVITY_BO = "VALIDATION_ACTIVITY_BO"; + +public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; + +public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; + +public static final String CATEGORY = "CATEGORY"; + + + @Override + protected Serializable pkVal() { + return this.handle; + } + + @Override + public String toString() { + return "DataField{" + + "handle = " + handle + + ", dataTypeBo = " + dataTypeBo + + ", dataField = " + dataField + + ", fieldType = " + fieldType + + ", validationType = " + validationType + + ", dataDefault = " + dataDefault + + ", site = " + site + + ", browseActivityBo = " + browseActivityBo + + ", isBrowse = " + isBrowse + + ", isErp = " + isErp + + ", maskGroupBo = " + maskGroupBo + + ", description = " + description + + ", validationActivityBo = " + validationActivityBo + + ", createdDateTime = " + createdDateTime + + ", modifiedDateTime = " + modifiedDateTime + + ", category = " + category + + "}"; + } +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/DataFieldList.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/DataFieldList.java new file mode 100644 index 00000000..d1e35879 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/DataFieldList.java @@ -0,0 +1,157 @@ +package com.foreverwin.mesnac.meapi.model; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import com.baomidou.mybatisplus.annotation.IdType; + +/** + *

+ * + *

+ * + * @author robert + * @since 2021-06-29 + */ + +@TableName("DATA_FIELD_LIST") + +public class DataFieldList extends Model { + + private static final long serialVersionUID = 1L; + + @TableField("HANDLE") + private String handle; + @TableField("SEQUENCE") + private Long sequence; + @TableField("DATA_FIELD_BO") + private String dataFieldBo; + @TableField("DATA_VALUE") + private String dataValue; + @TableField("IS_DEFAULT") + private String isDefault; + @TableField("VALUATION") + private String valuation; + @TableField("ERP_CODE_GROUP") + private String erpCodeGroup; + @TableField("CREATED_DATE_TIME") + private LocalDateTime createdDateTime; + @TableField("MODIFIED_DATE_TIME") + private LocalDateTime modifiedDateTime; + + + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public Long getSequence() { + return sequence; + } + + public void setSequence(Long sequence) { + this.sequence = sequence; + } + + public String getDataFieldBo() { + return dataFieldBo; + } + + public void setDataFieldBo(String dataFieldBo) { + this.dataFieldBo = dataFieldBo; + } + + public String getDataValue() { + return dataValue; + } + + public void setDataValue(String dataValue) { + this.dataValue = dataValue; + } + + public String getIsDefault() { + return isDefault; + } + + public void setIsDefault(String isDefault) { + this.isDefault = isDefault; + } + + public String getValuation() { + return valuation; + } + + public void setValuation(String valuation) { + this.valuation = valuation; + } + + public String getErpCodeGroup() { + return erpCodeGroup; + } + + public void setErpCodeGroup(String erpCodeGroup) { + this.erpCodeGroup = erpCodeGroup; + } + + public LocalDateTime getCreatedDateTime() { + return createdDateTime; + } + + public void setCreatedDateTime(LocalDateTime createdDateTime) { + this.createdDateTime = createdDateTime; + } + + public LocalDateTime getModifiedDateTime() { + return modifiedDateTime; + } + + public void setModifiedDateTime(LocalDateTime modifiedDateTime) { + this.modifiedDateTime = modifiedDateTime; + } + +public static final String HANDLE = "HANDLE"; + +public static final String SEQUENCE = "SEQUENCE"; + +public static final String DATA_FIELD_BO = "DATA_FIELD_BO"; + +public static final String DATA_VALUE = "DATA_VALUE"; + +public static final String IS_DEFAULT = "IS_DEFAULT"; + +public static final String VALUATION = "VALUATION"; + +public static final String ERP_CODE_GROUP = "ERP_CODE_GROUP"; + +public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; + +public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; + + + @Override + protected Serializable pkVal() { + return this.handle; + } + + @Override + public String toString() { + return "DataFieldList{" + + "handle = " + handle + + ", sequence = " + sequence + + ", dataFieldBo = " + dataFieldBo + + ", dataValue = " + dataValue + + ", isDefault = " + isDefault + + ", valuation = " + valuation + + ", erpCodeGroup = " + erpCodeGroup + + ", createdDateTime = " + createdDateTime + + ", modifiedDateTime = " + modifiedDateTime + + "}"; + } +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/DataFieldListService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/DataFieldListService.java new file mode 100644 index 00000000..70518101 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/DataFieldListService.java @@ -0,0 +1,28 @@ +package com.foreverwin.mesnac.meapi.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.meapi.model.DataFieldList; +import com.baomidou.mybatisplus.extension.service.IService; +import com.foreverwin.modular.core.util.FrontPage; + +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author robert + * @since 2021-06-29 + */ +public interface DataFieldListService extends IService { + + /** + * 分页查询 + * @param frontPage + * @return + */ + IPage selectPage(FrontPage frontPage, DataFieldList dataFieldList); + + List selectList(DataFieldList dataFieldList); +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/DataFieldService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/DataFieldService.java new file mode 100644 index 00000000..b61eb63a --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/DataFieldService.java @@ -0,0 +1,28 @@ +package com.foreverwin.mesnac.meapi.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.meapi.model.DataField; +import com.baomidou.mybatisplus.extension.service.IService; +import com.foreverwin.modular.core.util.FrontPage; + +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author robert + * @since 2021-06-29 + */ +public interface DataFieldService extends IService { + + /** + * 分页查询 + * @param frontPage + * @return + */ + IPage selectPage(FrontPage frontPage, DataField dataField); + + List selectList(DataField dataField); +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/DataFieldListServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/DataFieldListServiceImpl.java new file mode 100644 index 00000000..146ed9c2 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/DataFieldListServiceImpl.java @@ -0,0 +1,46 @@ +package com.foreverwin.mesnac.meapi.service.impl; + +import com.foreverwin.modular.core.util.FrontPage; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.meapi.model.DataFieldList; +import com.foreverwin.mesnac.meapi.mapper.DataFieldListMapper; +import com.foreverwin.mesnac.meapi.service.DataFieldListService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +/** + *

+ * 服务实现类 + *

+ * + * @author robert + * @since 2021-06-29 + */ +@Service +@Transactional(rollbackFor = Exception.class) +public class DataFieldListServiceImpl extends ServiceImpl implements DataFieldListService { + + + @Autowired + private DataFieldListMapper dataFieldListMapper; + + @Override + public IPage selectPage(FrontPage frontPage, DataFieldList dataFieldList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(dataFieldList); + return super.page(frontPage.getPagePlus(), queryWrapper); + } + + @Override + public List selectList(DataFieldList dataFieldList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(dataFieldList); + return super.list(queryWrapper); + } + + +} \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/DataFieldServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/DataFieldServiceImpl.java new file mode 100644 index 00000000..9b3602c3 --- /dev/null +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/DataFieldServiceImpl.java @@ -0,0 +1,46 @@ +package com.foreverwin.mesnac.meapi.service.impl; + +import com.foreverwin.modular.core.util.FrontPage; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.meapi.model.DataField; +import com.foreverwin.mesnac.meapi.mapper.DataFieldMapper; +import com.foreverwin.mesnac.meapi.service.DataFieldService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +/** + *

+ * 服务实现类 + *

+ * + * @author robert + * @since 2021-06-29 + */ +@Service +@Transactional(rollbackFor = Exception.class) +public class DataFieldServiceImpl extends ServiceImpl implements DataFieldService { + + + @Autowired + private DataFieldMapper dataFieldMapper; + + @Override + public IPage selectPage(FrontPage frontPage, DataField dataField) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(dataField); + return super.page(frontPage.getPagePlus(), queryWrapper); + } + + @Override + public List selectList(DataField dataField) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(dataField); + return super.list(queryWrapper); + } + + +} \ No newline at end of file diff --git a/meapi/src/main/resources/mapper/DataFieldListMapper.xml b/meapi/src/main/resources/mapper/DataFieldListMapper.xml new file mode 100644 index 00000000..d0200842 --- /dev/null +++ b/meapi/src/main/resources/mapper/DataFieldListMapper.xml @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + HANDLE, SEQUENCE, DATA_FIELD_BO, DATA_VALUE, IS_DEFAULT, VALUATION, ERP_CODE_GROUP, CREATED_DATE_TIME, MODIFIED_DATE_TIME + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO DATA_FIELD_LIST + + HANDLE, + SEQUENCE, + DATA_FIELD_BO, + DATA_VALUE, + IS_DEFAULT, + VALUATION, + ERP_CODE_GROUP, + CREATED_DATE_TIME, + MODIFIED_DATE_TIME, + VALUES + + #{handle}, + #{sequence}, + #{dataFieldBo}, + #{dataValue}, + #{isDefault}, + #{valuation}, + #{erpCodeGroup}, + #{createdDateTime}, + #{modifiedDateTime}, + + + + + INSERT INTO DATA_FIELD_LIST + + + VALUES + + #{handle}, + #{sequence}, + #{dataFieldBo}, + #{dataValue}, + #{isDefault}, + #{valuation}, + #{erpCodeGroup}, + #{createdDateTime}, + #{modifiedDateTime}, + + + + + + + + + + UPDATE DATA_FIELD_LIST + HANDLE=#{et.handle}, + SEQUENCE=#{et.sequence}, + DATA_FIELD_BO=#{et.dataFieldBo}, + DATA_VALUE=#{et.dataValue}, + IS_DEFAULT=#{et.isDefault}, + VALUATION=#{et.valuation}, + ERP_CODE_GROUP=#{et.erpCodeGroup}, + CREATED_DATE_TIME=#{et.createdDateTime}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + + + + + HANDLE=#{ew.entity.handle} + AND SEQUENCE=#{ew.entity.sequence} + AND DATA_FIELD_BO=#{ew.entity.dataFieldBo} + AND DATA_VALUE=#{ew.entity.dataValue} + AND IS_DEFAULT=#{ew.entity.isDefault} + AND VALUATION=#{ew.entity.valuation} + AND ERP_CODE_GROUP=#{ew.entity.erpCodeGroup} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + + DELETE FROM DATA_FIELD_LIST + + + + + ${k} = #{cm[${k}]} + + + + + + + + DELETE FROM DATA_FIELD_LIST + + + + + HANDLE=#{ew.entity.handle} + + AND SEQUENCE=#{ew.entity.sequence} + AND DATA_FIELD_BO=#{ew.entity.dataFieldBo} + AND DATA_VALUE=#{ew.entity.dataValue} + AND IS_DEFAULT=#{ew.entity.isDefault} + AND VALUATION=#{ew.entity.valuation} + AND ERP_CODE_GROUP=#{ew.entity.erpCodeGroup} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + + diff --git a/meapi/src/main/resources/mapper/DataFieldMapper.xml b/meapi/src/main/resources/mapper/DataFieldMapper.xml new file mode 100644 index 00000000..debaa0e1 --- /dev/null +++ b/meapi/src/main/resources/mapper/DataFieldMapper.xml @@ -0,0 +1,444 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + HANDLE, DATA_TYPE_BO, DATA_FIELD, FIELD_TYPE, VALIDATION_TYPE, DATA_DEFAULT, SITE, BROWSE_ACTIVITY_BO, IS_BROWSE, IS_ERP, MASK_GROUP_BO, DESCRIPTION, VALIDATION_ACTIVITY_BO, CREATED_DATE_TIME, MODIFIED_DATE_TIME, CATEGORY + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO DATA_FIELD + + HANDLE, + DATA_TYPE_BO, + DATA_FIELD, + FIELD_TYPE, + VALIDATION_TYPE, + DATA_DEFAULT, + SITE, + BROWSE_ACTIVITY_BO, + IS_BROWSE, + IS_ERP, + MASK_GROUP_BO, + DESCRIPTION, + VALIDATION_ACTIVITY_BO, + CREATED_DATE_TIME, + MODIFIED_DATE_TIME, + CATEGORY, + VALUES + + #{handle}, + #{dataTypeBo}, + #{dataField}, + #{fieldType}, + #{validationType}, + #{dataDefault}, + #{site}, + #{browseActivityBo}, + #{isBrowse}, + #{isErp}, + #{maskGroupBo}, + #{description}, + #{validationActivityBo}, + #{createdDateTime}, + #{modifiedDateTime}, + #{category}, + + + + + INSERT INTO DATA_FIELD + + + VALUES + + #{handle}, + #{dataTypeBo}, + #{dataField}, + #{fieldType}, + #{validationType}, + #{dataDefault}, + #{site}, + #{browseActivityBo}, + #{isBrowse}, + #{isErp}, + #{maskGroupBo}, + #{description}, + #{validationActivityBo}, + #{createdDateTime}, + #{modifiedDateTime}, + #{category}, + + + + + + + + + + UPDATE DATA_FIELD + HANDLE=#{et.handle}, + DATA_TYPE_BO=#{et.dataTypeBo}, + DATA_FIELD=#{et.dataField}, + FIELD_TYPE=#{et.fieldType}, + VALIDATION_TYPE=#{et.validationType}, + DATA_DEFAULT=#{et.dataDefault}, + SITE=#{et.site}, + BROWSE_ACTIVITY_BO=#{et.browseActivityBo}, + IS_BROWSE=#{et.isBrowse}, + IS_ERP=#{et.isErp}, + MASK_GROUP_BO=#{et.maskGroupBo}, + DESCRIPTION=#{et.description}, + VALIDATION_ACTIVITY_BO=#{et.validationActivityBo}, + CREATED_DATE_TIME=#{et.createdDateTime}, + MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + CATEGORY=#{et.category}, + + + + + HANDLE=#{ew.entity.handle} + AND DATA_TYPE_BO=#{ew.entity.dataTypeBo} + AND DATA_FIELD=#{ew.entity.dataField} + AND FIELD_TYPE=#{ew.entity.fieldType} + AND VALIDATION_TYPE=#{ew.entity.validationType} + AND DATA_DEFAULT=#{ew.entity.dataDefault} + AND SITE=#{ew.entity.site} + AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo} + AND IS_BROWSE=#{ew.entity.isBrowse} + AND IS_ERP=#{ew.entity.isErp} + AND MASK_GROUP_BO=#{ew.entity.maskGroupBo} + AND DESCRIPTION=#{ew.entity.description} + AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND CATEGORY=#{ew.entity.category} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + + DELETE FROM DATA_FIELD + + + + + ${k} = #{cm[${k}]} + + + + + + + + DELETE FROM DATA_FIELD + + + + + HANDLE=#{ew.entity.handle} + + AND DATA_TYPE_BO=#{ew.entity.dataTypeBo} + AND DATA_FIELD=#{ew.entity.dataField} + AND FIELD_TYPE=#{ew.entity.fieldType} + AND VALIDATION_TYPE=#{ew.entity.validationType} + AND DATA_DEFAULT=#{ew.entity.dataDefault} + AND SITE=#{ew.entity.site} + AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo} + AND IS_BROWSE=#{ew.entity.isBrowse} + AND IS_ERP=#{ew.entity.isErp} + AND MASK_GROUP_BO=#{ew.entity.maskGroupBo} + AND DESCRIPTION=#{ew.entity.description} + AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND CATEGORY=#{ew.entity.category} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + +