From a51c6872d866b1e4b6236f3aade961c2b87c0ca8 Mon Sep 17 00:00:00 2001 From: qdxkrs <39894542+qdxkrs@users.noreply.github.com> Date: Fri, 20 May 2022 16:59:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=9E=E6=9C=BA=E2=9C=88=E4=BF=9D=E4=BD=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/RuoYiApplication.java | 2 + .../yada/ThematicMapController.java | 70 +++++++++ .../src/main/resources/application.yml | 6 +- ruoyi-admin/src/main/resources/banner.txt | 48 ++++--- .../system/domain_yada/SysBaseEntity.java | 56 ++++---- .../system/domain_yada/ThematicMapDomain.java | 133 ++++++++++++++++++ .../domain_yada/VegetationCoverageVO.java | 6 +- .../system/mapper_yada/ThematicMapMapper.java | 34 +++++ .../service_yada/ThematicMapService.java | 36 +++++ .../impl/ThematicMapServiceImpl.java | 49 +++++++ .../mapper/system/ThematicMapMapper.xml | 63 +++++++++ 11 files changed, 449 insertions(+), 54 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/ThematicMapController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/ThematicMapDomain.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ThematicMapMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ThematicMapService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/ThematicMapServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/ThematicMapMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 9639bc9c3..01606a4d8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -1,5 +1,6 @@ package com.ruoyi; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; @@ -9,6 +10,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; * * @author ruoyi */ +@MapperScan("com.ruoyi.system.mapper_yada") @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) public class RuoYiApplication { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/ThematicMapController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/ThematicMapController.java new file mode 100644 index 000000000..be6286759 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/ThematicMapController.java @@ -0,0 +1,70 @@ +package com.ruoyi.web.controller.yada; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.domain_yada.ThematicMapDomain; +import com.ruoyi.system.service_yada.ThematicMapService; +import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 中国城市监测 + * @Author: JinSheng Song + * @Date: 2022/5/11 10:55 + */ +@RestController +@RequestMapping(value = "/api/thematic-map") +public class ThematicMapController { + + @Resource + private ThematicMapService thematicMapService; + + /** + * 查询方法 + * @param response + * @param request + * @return + */ + @RequestMapping(value = "/get/all",method = {RequestMethod.GET}) + public AjaxResult selectAllThematicMap(HttpServletResponse response, HttpServletRequest request) + { + List res= thematicMapService.selectAll(); + return AjaxResult.success(res); + } + + /** + * 删除方法 + * @param id + * @return + */ + @RequestMapping(value = "/delete",method = {RequestMethod.DELETE}) + public AjaxResult deleteThematicMap(@Param("id") Long id) + { + int num = thematicMapService.deleteById(id); + if (num>0) { + return AjaxResult.success(); + } + return AjaxResult.error(); + } + + /** + * 新增方法 + * @param thematicMapDomain + * @return + */ + @RequestMapping(value = "/add",method = {RequestMethod.POST}) + public AjaxResult saveThematicMap(ThematicMapDomain thematicMapDomain) + { + int num = thematicMapService.save(thematicMapDomain); + if (num>0) { + return AjaxResult.success(); + } + return AjaxResult.error(); + } +} diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 0bbaeb4f1..1111fce20 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -71,7 +71,7 @@ spring: # 数据库索引 database: 3 # 密码 - password: yhy_app + password: sdust2020 # 连接超时时间 timeout: 10s lettuce: @@ -97,9 +97,9 @@ token: # MyBatis配置 mybatis: # 搜索指定包别名 - typeAliasesPackage: com.ruoyi.**.domain + typeAliasesPackage: com.ruoyi.**.domain,com.ruoyi.**.domain_yada # 配置mapper的扫描,找到所有的mapper.xml映射文件 - mapperLocations: classpath*:mapper/**/*Mapper.xml + mapperLocations: classpath*:mapper/**/*Mapper.xml,classpath*:mapper_yada/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml diff --git a/ruoyi-admin/src/main/resources/banner.txt b/ruoyi-admin/src/main/resources/banner.txt index a02645ec3..8e65fd3ab 100644 --- a/ruoyi-admin/src/main/resources/banner.txt +++ b/ruoyi-admin/src/main/resources/banner.txt @@ -1,24 +1,34 @@ Application Version: ${ruoyi.version} Spring Boot Version: ${spring-boot.version} //////////////////////////////////////////////////////////////////// -// _ooOoo_ // -// o6666666o // -// 88" . "88 // -// (| ^_^ |) // -// O\ = /O // -// ____/`---'\____ // -// .' \\| |// `. // -// / \\||| : |||// \ // -// / _||||| -:- |||||- \ // -// | | \\\ - /// | | // -// | \_| ''\---/'' | | // -// \ .-\__ `-` ___/-. / // -// ___`. .' /--.--\ `. . ___ // -// ."" '< `.___\_<|>_/___.' >'"". // -// | | : `- \`.;`\ _ /`;.`/ - ` : | | // -// \ \ `-. \_ __\ /__ _/ .-` / / // -// ========`-.____`-.___\_____/___.-`____.-'======== // -// `=---=' // + /\ + | | + | | + .' '. + | | + | | + | /\ | + .' |__|'. + | | | | + .' | | '. + /\ | \__/ | /\ + | | | | | | | | + /| | |,-\ | | /-,| | |\ + || |,-' | | | | '-,| || + ||-' | | | | '-|| +|\ _,-' | | | | '-,_ /| +|| ,-' _ | | | | '-, || +||-' =(*)= | | | | '-|| +|| | \ / | || +|\________....--------\ || /--------....________/| + /| || |\ + / | || | \ + / | \/ | \ + / | | \ + // .| |. \\ + .' |_./ | | \._| '. + / _.-||| |||-._ \ + \__.-' \||/\||/ '-.__/ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // -// 佛祖保佑 永不宕机 永无BUG // +// 飞机保佑 永不宕机 永无BUG // //////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/SysBaseEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/SysBaseEntity.java index bdef7faee..527685c9c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/SysBaseEntity.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/SysBaseEntity.java @@ -15,67 +15,61 @@ public class SysBaseEntity implements Serializable private static final long serialVersionUID = 1L; /** 创建者 */ - private String createBy; + private String createdBy; /** 创建时间 */ - private LocalDateTime createTime; + private LocalDateTime createdTime; /** 更新者 */ - private String updateBy; + private String updatedBy; /** 更新时间 */ - private LocalDateTime updateTime; + private LocalDateTime updatedTime; /** 备注 */ - private String remark; + private String remarks; /** 请求参数 */ private Map params; - public String getCreateBy() - { - return createBy; + public String getCreatedBy() { + return createdBy; } - public void setCreateBy(String createBy) - { - this.createBy = createBy; + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; } - public LocalDateTime getCreateTime() { - return createTime; + public LocalDateTime getCreatedTime() { + return createdTime; } - public void setCreateTime(LocalDateTime createTime) { - this.createTime = createTime; + public void setCreatedTime(LocalDateTime createdTime) { + this.createdTime = createdTime; } - public String getUpdateBy() - { - return updateBy; + public String getUpdatedBy() { + return updatedBy; } - public void setUpdateBy(String updateBy) - { - this.updateBy = updateBy; + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; } - public LocalDateTime getUpdateTime() { - return updateTime; + public LocalDateTime getUpdatedTime() { + return updatedTime; } - public void setUpdateTime(LocalDateTime updateTime) { - this.updateTime = updateTime; + public void setUpdatedTime(LocalDateTime updatedTime) { + this.updatedTime = updatedTime; } - public String getRemark() - { - return remark; + public String getRemarks() { + return remarks; } - public void setRemark(String remark) - { - this.remark = remark; + public void setRemarks(String remarks) { + this.remarks = remarks; } public Map getParams() diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/ThematicMapDomain.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/ThematicMapDomain.java new file mode 100644 index 000000000..49908b895 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/ThematicMapDomain.java @@ -0,0 +1,133 @@ +package com.ruoyi.system.domain_yada; + +import java.time.LocalDateTime; + +/** + * 专题图实体类 + * @Author: taco chen + * @Date: 2022/5/20 14:09 + */ +public class ThematicMapDomain extends SysBaseEntity { + + private Long id; + + private String pictureZh; + + private String pictureEn; + + private String pictureName; + + private String pictureType; + + private LocalDateTime pictureTime; + + private String picturePath; + + private String remarks; + + private String createdBy; + + private LocalDateTime createdTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPictureZh() { + return pictureZh; + } + + public void setPictureZh(String pictureZh) { + this.pictureZh = pictureZh; + } + + public String getPictureEn() { + return pictureEn; + } + + public void setPictureEn(String pictureEn) { + this.pictureEn = pictureEn; + } + + public String getPictureName() { + return pictureName; + } + + public void setPictureName(String pictureName) { + this.pictureName = pictureName; + } + + public String getPictureType() { + return pictureType; + } + + public void setPictureType(String pictureType) { + this.pictureType = pictureType; + } + + public LocalDateTime getPictureTime() { + return pictureTime; + } + + public void setPictureTime(LocalDateTime pictureTime) { + this.pictureTime = pictureTime; + } + + public String getPicturePath() { + return picturePath; + } + + public void setPicturePath(String picturePath) { + this.picturePath = picturePath; + } + + @Override + public String getRemarks() { + return remarks; + } + + @Override + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + @Override + public String getCreatedBy() { + return createdBy; + } + + @Override + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + @Override + public LocalDateTime getCreatedTime() { + return createdTime; + } + + @Override + public void setCreatedTime(LocalDateTime createdTime) { + this.createdTime = createdTime; + } + + @Override + public String toString() { + return "ThematicMapDomain{" + + "id=" + id + + ", pictureZh='" + pictureZh + '\'' + + ", pictureEn='" + pictureEn + '\'' + + ", pictureName='" + pictureName + '\'' + + ", pictureType='" + pictureType + '\'' + + ", pictureTime=" + pictureTime + + ", picturePath='" + picturePath + '\'' + + ", remarks='" + remarks + '\'' + + ", createdBy='" + createdBy + '\'' + + ", createdTime=" + createdTime + + '}'; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/VegetationCoverageVO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/VegetationCoverageVO.java index c0f8daa65..e23064064 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/VegetationCoverageVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/VegetationCoverageVO.java @@ -1,9 +1,13 @@ package com.ruoyi.system.domain_yada; +import java.time.LocalDateTime; + /** * 平均植被覆盖度和净初级生产力 * @Author: JinSheng Song * @Date: 2022/5/20 14:09 */ -public class VegetationCoverageVO { +public class VegetationCoverageVO extends SysBaseEntity { + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ThematicMapMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ThematicMapMapper.java new file mode 100644 index 000000000..3b03a98ab --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ThematicMapMapper.java @@ -0,0 +1,34 @@ +package com.ruoyi.system.mapper_yada; + +import com.ruoyi.system.domain_yada.ThematicMapDomain; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author taco chen + */ +public interface ThematicMapMapper { + + /** + * 获取所有专题图 + * @return + */ + List selectAllThematicMap(); + + /** + * 删除专题图根据编号 + * @param id 编号 + * @return + */ + Integer deleteThematicMap(Long id); + + /** + * 保存专题图 + * @param thematicMapDomain + * @return + */ + Integer saveThematicMap(ThematicMapDomain thematicMapDomain); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ThematicMapService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ThematicMapService.java new file mode 100644 index 000000000..2c46ef4b6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ThematicMapService.java @@ -0,0 +1,36 @@ +package com.ruoyi.system.service_yada; + +import com.ruoyi.system.domain_yada.ThematicMapDomain; + +import java.util.List; + +/** + * 专题图服务 + * @Author: taco chen + * @Date: 2022/5/11 11:40 + */ +public interface ThematicMapService { + + + /** + * 获取全部专题图 + * @return + */ + List selectAll(); + + /** + * 删除专题图根据编号 + * @param id 编号 + * @return + */ + Integer deleteById(Long id); + + /** + * 保存专题图 + * @param thematicMapDomain + * @return + */ + Integer save(ThematicMapDomain thematicMapDomain); + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/ThematicMapServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/ThematicMapServiceImpl.java new file mode 100644 index 000000000..3231ee023 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/ThematicMapServiceImpl.java @@ -0,0 +1,49 @@ +package com.ruoyi.system.service_yada.impl; + +import com.ruoyi.system.domain_yada.ThematicMapDomain; +import com.ruoyi.system.mapper_yada.ThematicMapMapper; +import com.ruoyi.system.service_yada.ThematicMapService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * * 专题图服务 + * @author : taco chen + */ +@Service +public class ThematicMapServiceImpl implements ThematicMapService { + + @Resource + private ThematicMapMapper thematicMapMapper; + + /** + * 获取全部专题图 + * @return + */ + @Override + public List selectAll(){ + return thematicMapMapper.selectAllThematicMap(); + } + + /** + * 删除专题图根据编号 + * @param id 编号 + * @return + */ + @Override + public Integer deleteById(Long id){ + return thematicMapMapper.deleteThematicMap(id); + } + + /** + * 保存专题图 + * @param thematicMapDomain + * @return + */ + @Override + public Integer save(ThematicMapDomain thematicMapDomain){ + return thematicMapMapper.saveThematicMap(thematicMapDomain); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/ThematicMapMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ThematicMapMapper.xml new file mode 100644 index 000000000..8bc6ab2a5 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ThematicMapMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM thematic_map + WHERE ID=#{id} + + + + + + + \ No newline at end of file