Sfoglia il codice sorgente

建设用地规划许可

gushoubang 2 mesi fa
parent
commit
652faebcb3

+ 39 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Jsydghxk.java

@@ -0,0 +1,39 @@
+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_jsydghxk
+ */
+@Data
+public class Jsydghxk {
+    private String id;                 // 主键
+    private String projectId;          // 项目ID
+    private String yddw;               // 用地单位
+    private String ydwz;               // 用地位置
+    private Float ydArea;              // 用地面积
+    private String tdyt;               // 土地用途
+    private String tdhqfs;             // 土地获取方式
+    private String pzydjg;             // 批准用地机关
+    private String pzydwh;             // 批准用地文号
+    private String jsgm;               // 建设规模
+    private String zsbh;               // 证书编号
+    private String fzjg;               // 发证机关
+    private String fzri;               // 发证日期
+    private Map<String, Object> attachment; // 附件
+    private Boolean 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();
+    }
+}

+ 17 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/JsydghxkMapper.java

@@ -0,0 +1,17 @@
+package com.siwei.apply.mapper;
+
+import com.siwei.apply.domain.Jsydghxk;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 建设用地规划许可 Mapper 接口
+ */
+@Mapper
+public interface JsydghxkMapper {
+    void add(Jsydghxk jsydghxk);
+
+    Jsydghxk get(@Param("id") String id);
+
+    void update(Jsydghxk jsydghxk);
+}

+ 67 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/JsydghxkMapper.xml

@@ -0,0 +1,67 @@
+<?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.JsydghxkMapper">
+
+    <resultMap id="BaseResultMap" type="com.siwei.apply.domain.Jsydghxk">
+        <id property="id" column="id"/>
+        <result property="projectId" column="project_id"/>
+        <result property="yddw" column="yddw"/>
+        <result property="ydwz" column="ydwz"/>
+        <result property="ydArea" column="yd_area"/>
+        <result property="tdyt" column="tdyt"/>
+        <result property="tdhqfs" column="tdhqfs"/>
+        <result property="pzydjg" column="pzydjg"/>
+        <result property="pzydwh" column="pzydwh"/>
+        <result property="jsgm" column="jsgm"/>
+        <result property="zsbh" column="zsbh"/>
+        <result property="fzjg" column="fzjg"/>
+        <result property="fzri" column="fzri"/>
+        <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.Jsydghxk">
+        INSERT INTO t_jsydghxk (id, project_id, yddw, ydwz, yd_area, tdyt, tdhqfs, pzydjg, pzydwh,
+                                jsgm, zsbh, fzjg, fzri, has_onchain, creator_id, created_at, updated_at)
+        VALUES (#{id}, #{projectId}, #{yddw}, #{ydwz}, #{ydArea}, #{tdyt}, #{tdhqfs}, #{pzydjg}, #{pzydwh},
+                #{jsgm}, #{zsbh}, #{fzjg}, #{fzri}, false, #{creatorId}, now(), now())
+    </insert>
+
+    <!-- 根据ID获取记录 -->
+    <select id="get" resultMap="BaseResultMap" parameterType="String">
+        SELECT *
+        FROM t_jsydghxk
+        WHERE id = #{id}
+    </select>
+
+    <!-- 根据ID更新记录 -->
+    <update id="update" parameterType="com.siwei.apply.domain.Jsydghxk">
+        UPDATE t_jsydghxk
+        <set>
+            <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="yddw != null">yddw = #{yddw},</if>
+            <if test="ydwz != null">ydwz = #{ydwz},</if>
+            <if test="ydArea != null">yd_area = #{ydArea},</if>
+            <if test="tdyt != null">tdyt = #{tdyt},</if>
+            <if test="tdhqfs != null">tdhqfs = #{tdhqfs},</if>
+            <if test="pzydjg != null">pzydjg = #{pzydjg},</if>
+            <if test="pzydwh != null">pzydwh = #{pzydwh},</if>
+            <if test="jsgm != null">jsgm = #{jsgm},</if>
+            <if test="zsbh != null">zsbh = #{zsbh},</if>
+            <if test="fzjg != null">fzjg = #{fzjg},</if>
+            <if test="fzri != null">fzri = #{fzri},</if>
+            <if test="hasOnchain != null">has_onchain = #{hasOnchain},</if>
+            <if test="creatorId != null">creator_id = #{creatorId},</if>
+            updated_at = now()
+        </set>
+        WHERE id = #{id}
+    </update>
+
+</mapper>