1
0
فهرست منبع

土地供应model添加

gushoubang 2 ماه پیش
والد
کامیت
f972cf2ee5

+ 29 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Tdgy.java

@@ -0,0 +1,29 @@
+package com.siwei.apply.domain;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.Map;
+
+/*
+ * 土地供应对象 t_tdgy
+ */
+@Data
+public class Tdgy {
+    private String id;
+    private String projectId;      // 项目ID
+    private String srf;            // 土地受让人
+    private String tdyt;           // 土地用途
+    private String jswz;           // 建设位置
+    private Float gdArea;          // 供地面积
+    private String gdType;         // 供地方式
+    private Boolean hasZz;         // 是否征转
+    private String hbcrfapfwh;     // 用地划拨/出让方案批复文号
+    private String hbcrhtbh;       // 划拨决定书/出让合同编号
+    private Date hbcrhtDate;       // 划拨决定书/出让合同日期
+    private Map<String, Object> attachment;     // 附件
+    private Boolean hasOnchain;    // 是否上链
+    private String creatorId;      // 创建人ID
+    private Date createdAt;        // 创建时间
+    private Date updatedAt;        // 更新时间
+}

+ 30 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/TdgyMapper.java

@@ -0,0 +1,30 @@
+package com.siwei.apply.mapper;
+
+import com.siwei.apply.domain.Tdgy;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface TdgyMapper {
+
+    /**
+     * 添加记录
+     * @param tdgy 实体
+     * @return 插入成功条数
+     */
+    int add(Tdgy tdgy);
+
+    /**
+     * 根据ID获取记录
+     * @param id 主键ID
+     * @return Tdgy 对象
+     */
+    Tdgy get(@Param("id") String id);
+
+    /**
+     * 更新记录
+     * @param tdgy 实体
+     * @return 更新成功条数
+     */
+    int update(Tdgy tdgy);
+}

+ 68 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/TdgyMapper.xml

@@ -0,0 +1,68 @@
+<?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.TdgyMapper">
+
+    <resultMap id="BaseResultMap" type="com.siwei.apply.domain.Tdgy">
+        <id property="id" column="id"/>
+        <result property="projectId" column="project_id"/>
+        <result property="srf" column="srf"/>
+        <result property="tdyt" column="tdyt"/>
+        <result property="jswz" column="jswz"/>
+        <result property="gdArea" column="gd_area"/>
+        <result property="gdType" column="gd_type"/>
+        <result property="hasZz" column="has_zz"/>
+        <result property="hbcrfapfwh" column="hbcrfapfwh"/>
+        <result property="hbcrhtbh" column="hbcrhtbh"/>
+        <result property="hbcrhtDate" column="hbcrht_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.Tdgy">
+        INSERT INTO t_tdgy (id, project_id, srf, tdyt, jswz,
+                            gd_area, gd_type, has_zz, hbcrfapfwh, hbcrhtbh,
+                            hbcrht_date, has_onchain, creator_id,
+                            created_at, updated_at)
+        VALUES (#{id}, #{projectId}, #{srf}, #{tdyt}, #{jswz},
+                #{gdArea}, #{gdType}, #{hasZz}, #{hbcrfapfwh}, #{hbcrhtbh},
+                #{hbcrhtDate}, false, #{creatorId},
+                now(), now())
+    </insert>
+
+    <!-- 根据ID获取记录 -->
+    <select id="get" resultMap="BaseResultMap" parameterType="String">
+        SELECT *
+        FROM t_tdgy
+        WHERE id = #{id}
+    </select>
+
+    <!-- 根据ID更新记录 -->
+    <update id="update" parameterType="com.siwei.apply.domain.Tdgy">
+        UPDATE t_tdgy
+        <set>
+            <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="srf != null">srf = #{srf},</if>
+            <if test="tdyt != null">tdyt = #{tdyt},</if>
+            <if test="jswz != null">jswz = #{jswz},</if>
+            <if test="gdArea != null">gd_area = #{gdArea},</if>
+            <if test="gdType != null">gd_type = #{gdType},</if>
+            <if test="hasZz != null">has_zz = #{hasZz},</if>
+            <if test="hbcrfapfwh != null">hbcrfapfwh = #{hbcrfapfwh},</if>
+            <if test="hbcrhtbh != null">hbcrhtbh = #{hbcrhtbh},</if>
+            <if test="hbcrhtDate != null">hbcrht_date = #{hbcrhtDate},</if>
+            <if test="attachment != null">attachment = #{attachment},</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>