1
0
Quellcode durchsuchen

添加国有建设用地使用权首次登记(会有多个不动产权证)相关方法

gushoubang vor 2 Monaten
Ursprung
Commit
adc19bf510

+ 48 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/GyjsydscdjController.java

@@ -0,0 +1,48 @@
+package com.siwei.apply.controller;
+
+import com.siwei.apply.domain.Gyjsydscdj;
+import com.siwei.apply.service.GyjsydscdjService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 国有建设用地使用权首次登记 控制器
+ */
+@RestController
+@RequestMapping("/gyjsydscdj")
+public class GyjsydscdjController {
+
+    @Autowired
+    private GyjsydscdjService gyjsydscdjService;
+
+    /**
+     * 添加国有建设用地使用权首次登记记录
+     *
+     * @param gyjsydscdj
+     */
+    @PostMapping()
+    public void add(@RequestBody Gyjsydscdj gyjsydscdj) {
+        gyjsydscdjService.add(gyjsydscdj);
+    }
+
+    /**
+     * 根据ID获取国有建设用地使用权首次登记记录
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping()
+    public Gyjsydscdj get(@PathVariable String id) {
+        return gyjsydscdjService.get(id);
+    }
+
+    /**
+     * 更新国有建设用地使用权首次登记记录
+     *
+     * @param gyjsydscdj
+     */
+    @PutMapping()
+    public void update(@RequestBody Gyjsydscdj gyjsydscdj) {
+        gyjsydscdjService.update(gyjsydscdj);
+    }
+}

+ 40 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Gyjsydscdj.java

@@ -0,0 +1,40 @@
+package com.siwei.apply.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.UUID;
+
+/*
+ * 国有建设用地使用权首次登记对象 t_gyjsydscdj
+ */
+@Data
+public class Gyjsydscdj {
+    private String id;
+    private String projectId;      // 项目ID
+    private String qlr;            // 权利人
+    private String gyqk;           // 共有情况
+    private String zl;             // 坐落
+    private String qllx;           // 权利类型
+    private String qlxz;           // 权利性质
+    private String yt;             // 用途
+    private Float area;            // 面积
+    private String bdcdyh;         // 不动产单元号
+    private String bdczh;          // 不动产证号
+    private String djjg;           // 登记结构
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date djDate;           // 登记日期
+    private Map<String, Object> attachment; // 附件
+    private String hasOnchain;     // 是否上链
+    private String creatorId;      // 创建人ID
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createdAt;        // 创建时间
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updatedAt;        // 更新时间
+
+    public void generateId() {
+        this.id = UUID.randomUUID().toString();
+    }
+}

+ 37 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/GyjsydscdjMapper.java

@@ -0,0 +1,37 @@
+package com.siwei.apply.mapper;
+
+import com.siwei.apply.domain.Gyjsydscdj;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 国有建设用地使用权首次登记 Mapper 接口
+ */
+@Mapper
+public interface GyjsydscdjMapper {
+
+    /**
+     * 添加国有建设用地使用权首次登记记录
+     *
+     * @param gyjsydscdj
+     * @return
+     */
+    void add(Gyjsydscdj gyjsydscdj);
+
+    /**
+     * 根据ID获取国有建设用地使用权首次登记记录
+     *
+     * @param id
+     * @return
+     */
+
+    Gyjsydscdj get(@Param("id") String id);
+
+
+    /**
+     * 更新国有建设用地使用权首次登记记录
+     *
+     * @param gyjsydscdj
+     */
+    void update(Gyjsydscdj gyjsydscdj);
+}

+ 30 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/GyjsydscdjService.java

@@ -0,0 +1,30 @@
+package com.siwei.apply.service;
+
+import com.siwei.apply.domain.Gyjsydscdj;
+
+/**
+ * 国有建设用地使用权首次登记 服务接口
+ */
+public interface GyjsydscdjService {
+    /**
+     * 添加国有建设用地使用权首次登记记录
+     *
+     * @param gyjsydscdj 实体
+     */
+    void add(Gyjsydscdj gyjsydscdj);
+
+    /**
+     * 根据ID获取国有建设用地使用权首次登记记录
+     *
+     * @param id 主键
+     * @return 实体
+     */
+    Gyjsydscdj get(String id);
+
+    /**
+     * 更新国有建设用地使用权首次登记记录
+     *
+     * @param gyjsydscdj 实体
+     */
+    void update(Gyjsydscdj gyjsydscdj);
+}

+ 32 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/GyjsydscdjImpl.java

@@ -0,0 +1,32 @@
+package com.siwei.apply.service.impl;
+
+import com.siwei.apply.domain.Gyjsydscdj;
+import com.siwei.apply.mapper.GyjsydscdjMapper;
+import com.siwei.apply.service.GyjsydscdjService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 国有建设用地使用权首次登记 服务实现类
+ */
+@Service
+public class GyjsydscdjImpl implements GyjsydscdjService {
+
+    @Autowired
+    private GyjsydscdjMapper gyjsydscdjMapper;
+
+    @Override
+    public void add(Gyjsydscdj gyjsydscdj) {
+        gyjsydscdjMapper.add(gyjsydscdj);
+    }
+
+    @Override
+    public Gyjsydscdj get(String id) {
+        return gyjsydscdjMapper.get(id);
+    }
+
+    @Override
+    public void update(Gyjsydscdj gyjsydscdj) {
+        gyjsydscdjMapper.update(gyjsydscdj);
+    }
+}

+ 62 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/GyjsydscdjMapper.xml

@@ -0,0 +1,62 @@
+<?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.siwei.apply.mapper.GyjsydscdjMapper">
+
+    <resultMap id="GyjsydscdjResultMap" type="com.siwei.apply.domain.Gyjsydscdj">
+        <id property="id" column="id"/>
+        <result property="projectId" column="project_id"/>
+        <result property="qlr" column="qlr"/>
+        <result property="gyqk" column="gyqk"/>
+        <result property="zl" column="zl"/>
+        <result property="qllx" column="qllx"/>
+        <result property="qlxz" column="qlxz"/>
+        <result property="yt" column="yt"/>
+        <result property="area" column="area"/>
+        <result property="bdcdyh" column="bdcdyh"/>
+        <result property="bdczh" column="bdczh"/>
+        <result property="djjg" column="djjg"/>
+        <result property="djDate" column="dj_date"/>
+        <result property="attachment" column="attachment" typeHandler="com.siwei.apply.handler.JsonbTypeHandler"/>
+        <result property="hasOnchain" column="has_onchain"/>
+        <result property="creatorId" column="creator_id"/>
+        <result property="createdAt" column="created_at"/>
+        <result property="updatedAt" column="updated_at"/>
+    </resultMap>
+
+    <insert id="add" parameterType="com.siwei.apply.domain.Gyjsydscdj">
+        INSERT INTO t_gyjsydscdj (id, project_id, qlr, gyqk, zl, qllx, qlxz, yt, area, bdcdyh, bdczh, djjg, dj_date,
+                                  has_onchain, creator_id, created_at, updated_at)
+        VALUES (#{id}, #{projectId}, #{qlr}, #{gyqk}, #{zl}, #{qllx}, #{qlxz}, #{yt}, #{area}, #{bdcdyh}, #{bdczh},
+                #{djjg}, #{djDate},
+                #{hasOnchain}, #{creatorId}, now(), now())
+    </insert>
+
+    <select id="get" resultMap="GyjsydscdjResultMap">
+        SELECT *
+        FROM t_gyjsydscdj
+        WHERE id = #{id}
+    </select>
+
+    <update id="update" parameterType="com.siwei.apply.domain.Gyjsydscdj">
+        UPDATE t_gyjsydscdj
+        <set>
+            <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="qlr != null">qlr = #{qlr},</if>
+            <if test="gyqk != null">gyqk = #{gyqk},</if>
+            <if test="zl != null">zl = #{zl},</if>
+            <if test="qllx != null">qllx = #{qllx},</if>
+            <if test="qlxz != null">qlxz = #{qlxz},</if>
+            <if test="yt != null">yt = #{yt},</if>
+            <if test="area != null">area = #{area},</if>
+            <if test="bdcdyh != null">bdcdyh = #{bdcdyh},</if>
+            <if test="bdczh != null">bdczh = #{bdczh},</if>
+            <if test="djjg != null">djjg = #{djjg},</if>
+            <if test="djDate != null">dj_date = #{djDate},</if>
+            <if test="hasOnchain != null">has_onchain = #{hasOnchain},</if>
+            <if test="creatorId != null">creator_id = #{creatorId},</if>
+        </set>
+        updated_at = now()
+        WHERE id = #{id}
+    </update>
+</mapper>