liutao 2 hete
szülő
commit
1361219f8c

+ 44 - 0
YHYZT/server/src/main/java/com/zjugis/yzt/controller/StNzydkController.java

@@ -161,5 +161,49 @@ public class StNzydkController {
     public boolean updateNzydk(@RequestBody StNzydk stNzydk) {
         return stNzydkService.updateById(stNzydk);
     }
+
+    /**
+     * 根据批次编号更新农转用地块基本信息
+     * @param pcbh 批次编号
+     * @param pch 批次名称
+     * @param lx 类型
+     * @param pwh 批准文号
+     * @param pzrq 批准日期
+     * @param nmjf 是否农民建房
+     * @return 更新是否成功
+     */
+    @PutMapping("/updateByPcbh")
+    public boolean updateByPcbh(@RequestParam String pcbh,
+                               @RequestParam(required = false) String pch,
+                               @RequestParam(required = false) String lx,
+                               @RequestParam(required = false) String pwh,
+                               @RequestParam(required = false) String pzrq,
+                               @RequestParam(required = false) String nmjf) {
+        // 构建更新条件
+        QueryWrapper<StNzydk> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("pcbh", pcbh);
+
+        // 构建更新内容
+        StNzydk updateEntity = new StNzydk();
+        if (pch != null && !pch.isEmpty()) {
+            updateEntity.setPch(pch);
+        }
+        if (lx != null && !lx.isEmpty()) {
+            updateEntity.setLx(lx);
+        }
+        if (pwh != null && !pwh.isEmpty()) {
+            updateEntity.setPwh(pwh);
+        }
+        if (pzrq != null && !pzrq.isEmpty()) {
+            updateEntity.setPzrq(pzrq);
+        }
+        if (nmjf != null && !nmjf.isEmpty()) {
+            updateEntity.setNmjf(nmjf);
+        }
+
+        return stNzydkService.update(updateEntity, queryWrapper);
+    }
+
+    
     
 }