Forráskód Böngészése

只更新修改的

gushoubang 2 hónapja
szülő
commit
861f2d5806

+ 2 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/Ydysyxz.java

@@ -16,14 +16,14 @@ public class Ydysyxz {
     private String projectId;
     private String jsyj;//建设依据
     private String jsdd;//建设地点
-    private String area;//拟用地面积
+    private Float area;//拟用地面积
     private String hasZz;//是否完成征转
     private String xmjsyj;//项目建设依据
     private String zzwh;//证书文号
     private String fzDate;//发证日期
     // JSONB 对应 Java 的 Map 或自定义对象
     private Map<String, Object> attachment;//存储附件的目录树
-    private Boolean hasOnchain;//是否上链
+    private Boolean hasOnchain = false;//是否上链
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createdAt;

+ 2 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/vo/YdysyxzVo.java

@@ -10,9 +10,10 @@ public class YdysyxzVo {
     private String projectId;
     private String jsyj;//建设依据
     private String jsdd;//建设地点
-    private String area;//拟用地面积
+    private Float area;//拟用地面积
     private String hasZz;//是否完成征转
     private String xmjsyj;//项目建设依据
     private String zzwh;//证书文号
     private String fzDate;//发证日期
+    private Boolean hasOnchain;//是否上链
 }

+ 8 - 2
siwei-modules/siwei-apply/src/main/resources/mapper/ProjectMapper.xml

@@ -61,10 +61,16 @@
     </select>
     <update id="updateProject" parameterType="com.siwei.apply.domain.vo.ProjectUpdateVo">
         UPDATE t_project
-        SET name = #{name}, code = #{code}, company = #{company},
-            updated_at = now(), project_type = #{projectType}
+        <set>
+            <if test="name != null">name = #{name},</if>
+            <if test="code != null">code = #{code},</if>
+            <if test="company != null">company = #{company},</if>
+            <if test="projectType != null">project_type = #{projectType},</if>
+            updated_at = now()
+        </set>
         WHERE id = #{id}
     </update>
+
     <delete id="deleteProject" parameterType="String">
         DELETE FROM t_project
         WHERE id = #{projectId}

+ 13 - 11
siwei-modules/siwei-apply/src/main/resources/mapper/YdysyxzMapper.xml

@@ -24,7 +24,7 @@
                                xmjsyj, zzwh, fz_date, has_onchain, created_at, updated_at, creator_id)
         VALUES (#{id}, #{projectId}, #{jsyj}, #{jsdd}, #{area}, #{hasZz},
                 #{xmjsyj}, #{zzwh}, #{fzDate},
-                #{hasOnchain}, now(), now(), #{creatorId})
+                false, now(), now(), #{creatorId})
     </insert>
     <select id="getYdysyxz" resultMap="resMap">
         SELECT *
@@ -33,16 +33,18 @@
     </select>
     <update id="updateYdysyxz" parameterType="com.siwei.apply.domain.vo.YdysyxzUpdateVo">
         UPDATE t_ydysyxz
-        SET jsyj        = #{jsyj},
-            project_id  = #{projectId},
-            jsdd        = #{jsdd},
-            area        = #{area},
-            has_zz      = #{hasZz},
-            xmjsyj      = #{xmjsyj},
-            zzwh        = #{zzwh},
-            fz_date     = #{fzDate},
-            has_onchain = #{hasOnchain},
-            update_at   = now()
+        <set>
+            <if test="jsyj != null">jsyj = #{jsyj},</if>
+            <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="jsdd != null">jsdd = #{jsdd},</if>
+            <if test="area != null">area = #{area},</if>
+            <if test="hasZz != null">has_zz = #{hasZz},</if>
+            <if test="xmjsyj != null">xmjsyj = #{xmjsyj},</if>
+            <if test="zzwh != null">zzwh = #{zzwh},</if>
+            <if test="fzDate != null">fz_date = #{fzDate},</if>
+            <if test="hasOnchain != null">has_onchain = #{hasOnchain},</if>
+            updated_at = now()
+        </set>
         WHERE id = #{id}
     </update>
 </mapper>