瀏覽代碼

房屋信息返回

gushoubang 11 月之前
父節點
當前提交
e75dbb9547

+ 28 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/fcfh/FcfhController.java

@@ -0,0 +1,28 @@
+package com.onemap.apply.controller.fcfh;
+
+import com.onemap.apply.domain.fcfh.HouseDTO;
+import com.onemap.apply.service.fcfh.FcfhService;
+import com.onemap.common.core.web.domain.RequestResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+@RestController
+@RequestMapping("fcfh")
+public class FcfhController {
+    @Autowired
+    FcfhService fcfhService;
+
+    @GetMapping("/GetHouseInfo")
+    public RequestResult GetList(@Valid @NotNull String id) {
+        HouseDTO houseDTO = fcfhService.getById(id);
+        if (houseDTO == null) {
+            return RequestResult.error("查询失败");
+        }
+        return RequestResult.success("查询成功", houseDTO);
+    }
+}

+ 20 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/fcfh/HouseDTO.java

@@ -0,0 +1,20 @@
+package com.onemap.apply.domain.fcfh;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+// 分层分户房屋信息
+@TableName("t_yzt_house")
+@Data
+public class HouseDTO {
+    private String id;
+    private String community;
+    private String building;
+    private Integer floor;
+    private String room;
+    private String residentName;
+    private String idNumber;
+    private Float innerArea;
+    private String certificateNumber;
+    private String roomInfo;
+}

+ 8 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fcfh/FcfhMapper.java

@@ -0,0 +1,8 @@
+package com.onemap.apply.mapper.fcfh;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.apply.domain.fcfh.HouseDTO;
+
+public interface FcfhMapper extends BaseMapper<HouseDTO> {
+    HouseDTO getById(String id);
+}

+ 0 - 1
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fxpj/TGhwbMapper.java

@@ -11,6 +11,5 @@ import java.util.List;
  */
 @Mapper
 public interface TGhwbMapper extends BaseMapper<TGhwbDo> {
-
     List<TGhwbDo> selectByYsdm(String str);
 }

+ 7 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/fcfh/FcfhService.java

@@ -0,0 +1,7 @@
+package com.onemap.apply.service.fcfh;
+
+import com.onemap.apply.domain.fcfh.HouseDTO;
+
+public interface FcfhService {
+    HouseDTO getById(String id);
+}

+ 20 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/fcfh/FcfhServiceImpl.java

@@ -0,0 +1,20 @@
+package com.onemap.apply.service.impl.fcfh;
+
+import com.onemap.apply.domain.fcfh.HouseDTO;
+import com.onemap.apply.mapper.fcfh.FcfhMapper;
+import com.onemap.apply.service.fcfh.FcfhService;
+import com.onemap.common.datasource.annotation.Slave;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class FcfhServiceImpl implements FcfhService {
+    @Autowired(required = false)
+    FcfhMapper gdMapper;
+
+    @Override
+    public HouseDTO getById(String id) {
+        HouseDTO houseDTO = gdMapper.getById(id);
+        return houseDTO;
+    }
+}

+ 25 - 0
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/fcfh/GdMapper.xml

@@ -0,0 +1,25 @@
+<?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.onemap.apply.mapper.fcfh.FcfhMapper">
+
+    <!-- 可根据自己的需求,是否要使用 -->
+    <resultMap type="com.onemap.apply.domain.fcfh.HouseDTO" id="tHouseMap">
+        <result property="id" column="id"/>
+        <result property="community" column="community"/>
+        <result property="building" column="building"/>
+        <result property="floor" column="floor"/>
+        <result property="room" column="room"/>
+        <result property="residentName" column="resident_name"/>
+        <result property="idNumber" column="id_number"/>
+        <result property="innerArea" column="inner_area"/>
+        <result property="certificateNumber" column="certificate_number"/>
+        <result property="roomInfo" column="room_info"/>
+    </resultMap>
+
+    <select id="getById" resultMap="tHouseMap">
+        SELECT *
+        FROM t_yzt_house
+        WHERE id = #{id}::uuid
+    </select>
+</mapper>