Procházet zdrojové kódy

房屋 项目管理 以及 mybatisplus增强

Newspaper před 1 měsícem
rodič
revize
5aeb51b371
29 změnil soubory, kde provedl 1443 přidání a 193 odebrání
  1. 1 1
      app-admin/src/main/java/com/ruoyi/RuoYiJssApplication.java
  2. 115 0
      app-admin/src/main/java/com/ruoyi/web/controller/system/HouseInfoController.java
  3. 4 7
      app-admin/src/main/java/com/ruoyi/web/controller/system/PersonInfoController.java
  4. 127 0
      app-admin/src/main/java/com/ruoyi/web/controller/system/ProjectsController.java
  5. 97 0
      app-admin/src/main/java/com/ruoyi/web/domain/dto/house/HouseInfoQueryRequest.java
  6. 2 10
      app-admin/src/main/java/com/ruoyi/web/domain/dto/person/PersonInfoQueryRequest.java
  7. 36 0
      app-admin/src/main/java/com/ruoyi/web/domain/dto/projects/ProjectsQueryRequest.java
  8. 118 0
      app-admin/src/main/java/com/ruoyi/web/domain/entity/HouseInfo.java
  9. 78 0
      app-admin/src/main/java/com/ruoyi/web/domain/entity/Projects.java
  10. 129 0
      app-admin/src/main/java/com/ruoyi/web/domain/vo/HouseInfoVO.java
  11. 67 0
      app-admin/src/main/java/com/ruoyi/web/domain/vo/ProjectsVO.java
  12. 16 0
      app-admin/src/main/java/com/ruoyi/web/mapper/HouseInfoMapper.java
  13. 1 1
      app-admin/src/main/java/com/ruoyi/web/domain/mapper/PersonInfoMapper.java
  14. 16 0
      app-admin/src/main/java/com/ruoyi/web/mapper/ProjectsMapper.java
  15. 41 0
      app-admin/src/main/java/com/ruoyi/web/service/HouseInfoService.java
  16. 1 2
      app-admin/src/main/java/com/ruoyi/web/domain/service/PersonInfoService.java
  17. 41 0
      app-admin/src/main/java/com/ruoyi/web/service/ProjectsService.java
  18. 137 0
      app-admin/src/main/java/com/ruoyi/web/service/impl/HouseInfoServiceImpl.java
  19. 9 30
      app-admin/src/main/java/com/ruoyi/web/domain/service/impl/PersonInfoServiceImpl.java
  20. 100 0
      app-admin/src/main/java/com/ruoyi/web/service/impl/ProjectsServiceImpl.java
  21. 16 9
      app-admin/src/main/resources/application.yml
  22. 39 0
      app-admin/src/main/resources/mapper/web/HouseInfoMapper.xml
  23. 1 1
      app-admin/src/main/resources/mapper/PersonInfoMapper.xml
  24. 27 0
      app-admin/src/main/resources/mapper/web/ProjectsMapper.xml
  25. 13 0
      app-common/pom.xml
  26. 6 1
      app-framework/pom.xml
  27. 104 115
      app-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java
  28. 62 0
      app-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java
  29. 39 16
      sql/sql.sql

+ 1 - 1
app-admin/src/main/java/com/ruoyi/RuoYiJssApplication.java

@@ -14,7 +14,7 @@ import org.springframework.context.ApplicationContext;
  * @author ruoyi
  */
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
-@MapperScan("com.ruoyi.web.domain.mapper")
+@MapperScan("com.ruoyi.web.mapper")
 public class RuoYiJssApplication
 {
     public static void main(String[] args) throws Exception

+ 115 - 0
app-admin/src/main/java/com/ruoyi/web/controller/system/HouseInfoController.java

@@ -0,0 +1,115 @@
+package com.ruoyi.web.controller.system;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.web.domain.dto.house.HouseInfoQueryRequest;
+import com.ruoyi.web.domain.entity.HouseInfo;
+import com.ruoyi.web.domain.vo.HouseInfoVO;
+import com.ruoyi.web.service.HouseInfoService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+import static com.ruoyi.common.core.domain.AjaxResult.error;
+import static com.ruoyi.common.core.domain.AjaxResult.success;
+
+@Api("房屋信息管理")
+@RestController
+@RequestMapping("/system/houseinfo")
+public class HouseInfoController {
+
+    @Autowired
+    private HouseInfoService houseInfoService;
+
+    /**
+     * 根据 id 查询房屋信息
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation("根据 id 查询房屋信息")
+    @GetMapping("/get")
+    public AjaxResult getHouseById(Long id) {
+        if (id <= 0) {
+            return error("请求参数异常");
+        }
+        HouseInfo houseInfo = houseInfoService.getById(id);
+        if (houseInfo == null) {
+            return success("未查到数据");
+        }
+        return success(houseInfo);
+    }
+
+    /**
+     * 查询房屋信息列表
+     *
+     * @param houseInfoQueryRequest
+     * @return
+     */
+    @ApiOperation("查询房屋信息列表")
+    @PostMapping("/list")
+    public AjaxResult listHouseInfo(@RequestBody HouseInfoQueryRequest houseInfoQueryRequest) {
+        List<HouseInfoVO> houseInfoVOList = houseInfoService.getHouseInfo(houseInfoQueryRequest);
+        return success(houseInfoVOList);
+    }
+
+    /**
+     * 分页获取房屋列表  mybatis-plus
+     *
+     * @param houseInfoQueryRequest
+     * @return
+     */
+    @ApiOperation("分页获取房屋列表")
+    @PostMapping("/list/page")
+    public AjaxResult listHouseInfoByPage(@RequestBody HouseInfoQueryRequest houseInfoQueryRequest) {
+        if (houseInfoQueryRequest == null) {
+            return error("请求参数为空");
+        }
+        Page<HouseInfo> listHouseInfoByPage = houseInfoService.getListHouseInfoByPage(houseInfoQueryRequest);
+        return success(listHouseInfoByPage);
+    }
+
+//    /**
+//     * 分页获取房屋列表(封装类)
+//     */
+//    public AjaxResult listHouseInfoVOByPage(HouseInfoQueryRequest houseInfoQueryRequest,
+//                                                             HttpServletRequest request) {
+//        long current = pictureQueryRequest.getCurrent();
+//        long size = pictureQueryRequest.getPageSize();
+//        // 限制爬虫
+//        ThrowUtils.throwIf(size > 20, ErrorCode.PARAMS_ERROR);
+//
+//        // 空间权限校验
+//        Long spaceId = pictureQueryRequest.getSpaceId();
+//        if(spaceId == null){
+//            // 公共图库
+//            // 普通用户默认只能看到审核通过的数据
+//            pictureQueryRequest.setReviewStatus(PictureReviewStatusEnum.PASS.getValue());
+//            pictureQueryRequest.setNullSpaceId(true);
+//        }else{
+//            boolean hasPermission = StpKit.SPACE.hasPermission(SpaceUserPermissionConstant.PICTURE_VIEW);
+//            ThrowUtils.throwIf(!hasPermission, ErrorCode.NO_AUTH_ERROR);
+//            // 已经改为注解鉴权
+//            // 私有图库
+//            // 普通用户默认只能看到审核通过的数据
+////            User loginUser = userClient.getLoginUser(request);
+////            Space space = spaceService.getById(spaceId);
+////            ThrowUtils.throwIf(space == null , ErrorCode.NOT_FOUND_ERROR,"空间不存在");
+////            if(!loginUser.getId().equals(space.getUserId())){
+////                throw new BusinessException(ErrorCode.NO_AUTH_ERROR,"没有空间权限");
+////            }
+//            pictureQueryRequest.setReviewStatus(PictureReviewStatusEnum.PASS.getValue());
+//            pictureQueryRequest.setNullSpaceId(false);
+//        }
+//        // 查询数据库
+//        Page<Picture> picturePage = pictureService.page(new Page<>(current, size),
+//                pictureService.getQueryWrapper(pictureQueryRequest));
+//        // 获取封装类
+//        return ResultUtils.success(pictureService.getPictureVOPage(picturePage, request));
+//    }
+
+
+}

+ 4 - 7
app-admin/src/main/java/com/ruoyi/web/controller/system/PersonInfoController.java

@@ -1,17 +1,14 @@
 package com.ruoyi.web.controller.system;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.web.domain.dto.person.PersonInfoQueryRequest;
 import com.ruoyi.web.domain.entity.PersonInfo;
-import com.ruoyi.web.domain.service.PersonInfoService;
+import com.ruoyi.web.service.PersonInfoService;
 import com.ruoyi.web.domain.vo.PersonInfoVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import java.util.List;
 import static com.ruoyi.common.core.domain.AjaxResult.error;
@@ -33,7 +30,7 @@ public class PersonInfoController{
      */
     @ApiOperation("根据 id 查询人员信息")
     @GetMapping("/get")
-    public AjaxResult getUserById(Long id) {
+    public AjaxResult getPersonById(Long id) {
         if (id <= 0) {
             return error("请求参数异常");
         }
@@ -51,7 +48,7 @@ public class PersonInfoController{
      * @return
      */
     @ApiOperation("查询人员信息列表")
-    @GetMapping("/list")
+    @PostMapping("/list")
     public AjaxResult listPersonInfo(@RequestBody PersonInfoQueryRequest personInfoQueryRequest) {
         List<PersonInfoVO> personInfoVOList = personInfoService.getPersonInfo(personInfoQueryRequest);
         return success(personInfoVOList);
@@ -64,7 +61,7 @@ public class PersonInfoController{
      * @return
      */
     @ApiOperation("分页获取人员列表")
-    @GetMapping("/list/page")
+    @PostMapping("/list/page")
     public AjaxResult listPersonInfoByPage(@RequestBody PersonInfoQueryRequest personInfoQueryRequest) {
         if (personInfoQueryRequest == null) {
             return error("请求参数为空");

+ 127 - 0
app-admin/src/main/java/com/ruoyi/web/controller/system/ProjectsController.java

@@ -0,0 +1,127 @@
+package com.ruoyi.web.controller.system;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.web.domain.dto.projects.ProjectsQueryRequest;
+import com.ruoyi.web.domain.entity.Projects;
+import com.ruoyi.web.domain.vo.ProjectsVO;
+import com.ruoyi.web.service.ProjectsService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+import static com.ruoyi.common.core.domain.AjaxResult.error;
+import static com.ruoyi.common.core.domain.AjaxResult.success;
+
+@Api("项目信息管理")
+@RestController
+@RequestMapping("/system/projects")
+public class ProjectsController {
+
+    @Autowired
+    private ProjectsService projectsService;
+
+    /**
+     * 根据 id 查询项目信息
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation("根据 id 查询项目信息")
+    @GetMapping("/get")
+    public AjaxResult getProjectsById(Long id) {
+        if (id <= 0) {
+            return error("请求参数异常");
+        }
+        Projects projects = projectsService.getById(id);
+        if (projects == null){
+            return success("未查到数据");
+        }
+        return success(projects);
+    }
+
+    /**
+     * 查询项目信息列表
+     *
+     * @param projectsQueryRequest
+     * @return
+     */
+    @ApiOperation("查询项目信息列表")
+    @PostMapping("/list")
+    public AjaxResult listProjects(@RequestBody ProjectsQueryRequest projectsQueryRequest) {
+        List<ProjectsVO> projectsVOList = projectsService.getProjects(projectsQueryRequest);
+        return success(projectsVOList);
+    }
+
+    /**
+     * 分页获取项目列表  mybatis-plus
+     *
+     * @param projectsQueryRequest
+     * @return
+     */
+    @ApiOperation("分页获取项目列表")
+    @PostMapping("/list/page")
+    public AjaxResult listProjectsByPage(@RequestBody ProjectsQueryRequest projectsQueryRequest) {
+        if (projectsQueryRequest == null) {
+            return error("请求参数为空");
+        }
+        Page<Projects> listProjectsByPage = projectsService.getListProjectsByPage(projectsQueryRequest);
+        return success(listProjectsByPage);
+    }
+
+    /**
+     * 查询项目信息列表
+     */
+    //@PreAuthorize("@ss.hasPermi('system:info:list')")
+//    @GetMapping("/list")
+//    public TableDataInfo list(Projects projects)
+//    {
+//        startPage();
+//        List<Projects> list = projectsService.selectProjectsList(projects);
+//        return getDataTable(list);
+//    }
+
+//    /**
+//     * 分页获取项目列表(封装类)
+//     */
+//    public AjaxResult listProjectsVOByPage(ProjectsQueryRequest projectsQueryRequest,
+//                                                             HttpServletRequest request) {
+//        long current = pictureQueryRequest.getCurrent();
+//        long size = pictureQueryRequest.getPageSize();
+//        // 限制爬虫
+//        ThrowUtils.throwIf(size > 20, ErrorCode.PARAMS_ERROR);
+//
+//        // 空间权限校验
+//        Long spaceId = pictureQueryRequest.getSpaceId();
+//        if(spaceId == null){
+//            // 公共图库
+//            // 普通用户默认只能看到审核通过的数据
+//            pictureQueryRequest.setReviewStatus(PictureReviewStatusEnum.PASS.getValue());
+//            pictureQueryRequest.setNullSpaceId(true);
+//        }else{
+//            boolean hasPermission = StpKit.SPACE.hasPermission(SpaceUserPermissionConstant.PICTURE_VIEW);
+//            ThrowUtils.throwIf(!hasPermission, ErrorCode.NO_AUTH_ERROR);
+//            // 已经改为注解鉴权
+//            // 私有图库
+//            // 普通用户默认只能看到审核通过的数据
+////            User loginUser = userClient.getLoginUser(request);
+////            Space space = spaceService.getById(spaceId);
+////            ThrowUtils.throwIf(space == null , ErrorCode.NOT_FOUND_ERROR,"空间不存在");
+////            if(!loginUser.getId().equals(space.getUserId())){
+////                throw new BusinessException(ErrorCode.NO_AUTH_ERROR,"没有空间权限");
+////            }
+//            pictureQueryRequest.setReviewStatus(PictureReviewStatusEnum.PASS.getValue());
+//            pictureQueryRequest.setNullSpaceId(false);
+//        }
+//        // 查询数据库
+//        Page<Picture> picturePage = pictureService.page(new Page<>(current, size),
+//                pictureService.getQueryWrapper(pictureQueryRequest));
+//        // 获取封装类
+//        return ResultUtils.success(pictureService.getPictureVOPage(picturePage, request));
+//    }
+
+
+}

+ 97 - 0
app-admin/src/main/java/com/ruoyi/web/domain/dto/house/HouseInfoQueryRequest.java

@@ -0,0 +1,97 @@
+package com.ruoyi.web.domain.dto.house;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.ruoyi.web.common.PageRequest;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 房屋 查询请求
+ *
+ * @TableName house_info
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class HouseInfoQueryRequest extends PageRequest implements Serializable {
+    /**
+     * 房屋ID
+     */
+    private Integer id;
+
+    /**
+     * 房屋编号(如FW0000580689)
+     */
+    private String houseCode;
+
+    /**
+     * 所属行政村ID
+     */
+    private Integer villageId;
+
+    /**
+     * 所属行政村名称
+     */
+    private String villageName;
+
+    /**
+     * 门牌号
+     */
+    private String doorplateNumber;
+
+    /**
+     * 房屋详细地址
+     */
+    private String houseAddress;
+
+    /**
+     * 房主人员ID
+     */
+    private Integer houseOwnerId;
+
+    /**
+     * 房主姓名
+     */
+    private String houseOwnerName;
+
+    /**
+     * 房主身份证号
+     */
+    private String idCard;
+
+    /**
+     * 房主电话
+     */
+    private String phone;
+
+    /**
+     * 房屋性质:1-自建房,2-商铺,3-公租房
+     */
+    private Integer houseType;
+
+    /**
+     * 房屋类别:1-修缮,2-原址重建,3-集中安置
+     */
+    private Integer houseCategory;
+
+    /**
+     * 宅基地面积(㎡)
+     */
+    private BigDecimal buildingArea;
+
+    /**
+     * 所属网格ID
+     */
+    private Integer gridId;
+
+    /**
+     * 家庭标签(JSON数组)
+     */
+    private List<String> houseTags;
+
+    private static final long serialVersionUID = 1L;
+}

+ 2 - 10
app-admin/src/main/java/com/ruoyi/web/domain/dto/person/PersonInfoQueryRequest.java

@@ -1,7 +1,6 @@
 package com.ruoyi.web.domain.dto.person;
 
 import com.ruoyi.web.common.PageRequest;
-import com.ruoyi.web.common.PageRequest2;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -12,6 +11,7 @@ import java.util.List;
 /**
  * 用户查询请求
  */
+@EqualsAndHashCode(callSuper = true)
 @Data
 public class PersonInfoQueryRequest extends PageRequest implements Serializable {
     //姓名、民族、房屋门牌号、特殊身份、人口标签
@@ -85,13 +85,5 @@ public class PersonInfoQueryRequest extends PageRequest implements Serializable
      */
     private String specialIdentity;
 
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-
-    /**
-     * 修改时间
-     */
-    private Date updateTime;
+    private static final long serialVersionUID = 1L;
 }

+ 36 - 0
app-admin/src/main/java/com/ruoyi/web/domain/dto/projects/ProjectsQueryRequest.java

@@ -0,0 +1,36 @@
+package com.ruoyi.web.domain.dto.projects;
+
+import com.ruoyi.web.common.PageRequest;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * 项目查询请求
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class ProjectsQueryRequest extends PageRequest implements Serializable {
+    /**
+     * 项目ID
+     */
+    private Integer id;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 项目内容
+     */
+    private String projectDescription;
+
+    /**
+     * 项目进度(0-建设中 1-已建成)
+     */
+    private Integer progress;
+
+    private static final long serialVersionUID = 1L;
+}

+ 118 - 0
app-admin/src/main/java/com/ruoyi/web/domain/entity/HouseInfo.java

@@ -0,0 +1,118 @@
+package com.ruoyi.web.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * 房屋信息表
+ *
+ * @TableName house_info
+ */
+@TableName(value = "house_info")
+@Data
+public class HouseInfo implements Serializable {
+    /**
+     * 房屋ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 房屋编号(如FW0000580689)
+     */
+    private String houseCode;
+
+    /**
+     * 所属行政村ID
+     */
+    private Integer villageId;
+
+    /**
+     * 所属行政村名称
+     */
+    private String villageName;
+
+    /**
+     * 门牌号
+     */
+    private String doorplateNumber;
+
+    /**
+     * 房屋详细地址
+     */
+    private String houseAddress;
+
+    /**
+     * 房主人员ID
+     */
+    private Integer houseOwnerId;
+
+    /**
+     * 总积分
+     */
+    private Integer totalPoints;
+
+    /**
+     * 剩余积分
+     */
+    private Integer remainingPoints;
+
+    /**
+     * 房屋性质:1-自建房,2-商铺,3-公租房
+     */
+    private Integer houseType;
+
+    /**
+     * 房屋类别:1-修缮,2-原址重建,3-集中安置
+     */
+    private Integer houseCategory;
+
+    /**
+     * 宅基地面积(㎡)
+     */
+    private BigDecimal buildingArea;
+
+    /**
+     * 所属网格ID
+     */
+    private Integer gridId;
+
+    /**
+     * 照片URL
+     */
+    private String photoUrl;
+
+    /**
+     * 家庭标签(JSON数组)
+     */
+    private String houseTags;
+
+    /**
+     * 门牌二维码图片URL
+     */
+    private String qrCodeUrl;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    /**
+     * 删除标志
+     */
+    @TableLogic
+    private String delFlag;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 78 - 0
app-admin/src/main/java/com/ruoyi/web/domain/entity/Projects.java

@@ -0,0 +1,78 @@
+package com.ruoyi.web.domain.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * 项目表
+ *
+ * @TableName projects
+ */
+@TableName(value = "projects")
+@Data
+public class Projects implements Serializable {
+    /**
+     * 项目ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 项目内容
+     */
+    private String projectDescription;
+
+    /**
+     * 投资金额(元)
+     */
+    private BigDecimal investmentAmount;
+
+    /**
+     * 项目开始日期
+     */
+    private Date startDate;
+
+    /**
+     * 预计建成日期
+     */
+    private Date estimatedCompletionDate;
+
+    /**
+     * 实际建成日期
+     */
+    private Date actualCompletionDate;
+
+    /**
+     * 项目进度(0-建设中 1-已建成)
+     */
+    private Integer progress;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    /**
+     * 删除标志
+     */
+    @TableLogic
+    private String delFlag;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 129 - 0
app-admin/src/main/java/com/ruoyi/web/domain/vo/HouseInfoVO.java

@@ -0,0 +1,129 @@
+package com.ruoyi.web.domain.vo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 房屋信息视图类
+ *
+ * @TableName house_info
+ */
+@TableName(value = "house_info")
+@Data
+public class HouseInfoVO implements Serializable {
+    /**
+     * 房屋ID
+     */
+    private Integer id;
+
+    /**
+     * 房屋编号(如FW0000580689)
+     */
+    private String houseCode;
+
+    /**
+     * 所属行政村ID
+     */
+    private Integer villageId;
+
+    /**
+     * 所属行政村名称
+     */
+    private String villageName;
+
+    /**
+     * 门牌号
+     */
+    private String doorplateNumber;
+
+    /**
+     * 房屋详细地址
+     */
+    private String houseAddress;
+
+    /**
+     * 房主人员信息(姓名/身份证号/电话)
+     */
+    private PersonInfoVO houseOwnerInfo;
+
+//    /**
+//     * 房主人员ID
+//     */
+//    private Integer houseOwnerId;
+//
+//    /**
+//     * 房主姓名
+//     */
+//    private String houseOwnerName;
+//
+//    /**
+//     * 房主身份证号
+//     */
+//    private String idCard;
+//
+//    /**
+//     * 房主电话
+//     */
+//    private String phone;
+
+    /**
+     * 总积分
+     */
+    private Integer totalPoints;
+
+    /**
+     * 剩余积分
+     */
+    private Integer remainingPoints;
+
+    /**
+     * 房屋性质:1-自建房,2-商铺,3-公租房
+     */
+    private Integer houseType;
+
+    /**
+     * 房屋类别:1-修缮,2-原址重建,3-集中安置
+     */
+    private Integer houseCategory;
+
+    /**
+     * 宅基地面积(㎡)
+     */
+    private BigDecimal buildingArea;
+
+    /**
+     * 所属网格ID
+     */
+    private Integer gridId;
+
+    /**
+     * 照片URL
+     */
+    private String photoUrl;
+
+    /**
+     * 家庭标签(JSON数组)
+     */
+    private String houseTags;
+
+    /**
+     * 门牌二维码图片URL
+     */
+    private String qrCodeUrl;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+}

+ 67 - 0
app-admin/src/main/java/com/ruoyi/web/domain/vo/ProjectsVO.java

@@ -0,0 +1,67 @@
+package com.ruoyi.web.domain.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 项目 视图
+ *
+ * @TableName projects
+ */
+@Data
+public class ProjectsVO implements Serializable {
+    /**
+     * 项目ID
+     */
+    private Integer id;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 项目内容
+     */
+    private String projectDescription;
+
+    /**
+     * 投资金额(元)
+     */
+    private BigDecimal investmentAmount;
+
+    /**
+     * 项目开始日期
+     */
+    private Date startDate;
+
+    /**
+     * 预计建成日期
+     */
+    private Date estimatedCompletionDate;
+
+    /**
+     * 实际建成日期
+     */
+    private Date actualCompletionDate;
+
+    /**
+     * 项目进度(0-建设中 1-已建成)
+     */
+    private Integer progress;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+}

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/mapper/HouseInfoMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.web.domain.entity.HouseInfo;
+
+/**
+ * @Entity generator.domain.HouseInfo
+ */
+public interface HouseInfoMapper extends BaseMapper<HouseInfo> {
+
+}
+
+
+
+

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/domain/mapper/PersonInfoMapper.java

@@ -1,4 +1,4 @@
-package com.ruoyi.web.domain.mapper;
+package com.ruoyi.web.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;

+ 16 - 0
app-admin/src/main/java/com/ruoyi/web/mapper/ProjectsMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.web.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.web.domain.entity.Projects;
+
+/**
+ * @Entity generator.domain.Projects
+ */
+public interface ProjectsMapper extends BaseMapper<Projects> {
+
+}
+
+
+
+

+ 41 - 0
app-admin/src/main/java/com/ruoyi/web/service/HouseInfoService.java

@@ -0,0 +1,41 @@
+package com.ruoyi.web.service;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.web.domain.dto.house.HouseInfoQueryRequest;
+import com.ruoyi.web.domain.entity.HouseInfo;
+import com.ruoyi.web.domain.vo.HouseInfoVO;
+
+import java.util.List;
+
+/**
+ *
+ */
+public interface HouseInfoService extends IService<HouseInfo> {
+    /**
+     * 查询人员信息列表
+     *
+     * @param houseInfoQueryRequest
+     * @return
+     */
+    List<HouseInfoVO> getHouseInfo(HouseInfoQueryRequest houseInfoQueryRequest);
+
+    /**
+     * 分页获取人员列表
+     *
+     * @param houseInfoQueryRequest
+     * @return
+     */
+    Page<HouseInfo> getListHouseInfoByPage(HouseInfoQueryRequest houseInfoQueryRequest);
+
+
+    /**
+     * 获取查询条件
+     *
+     * @param houseInfoQueryRequest
+     * @return
+     */
+    QueryWrapper<HouseInfo> getQueryWrapper(HouseInfoQueryRequest houseInfoQueryRequest);
+}

+ 1 - 2
app-admin/src/main/java/com/ruoyi/web/domain/service/PersonInfoService.java

@@ -1,5 +1,4 @@
-package com.ruoyi.web.domain.service;
-
+package com.ruoyi.web.service;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

+ 41 - 0
app-admin/src/main/java/com/ruoyi/web/service/ProjectsService.java

@@ -0,0 +1,41 @@
+package com.ruoyi.web.service;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.web.domain.dto.projects.ProjectsQueryRequest;
+import com.ruoyi.web.domain.entity.Projects;
+import com.ruoyi.web.domain.vo.ProjectsVO;
+
+import java.util.List;
+
+/**
+ *
+ */
+public interface ProjectsService extends IService<Projects> {
+    /**
+     * 查询项目信息列表
+     *
+     * @param projectsQueryRequest
+     * @return
+     */
+    List<ProjectsVO> getProjects(ProjectsQueryRequest projectsQueryRequest);
+
+    /**
+     * 分页获取项目列表
+     *
+     * @param projectsQueryRequest
+     * @return
+     */
+    Page<Projects> getListProjectsByPage(ProjectsQueryRequest projectsQueryRequest);
+
+
+    /**
+     * 获取查询条件
+     *
+     * @param projectsQueryRequest
+     * @return
+     */
+    QueryWrapper<Projects> getQueryWrapper(ProjectsQueryRequest projectsQueryRequest);
+}

+ 137 - 0
app-admin/src/main/java/com/ruoyi/web/service/impl/HouseInfoServiceImpl.java

@@ -0,0 +1,137 @@
+package com.ruoyi.web.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.bean.BeanUtils;
+import com.ruoyi.web.domain.dto.house.HouseInfoQueryRequest;
+import com.ruoyi.web.domain.entity.HouseInfo;
+import com.ruoyi.web.domain.entity.PersonInfo;
+import com.ruoyi.web.domain.vo.HouseInfoVO;
+import com.ruoyi.web.domain.vo.PersonInfoVO;
+import com.ruoyi.web.mapper.HouseInfoMapper;
+import com.ruoyi.web.service.HouseInfoService;
+import com.ruoyi.web.service.PersonInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ *
+ */
+@Service
+public class HouseInfoServiceImpl extends ServiceImpl<HouseInfoMapper, HouseInfo>
+        implements HouseInfoService {
+
+    @Autowired
+    private PersonInfoService personInfoService;
+
+    /**
+     * 查询人员信息列表
+     *
+     * @param houseInfoQueryRequest
+     * @return
+     */
+    @Override
+    public List<HouseInfoVO> getHouseInfo(HouseInfoQueryRequest houseInfoQueryRequest) {
+        HouseInfo houseInfoQuery = new HouseInfo();
+        if (houseInfoQueryRequest != null) {
+            BeanUtils.copyProperties(houseInfoQueryRequest, houseInfoQuery);
+        }
+        QueryWrapper<HouseInfo> queryWrapper = new QueryWrapper<>(houseInfoQuery);
+        List<HouseInfo> houseInfoList = this.list(queryWrapper);
+        // houseOwnerId
+        return houseInfoList.stream().map(houseInfo -> {
+            // 通过房主id 查询房主信息 填充返回
+            HouseInfoVO houseInfoVO = new HouseInfoVO();
+            BeanUtils.copyProperties(houseInfo, houseInfoVO);
+
+            Integer houseOwnerId = houseInfo.getHouseOwnerId();
+            PersonInfo houseOwnerInfo = personInfoService.getById(houseOwnerId);
+            PersonInfoVO houseOwnerInfoVO = new PersonInfoVO();
+            BeanUtils.copyProperties(houseOwnerInfo, houseOwnerInfoVO);
+
+            houseInfoVO.setHouseOwnerInfo(houseOwnerInfoVO);
+            return houseInfoVO;
+        }).collect(Collectors.toList());
+    }
+
+    /**
+     * 分页获取人员列表
+     *
+     * @param houseInfoQueryRequest
+     * @return
+     */
+    @Override
+    public Page<HouseInfo> getListHouseInfoByPage(HouseInfoQueryRequest houseInfoQueryRequest) {
+        long current = houseInfoQueryRequest.getCurrent();
+        long size = houseInfoQueryRequest.getPageSize();
+        Page<HouseInfo> houseInfoPage = this.page(new Page<>(current, size),
+                getQueryWrapper(houseInfoQueryRequest));
+        return houseInfoPage;
+    }
+
+
+    /**
+     * 获取查询条件
+     *
+     * @param houseInfoQueryRequest
+     * @return
+     */
+    @Override
+    public QueryWrapper<HouseInfo> getQueryWrapper(HouseInfoQueryRequest houseInfoQueryRequest) {
+        QueryWrapper<HouseInfo> queryWrapper = new QueryWrapper<>();
+        if (houseInfoQueryRequest == null) {
+            return queryWrapper;
+        }
+
+        // 从对象中取值
+        Integer id = houseInfoQueryRequest.getId();
+        String houseCode = houseInfoQueryRequest.getHouseCode();
+        Integer villageId = houseInfoQueryRequest.getVillageId();
+        String villageName = houseInfoQueryRequest.getVillageName();
+        String doorplateNumber = houseInfoQueryRequest.getDoorplateNumber();
+        String houseAddress = houseInfoQueryRequest.getHouseAddress();
+        Integer houseOwnerId = houseInfoQueryRequest.getHouseOwnerId();
+        String houseOwnerName = houseInfoQueryRequest.getHouseOwnerName();
+        String idCard = houseInfoQueryRequest.getIdCard();
+        String phone = houseInfoQueryRequest.getPhone();
+        Integer houseType = houseInfoQueryRequest.getHouseType();
+        Integer houseCategory = houseInfoQueryRequest.getHouseCategory();
+        BigDecimal buildingArea = houseInfoQueryRequest.getBuildingArea();
+        Integer gridId = houseInfoQueryRequest.getGridId();
+        List<String> houseTags = houseInfoQueryRequest.getHouseTags();
+        String sortField = houseInfoQueryRequest.getSortField();
+        String sortOrder = houseInfoQueryRequest.getSortOrder();
+
+        //门牌号、房主、房屋类别、所属网格、家庭标签
+        queryWrapper.eq(ObjectUtil.isNotEmpty(id), "id", id);
+        queryWrapper.eq(StrUtil.isNotBlank(houseCode), "house_code", houseCode);
+        queryWrapper.eq(StrUtil.isNotBlank(houseOwnerName), "houseOwner_name", houseOwnerName);
+        queryWrapper.eq(StrUtil.isNotBlank(idCard), "id_card", idCard);
+        queryWrapper.eq(StrUtil.isNotBlank(phone), "phone", phone);
+        queryWrapper.eq(ObjectUtil.isNotEmpty(gridId), "grid_id", gridId);
+        queryWrapper.eq(ObjectUtil.isNotEmpty(houseType), "house_type", houseType);
+        queryWrapper.eq(ObjectUtil.isNotEmpty(houseCategory), "house_category", houseCategory);
+
+        // 家庭标签 JSON 数组查询
+        if (CollUtil.isNotEmpty(houseTags)) {
+            for (String tag : houseTags) {
+                queryWrapper.like("house_tags", "\"" + tag + "\"");
+            }
+        }
+        // 排序
+        queryWrapper.orderBy(StrUtil.isNotEmpty(sortField), sortOrder.equals("ascend"), sortField);
+        return queryWrapper;
+    }
+}
+
+
+
+

+ 9 - 30
app-admin/src/main/java/com/ruoyi/web/domain/service/impl/PersonInfoServiceImpl.java

@@ -1,4 +1,4 @@
-package com.ruoyi.web.domain.service.impl;
+package com.ruoyi.web.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjectUtil;
@@ -10,14 +10,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.utils.bean.BeanUtils;
 import com.ruoyi.web.domain.dto.person.PersonInfoQueryRequest;
 import com.ruoyi.web.domain.entity.PersonInfo;
-import com.ruoyi.web.domain.mapper.PersonInfoMapper;
-import com.ruoyi.web.domain.service.PersonInfoService;
+import com.ruoyi.web.mapper.PersonInfoMapper;
+import com.ruoyi.web.service.PersonInfoService;
 import com.ruoyi.web.domain.vo.PersonInfoVO;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -29,10 +27,6 @@ import java.util.stream.Collectors;
 public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonInfo>
         implements PersonInfoService {
 
-
-    @Autowired
-    private PersonInfoMapper personInfoMapper;
-
     /**
      * 查询人员信息列表
      * @param personInfoQueryRequest
@@ -46,7 +40,6 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
         }
         QueryWrapper<PersonInfo> queryWrapper = new QueryWrapper<>(personInfoQuery);
         List<PersonInfo> personInfoList = this.list(queryWrapper);
-
         return personInfoList.stream().map(personInfo -> {
             PersonInfoVO personInfoVO = new PersonInfoVO();
             BeanUtils.copyProperties(personInfo, personInfoVO);
@@ -61,22 +54,8 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
      */
     @Override
     public Page<PersonInfo> getListPersonInfoByPage(PersonInfoQueryRequest personInfoQueryRequest) {
-//        PersonInfo personInfoQuery = new PersonInfo();
-//        BeanUtils.copyProperties(personInfoQueryRequest, personInfoQuery);
         long current = personInfoQueryRequest.getCurrent();
         long size = personInfoQueryRequest.getPageSize();
-
-//        String sortField = personInfoQueryRequest.getSortField();
-//        String sortOrder = personInfoQueryRequest.getSortOrder();
-//        //String content = personInfoQuery.getContent();
-//        // content 需支持模糊搜索
-//        //personInfoQuery.setContent(null);
-//
-//        QueryWrapper<PersonInfo> queryWrapper = new QueryWrapper<>(personInfoQuery);
-//        //queryWrapper.like(StringUtils.isNotBlank(content), "content", content);
-//        queryWrapper.orderBy(StringUtils.isNotBlank(sortField),
-//                sortOrder.equals("ascend"), sortField);
-
         return this.page(new Page<>(current, size),
                 getQueryWrapper(personInfoQueryRequest));
     }
@@ -115,15 +94,15 @@ public class PersonInfoServiceImpl extends ServiceImpl<PersonInfoMapper, PersonI
 
         // 姓名、民族、房屋门牌号、特殊身份、人口标签
         queryWrapper.eq(ObjectUtil.isNotEmpty(id), "id", id);
-        queryWrapper.eq(ObjectUtil.isNotEmpty(realname), "realname", realname);
-        queryWrapper.eq(ObjectUtil.isNotEmpty(idCard), "id_card", idCard);
-        queryWrapper.eq(ObjectUtil.isNotEmpty(ethnic), "ethnic", ethnic);
+        queryWrapper.eq(StrUtil.isNotBlank(realname), "realname", realname);
+        queryWrapper.eq(StrUtil.isNotBlank(idCard), "id_card", idCard);
+        queryWrapper.eq(StrUtil.isNotBlank(ethnic), "ethnic", ethnic);
         queryWrapper.eq(ObjectUtil.isNotEmpty(age), "age", age);
         queryWrapper.eq(ObjectUtil.isNotEmpty(gender), "gender", gender);
         queryWrapper.eq(ObjectUtil.isNotEmpty(populationCategory), "population_category", populationCategory);
-        queryWrapper.eq(ObjectUtil.isNotEmpty(phone), "phone", phone);
-        queryWrapper.eq(ObjectUtil.isNotEmpty(occupationId), "occupation_id", occupationId);
-        queryWrapper.eq(ObjectUtil.isNotEmpty(specialIdentity), "special_identity", specialIdentity);
+        queryWrapper.eq(StrUtil.isNotBlank(phone), "phone", phone);
+        queryWrapper.eq(StrUtil.isNotBlank(occupationId), "occupation_id", occupationId);
+        queryWrapper.eq(StrUtil.isNotBlank(specialIdentity), "special_identity", specialIdentity);
 
         // 人口标签 JSON 数组查询
         if(CollUtil.isNotEmpty(populationTags)){

+ 100 - 0
app-admin/src/main/java/com/ruoyi/web/service/impl/ProjectsServiceImpl.java

@@ -0,0 +1,100 @@
+package com.ruoyi.web.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import com.ruoyi.common.utils.bean.BeanUtils;
+import com.ruoyi.web.domain.dto.projects.ProjectsQueryRequest;
+import com.ruoyi.web.domain.entity.Projects;
+import com.ruoyi.web.domain.vo.ProjectsVO;
+import com.ruoyi.web.mapper.ProjectsMapper;
+import com.ruoyi.web.service.ProjectsService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ *
+ */
+@Service
+public class ProjectsServiceImpl extends ServiceImpl<ProjectsMapper, Projects>
+        implements ProjectsService {
+
+    /**
+     * 查询项目信息列表
+     *
+     * @param projectsQueryRequest
+     * @return
+     */
+    @Override
+    public List<ProjectsVO> getProjects(ProjectsQueryRequest projectsQueryRequest) {
+        Projects projectsQuery = new Projects();
+        if (projectsQueryRequest != null) {
+            BeanUtils.copyProperties(projectsQueryRequest, projectsQuery);
+        }
+        QueryWrapper<Projects> queryWrapper = new QueryWrapper<>(projectsQuery);
+        List<Projects> projectsList = this.list(queryWrapper);
+        return projectsList.stream().map(projects -> {
+            ProjectsVO projectsVO = new ProjectsVO();
+            BeanUtils.copyProperties(projects, projectsVO);
+            return projectsVO;
+        }).collect(Collectors.toList());
+    }
+
+    /**
+     * 分页获取项目列表
+     *
+     * @param projectsQueryRequest
+     * @return
+     */
+    @Override
+    public Page<Projects> getListProjectsByPage(ProjectsQueryRequest projectsQueryRequest) {
+        long current = projectsQueryRequest.getCurrent();
+        long size = projectsQueryRequest.getPageSize();
+        return this.page(new Page<>(current, size),
+                getQueryWrapper(projectsQueryRequest));
+    }
+
+    /**
+     * 获取查询条件
+     *
+     * @param projectsQueryRequest
+     * @return
+     */
+    @Override
+    public QueryWrapper<Projects> getQueryWrapper(ProjectsQueryRequest projectsQueryRequest) {
+        QueryWrapper<Projects> queryWrapper = new QueryWrapper<>();
+        if (projectsQueryRequest == null) {
+            return queryWrapper;
+        }
+
+        // 从对象中取值
+        Integer id = projectsQueryRequest.getId();
+        String projectName = projectsQueryRequest.getProjectName();
+        String projectDescription = projectsQueryRequest.getProjectDescription();
+        Integer progress = projectsQueryRequest.getProgress();
+        String sortField = projectsQueryRequest.getSortField();
+        String sortOrder = projectsQueryRequest.getSortOrder();
+
+        // 项目名称、项目描述 项目进度
+        queryWrapper.eq(ObjectUtil.isNotEmpty(id), "id", id);
+        queryWrapper.eq(StrUtil.isNotBlank(projectName), "project_name", projectName);
+        queryWrapper.like(StringUtils.isNotBlank(projectDescription), "project_description", projectDescription);
+        queryWrapper.eq(ObjectUtil.isNotEmpty(progress), "progress", progress);
+
+        // 排序
+        queryWrapper.orderBy(StrUtil.isNotEmpty(sortField), sortOrder.equals("ascend"), sortField);
+        return queryWrapper;
+    }
+}
+
+
+
+

+ 16 - 9
app-admin/src/main/resources/application.yml

@@ -100,7 +100,20 @@ token:
   expireTime: 30
 
 # MyBatis配置
-mybatis:
+#mybatis:
+#  # 搜索指定包别名
+#  typeAliasesPackage: com.ruoyi.**.domain
+#  # 配置mapper的扫描,找到所有的mapper.xml映射文件
+#  mapperLocations: classpath*:mapper/**/*Mapper.xml
+#  # 加载全局的配置文件
+#  configLocation: classpath:mybatis/mybatis-config.xml
+#  global-config:
+#    db-config:
+#      logic-delete-field: delFlag # 全局逻辑删除字段名
+#      logic-delete-value: 1 # 逻辑已删除值
+#      logic-not-delete-value: 0 # 逻辑未删除值
+
+mybatis-plus:
   # 搜索指定包别名
   typeAliasesPackage: com.ruoyi.**.domain
   # 配置mapper的扫描,找到所有的mapper.xml映射文件
@@ -109,12 +122,10 @@ mybatis:
   configLocation: classpath:mybatis/mybatis-config.xml
   global-config:
     db-config:
-      logic-delete-field: isDelete # 全局逻辑删除字段名
+      logic-delete-field: delFlag # 全局逻辑删除字段名
       logic-delete-value: 1 # 逻辑已删除值
       logic-not-delete-value: 0 # 逻辑未删除值
-
-
-
+#  mapper-locations: classpath*:mapper/*.xml
 
 # PageHelper分页插件
 pagehelper:
@@ -147,10 +158,6 @@ xss:
 #  #密码
 #  password: admin
 
-
-mybatis-plus:
-  mapper-locations: classpath*:mapper/*.xml
-
 #img:
 #  url: https://img.ifarmcloud.com/images/
 #  basePath: /home/huimv/img/

+ 39 - 0
app-admin/src/main/resources/mapper/web/HouseInfoMapper.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.web.mapper.HouseInfoMapper">
+
+    <resultMap id="BaseResultMap" type="com.ruoyi.web.domain.entity.HouseInfo">
+        <id property="id" column="id" jdbcType="INTEGER"/>
+        <result property="houseCode" column="house_code" jdbcType="VARCHAR"/>
+        <result property="villageId" column="village_id" jdbcType="INTEGER"/>
+        <result property="villageName" column="village_name" jdbcType="VARCHAR"/>
+        <result property="doorplateNumber" column="doorplate_number" jdbcType="VARCHAR"/>
+        <result property="houseAddress" column="house_address" jdbcType="VARCHAR"/>
+        <result property="houseOwnerId" column="house_owner_id" jdbcType="INTEGER"/>
+        <result property="totalPoints" column="total_points" jdbcType="INTEGER"/>
+        <result property="remainingPoints" column="remaining_points" jdbcType="INTEGER"/>
+        <result property="houseType" column="house_type" jdbcType="TINYINT"/>
+        <result property="houseCategory" column="house_category" jdbcType="TINYINT"/>
+        <result property="buildingArea" column="building_area" jdbcType="DECIMAL"/>
+        <result property="gridId" column="grid_id" jdbcType="INTEGER"/>
+        <result property="photoUrl" column="photo_url" jdbcType="VARCHAR"/>
+        <result property="houseTags" column="house_tags" jdbcType="VARCHAR"/>
+        <result property="qrCodeUrl" column="qr_code_url" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="delFlag" column="del_flag" jdbcType="CHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id
+        ,house_code,village_id,
+        village_name,doorplate_number,house_address,
+        house_owner_id,total_points,remaining_points,
+        house_type,house_category,building_area,
+        grid_id,photo_url,house_tags,
+        qr_code_url,create_time,update_time,
+        del_flag
+    </sql>
+</mapper>

+ 1 - 1
app-admin/src/main/resources/mapper/PersonInfoMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruoyi.web.domain.mapper.PersonInfoMapper">
+<mapper namespace="com.ruoyi.web.mapper.PersonInfoMapper">
 
     <resultMap id="BaseResultMap" type="com.ruoyi.web.domain.entity.PersonInfo">
         <id property="id" column="id" jdbcType="INTEGER"/>

+ 27 - 0
app-admin/src/main/resources/mapper/web/ProjectsMapper.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.web.mapper.ProjectsMapper">
+
+    <resultMap id="BaseResultMap" type="com.ruoyi.web.domain.entity.Projects">
+        <id property="id" column="id" jdbcType="INTEGER"/>
+        <result property="projectName" column="project_name" jdbcType="VARCHAR"/>
+        <result property="projectDescription" column="project_description" jdbcType="VARCHAR"/>
+        <result property="investmentAmount" column="investment_amount" jdbcType="DECIMAL"/>
+        <result property="startDate" column="start_date" jdbcType="DATE"/>
+        <result property="estimatedCompletionDate" column="estimated_completion_date" jdbcType="DATE"/>
+        <result property="actualCompletionDate" column="actual_completion_date" jdbcType="DATE"/>
+        <result property="progress" column="progress" jdbcType="TINYINT"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id
+        ,project_name,project_description,
+        investment_amount,start_date,estimated_completion_date,
+        actual_completion_date,progress,create_time,
+        update_time
+    </sql>
+</mapper>

+ 13 - 0
app-common/pom.xml

@@ -180,6 +180,19 @@
             <version>3.5.1</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.4.2</version>
+        </dependency>
+
+
 
     </dependencies>
 

+ 6 - 1
app-framework/pom.xml

@@ -58,13 +58,18 @@
             <groupId>com.ruoyi</groupId>
             <artifactId>app-system</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.4.2</version>
+        </dependency>
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-extension</artifactId>
             <version>3.5.3.1</version>
             <scope>compile</scope>
         </dependency>
-
     </dependencies>
 
 </project>

+ 104 - 115
app-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java

@@ -34,118 +34,107 @@ import com.ruoyi.common.utils.StringUtils;
  * 
  * @author ruoyi
  */
-@Configuration
-public class MyBatisConfig
-{
-    @Autowired
-    private Environment env;
-
-    static final String DEFAULT_RESOURCE_PATTERN = "**/*.class";
-
-    public static String setTypeAliasesPackage(String typeAliasesPackage)
-    {
-        ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver();
-        MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver);
-        List<String> allResult = new ArrayList<String>();
-        try
-        {
-            for (String aliasesPackage : typeAliasesPackage.split(","))
-            {
-                List<String> result = new ArrayList<String>();
-                aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
-                        + ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN;
-                Resource[] resources = resolver.getResources(aliasesPackage);
-                if (resources != null && resources.length > 0)
-                {
-                    MetadataReader metadataReader = null;
-                    for (Resource resource : resources)
-                    {
-                        if (resource.isReadable())
-                        {
-                            metadataReader = metadataReaderFactory.getMetadataReader(resource);
-                            try
-                            {
-                                result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName());
-                            }
-                            catch (ClassNotFoundException e)
-                            {
-                                e.printStackTrace();
-                            }
-                        }
-                    }
-                }
-                if (result.size() > 0)
-                {
-                    HashSet<String> hashResult = new HashSet<String>(result);
-                    allResult.addAll(hashResult);
-                }
-            }
-            if (allResult.size() > 0)
-            {
-                typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0]));
-            }
-            else
-            {
-                throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包");
-            }
-        }
-        catch (IOException e)
-        {
-            e.printStackTrace();
-        }
-        return typeAliasesPackage;
-    }
-
-    public Resource[] resolveMapperLocations(String[] mapperLocations)
-    {
-        ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();
-        List<Resource> resources = new ArrayList<Resource>();
-        if (mapperLocations != null)
-        {
-            for (String mapperLocation : mapperLocations)
-            {
-                try
-                {
-                    Resource[] mappers = resourceResolver.getResources(mapperLocation);
-                    resources.addAll(Arrays.asList(mappers));
-                }
-                catch (IOException e)
-                {
-                    // ignore
-                }
-            }
-        }
-        return resources.toArray(new Resource[resources.size()]);
-    }
-
-    @Bean
-    public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception
-    {
-        String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
-        String mapperLocations = env.getProperty("mybatis.mapperLocations");
-        String configLocation = env.getProperty("mybatis.configLocation");
-        typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
-        VFS.addImplClass(SpringBootVFS.class);
-
-        //final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
-        // SqlSessionFactoryBean 替换为 ⬇ MybatisSqlSessionFactoryBean
-        final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
-        sessionFactory.setDataSource(dataSource);
-        sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
-        sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
-        sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
-        return sessionFactory.getObject();
-    }
-
-    /**
-     * 添加 MyBatis-Plus 插件(包括分页插件)
-     */
-    @Bean
-    public MybatisPlusInterceptor mybatisPlusInterceptor() {
-        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
-        // 分页插件
-        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
-        return interceptor;
-    }
-
-}
+//@Configuration
+//public class MyBatisConfig
+//{
+//    @Autowired
+//    private Environment env;
+//
+//    static final String DEFAULT_RESOURCE_PATTERN = "**/*.class";
+//
+//    public static String setTypeAliasesPackage(String typeAliasesPackage)
+//    {
+//        ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver();
+//        MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver);
+//        List<String> allResult = new ArrayList<String>();
+//        try
+//        {
+//            for (String aliasesPackage : typeAliasesPackage.split(","))
+//            {
+//                List<String> result = new ArrayList<String>();
+//                aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
+//                        + ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN;
+//                Resource[] resources = resolver.getResources(aliasesPackage);
+//                if (resources != null && resources.length > 0)
+//                {
+//                    MetadataReader metadataReader = null;
+//                    for (Resource resource : resources)
+//                    {
+//                        if (resource.isReadable())
+//                        {
+//                            metadataReader = metadataReaderFactory.getMetadataReader(resource);
+//                            try
+//                            {
+//                                result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName());
+//                            }
+//                            catch (ClassNotFoundException e)
+//                            {
+//                                e.printStackTrace();
+//                            }
+//                        }
+//                    }
+//                }
+//                if (result.size() > 0)
+//                {
+//                    HashSet<String> hashResult = new HashSet<String>(result);
+//                    allResult.addAll(hashResult);
+//                }
+//            }
+//            if (allResult.size() > 0)
+//            {
+//                typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0]));
+//            }
+//            else
+//            {
+//                throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包");
+//            }
+//        }
+//        catch (IOException e)
+//        {
+//            e.printStackTrace();
+//        }
+//        return typeAliasesPackage;
+//    }
+//
+//    public Resource[] resolveMapperLocations(String[] mapperLocations)
+//    {
+//        ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();
+//        List<Resource> resources = new ArrayList<Resource>();
+//        if (mapperLocations != null)
+//        {
+//            for (String mapperLocation : mapperLocations)
+//            {
+//                try
+//                {
+//                    Resource[] mappers = resourceResolver.getResources(mapperLocation);
+//                    resources.addAll(Arrays.asList(mappers));
+//                }
+//                catch (IOException e)
+//                {
+//                    // ignore
+//                }
+//            }
+//        }
+//        return resources.toArray(new Resource[resources.size()]);
+//    }
+//
+//    @Bean
+//    public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception
+//    {
+//        String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
+//        String mapperLocations = env.getProperty("mybatis.mapperLocations");
+//        String configLocation = env.getProperty("mybatis.configLocation");
+//        typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
+//        VFS.addImplClass(SpringBootVFS.class);
+//
+//        //final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+//        // SqlSessionFactoryBean 替换为 ⬇ MybatisSqlSessionFactoryBean
+//        final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
+//        sessionFactory.setDataSource(dataSource);
+//        sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
+//        sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
+//        sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
+//        return sessionFactory.getObject();
+//    }
+//
+//}

+ 62 - 0
app-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java

@@ -0,0 +1,62 @@
+package com.ruoyi.framework.config;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * Mybatis Plus 配置
+ * 
+ * @author ruoyi
+ */
+@EnableTransactionManagement(proxyTargetClass = true)
+@Configuration
+public class MybatisPlusConfig
+{
+    @Bean
+    public MybatisPlusInterceptor mybatisPlusInterceptor()
+    {
+        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+        // 分页插件
+        interceptor.addInnerInterceptor(paginationInnerInterceptor());
+        // 乐观锁插件
+        interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor());
+        // 阻断插件
+        interceptor.addInnerInterceptor(blockAttackInnerInterceptor());
+        return interceptor;
+    }
+
+    /**
+     * 分页插件,自动识别数据库类型 https://baomidou.com/guide/interceptor-pagination.html
+     */
+    public PaginationInnerInterceptor paginationInnerInterceptor()
+    {
+        PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
+        // 设置数据库类型为mysql
+        paginationInnerInterceptor.setDbType(DbType.MYSQL);
+        // 设置最大单页限制数量,默认 500 条,-1 不受限制
+        paginationInnerInterceptor.setMaxLimit(-1L);
+        return paginationInnerInterceptor;
+    }
+
+    /**
+     * 乐观锁插件 https://baomidou.com/guide/interceptor-optimistic-locker.html
+     */
+    public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor()
+    {
+        return new OptimisticLockerInnerInterceptor();
+    }
+
+    /**
+     * 如果是对全表的删除或更新操作,就会终止该操作 https://baomidou.com/guide/interceptor-block-attack.html
+     */
+    public BlockAttackInnerInterceptor blockAttackInnerInterceptor()
+    {
+        return new BlockAttackInnerInterceptor();
+    }
+}

+ 39 - 16
sql/sql.sql

@@ -39,46 +39,51 @@ CREATE TABLE person_info (
 -- 户籍信息表
 CREATE TABLE household_info (
     id                      INT PRIMARY KEY AUTO_INCREMENT  COMMENT '户籍ID',
-    household_number        VARCHAR(50) UNIQUE  NOT NULL    COMMENT '户籍编号',
+    household_code        VARCHAR(50) UNIQUE  NOT NULL    COMMENT '户籍编号',
     household_head          VARCHAR(50) NOT NULL            COMMENT '户主姓名',
     household_head_id_card  VARCHAR(18)                     COMMENT '户主身份证号',
     household_type          TINYINT     NOT NULL            COMMENT '户籍类型: 1-农业户口, 2-非农业户口',
     village_id              INT                             COMMENT '所属行政村ID',
     household_address       VARCHAR(200)                    COMMENT '户籍地址',
     belonging_area          VARCHAR(200)                    COMMENT '归属地区',
-    house_number            VARCHAR(50)                     COMMENT '房屋编号',
+    house_code            VARCHAR(50)                     COMMENT '房屋编号',
     create_time     datetime         null comment '创建时间',
     update_time     datetime         null comment '修改时间',
     del_flag        char default '0' null comment '删除标志'
-    INDEX idx_household_number (household_number),
+    INDEX idx_household_number (household_code),
     INDEX idx_household_head (household_head),
     INDEX idx_house_number (house_number)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='户籍信息表';
 
 -- 房屋信息表
 CREATE TABLE house_info (
-    house_id          INT    PRIMARY KEY  AUTO_INCREMENT COMMENT '房屋ID',
-    house_number      VARCHAR(20) UNIQUE NOT NULL COMMENT '房屋编号(如FW0000580689)',
-    doorplate_number  VARCHAR(50)           COMMENT '门牌号',
+    id          INT    PRIMARY KEY  AUTO_INCREMENT COMMENT '房屋ID',
+    house_code     VARCHAR(20) UNIQUE NOT NULL COMMENT '房屋编号(如FW0000580689)',
     village_id        INT                   COMMENT '所属行政村ID',
     village_name      VARCHAR(100)          COMMENT '所属行政村名称',
-    grid_id           INT                   COMMENT '所属网格ID',
-    full_address      VARCHAR(200)          COMMENT '房屋详细地址',
+    doorplate_number  VARCHAR(50)           COMMENT '门牌号',
+    house_address     VARCHAR(200)          COMMENT '房屋详细地址',
     house_owner_id    INT                   COMMENT '房主人员ID',
     total_points      INT DEFAULT 0         COMMENT '总积分',
     remaining_points  INT DEFAULT 0         COMMENT '剩余积分',
-    house_tags        VARCHAR(1024)         COMMENT '家庭标签(JSON数组)',
     house_type        TINYINT               COMMENT '房屋性质:1-自建房,2-商铺,3-公租房',
-    building_area     DECIMAL(10,2)         COMMENT '建筑面积(㎡)',
-    photo_url         VARCHAR(255)          COMMENT '照片URL',
+    house_category    TINYINT               COMMENT '房屋类别:1-修缮,2-原址重建,3-集中安置',
+    building_area     DECIMAL(10,2)         COMMENT '宅基地面积(㎡)',
+    grid_id           INT                   COMMENT '所属网格ID',
+    photo_url         VARCHAR(256)          COMMENT '照片URL',
+    house_tags        VARCHAR(1024)         COMMENT '家庭标签(JSON数组)',
+    qr_code_url       VARCHAR(256)          COMMENT '门牌二维码图片URL',
     create_time       datetime         null comment '创建时间',
     update_time       datetime         null comment '修改时间',
-    del_flag          char default '0' null comment '删除标志'
+    del_flag          char default '0' null comment '删除标志',
     -- 索引
-    INDEX idx_house_code (house_number),
-    INDEX idx_village (village_id),
-    INDEX idx_grid (grid_id),
-    INDEX idx_address (full_address)
+    INDEX idx_house_code (house_code),
+    INDEX idx_village_grid (village_id, grid_id),
+    INDEX idx_doorplate (doorplate_number),
+    INDEX idx_owner (house_owner_id),
+    INDEX idx_house_type (house_type),
+    INDEX idx_house_category (house_category),
+    INDEX idx_address (house_address)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房屋信息表';
 
 -- 网格信息表
@@ -107,3 +112,21 @@ CREATE TABLE grids (
     INDEX idx_village (village_id),
     INDEX idx_path (full_path(20))
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网格信息表';
+
+-- 项目表
+CREATE TABLE projects (
+    id                  INT PRIMARY KEY AUTO_INCREMENT COMMENT '项目ID',
+    project_name        VARCHAR(100) NOT NULL   COMMENT '项目名称',
+    project_description VARCHAR(256)            COMMENT '项目内容',
+    investment_amount   DECIMAL(15,2)           COMMENT '投资金额(元)',
+    start_date          DATE                    COMMENT '项目开始日期',
+    estimated_completion_date   DATE            COMMENT '预计建成日期',
+    actual_completion_date      DATE            COMMENT '实际建成日期',
+    progress                    TINYINT DEFAULT 0 COMMENT '项目进度(0-建设中 1-已建成)',
+    create_time     datetime         null       comment '创建时间',
+    update_time     datetime         null       comment '修改时间',
+    del_flag          char default '0' null comment '删除标志',
+    INDEX idx_progress (progress),
+    INDEX idx_name (project_name),
+    INDEX idx_dates (start_date, estimated_completion_date)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目表';