From 21ce122193e2fb57d206dbfca59e8d2ab2114fd0 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 23 三月 2026 17:12:56 +0800
Subject: [PATCH] 新增病区与科室组合

---
 smartor/src/main/java/com/smartor/mapper/PatMedOuthospMapper.java |  103 ++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 73 insertions(+), 30 deletions(-)

diff --git a/smartor/src/main/java/com/smartor/mapper/PatMedOuthospMapper.java b/smartor/src/main/java/com/smartor/mapper/PatMedOuthospMapper.java
index ddd332c..bf12d7c 100644
--- a/smartor/src/main/java/com/smartor/mapper/PatMedOuthospMapper.java
+++ b/smartor/src/main/java/com/smartor/mapper/PatMedOuthospMapper.java
@@ -1,11 +1,11 @@
 package com.smartor.mapper;
 
 import java.util.List;
+import java.util.Map;
 
-import com.smartor.domain.PatMedOuthosp;
-import com.smartor.domain.PatMedReq;
-import com.smartor.domain.PatMedRes;
+import com.smartor.domain.*;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 鎮h�呴棬璇婅褰昅apper鎺ュ彛
@@ -15,21 +15,6 @@
  */
 @Mapper
 public interface PatMedOuthospMapper {
-    /**
-     * 鏌ヨ鎮h�呴棬璇婅褰�
-     *
-     * @param id 鎮h�呴棬璇婅褰曚富閿�
-     * @return 鎮h�呴棬璇婅褰�
-     */
-    public PatMedOuthosp selectPatMedOuthospById(Long id);
-
-    /**
-     * 鏌ヨ鎮h�呴棬璇婅褰曞垪琛�
-     *
-     * @param patMedOuthosp 鎮h�呴棬璇婅褰�
-     * @return 鎮h�呴棬璇婅褰曢泦鍚�
-     */
-    public List<PatMedOuthosp> selectPatMedOuthospList(PatMedOuthosp patMedOuthosp);
 
     /**
      * 鏂板鎮h�呴棬璇婅褰�
@@ -37,7 +22,44 @@
      * @param patMedOuthosp 鎮h�呴棬璇婅褰�
      * @return 缁撴灉
      */
-    public int insertPatMedOuthosp(PatMedOuthosp patMedOuthosp);
+//    public int insertPatMedOuthosp(PatMedOuthosp patMedOuthosp);
+
+    /**
+     * 鏂板鍒版寚瀹氬垎琛紙鐢ㄤ簬璺敱鍒版渶鏂板垎琛級
+     *
+     * @param tableName 鐩爣琛ㄥ悕
+     * @param record    闂ㄨ瘖璁板綍
+     * @return 鎻掑叆鏉℃暟
+     */
+    int insertIntoTable(@Param("tableName") String tableName, @Param("record") PatMedOuthosp record);
+
+
+    /**
+     * 鍒ゆ柇鎸囧畾鍒嗚〃涓槸鍚﹀瓨鍦ㄨ id
+     */
+    int existsInTable(@Param("tableName") String tableName, @Param("id") Long id);
+
+    /**
+     * 鏇存柊鍒版寚瀹氬垎琛紙鐢ㄤ簬璺敱鍒版纭垎琛級
+     */
+    int updateInTable(@Param("tableName") String tableName, @Param("record") PatMedOuthosp record);
+
+    /**
+     * 璋冪敤瀛樺偍杩囩▼ sp_query_outhosp 鏌ヨ闂ㄨ瘖璁板綍
+     *
+     * @param req 鍏ュ弬瀵硅薄
+     * @return 闂ㄨ瘖璁板綍鍒楄〃
+     */
+    List<PatMedOuthosp> callSpQueryOuthosp(PatMedOuthospQueryReq req);
+
+    /**
+     * 璋冪敤瀛樺偍杩囩▼ sp_query_outhosp 鏌ヨ闂ㄨ瘖璁板綍鏁伴噺
+     *
+     * @param req 鍏ュ弬瀵硅薄
+     * @return 闂ㄨ瘖璁板綍鍒楄〃
+     */
+    Long callSpQueryOuthospCount(PatMedOuthospQueryReq req);
+
 
     /**
      * 淇敼鎮h�呴棬璇婅褰�
@@ -45,25 +67,46 @@
      * @param patMedOuthosp 鎮h�呴棬璇婅褰�
      * @return 缁撴灉
      */
-    public int updatePatMedOuthosp(PatMedOuthosp patMedOuthosp);
+//    public int updatePatMedOuthosp(PatMedOuthosp patMedOuthosp);
+
 
     /**
-     * 鍒犻櫎鎮h�呴棬璇婅褰�
+     * 鍒涘缓鏂拌〃
      *
-     * @param id 鎮h�呴棬璇婅褰曚富閿�
-     * @return 缁撴灉
+     * @param templateName 妯℃澘琛ㄥ悕
+     * @param newName      鏂拌〃鍚�
      */
-    public int deletePatMedOuthospById(Long id);
+    void createPatMedOuthosp(@Param("templateName") String templateName, @Param("newName") String newName);
+
+    void createPatMedOuthospAutoAdd(@Param("newName") String newName);
+
+    void setAutoIncrement(@Param("tableName") String tableName, @Param("autoInc") long autoInc);
+
+    // 鏌ヨ鎵�鏈� pat_med_outhosp 寮�澶寸殑琛ㄥ悕
+    List<String> getAllOuthospTableNames();
+
+    // 鏌ヨ鎸囧畾琛ㄧ殑瀛楁鍒楄〃锛堟寜 ordinal_position 鎺掑簭锛�
+    List<String> getTableColumns(@Param("tableName") String tableName);
 
     /**
-     * 鎵归噺鍒犻櫎鎮h�呴棬璇婅褰�
+     * 鏌ヨ鎸囧畾琛ㄧ殑瀛楁鍏冩暟鎹紙column_name, data_type, column_type锛�
      *
-     * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
-     * @return 缁撴灉
+     * @param tableName 琛ㄥ悕
+     * @return 姣忚鍖呭惈 column_name / data_type / column_type
      */
-    public int deletePatMedOuthospByIds(Long[] ids);
+    List<Map<String, String>> getTableColumnMeta(@Param("tableName") String tableName);
 
-    PatMedRes selectPatMedOuthospCount(PatMedReq patMedReq);
 
-    public List<PatMedRes> getDeptRanking(PatMedReq patMedReq);
+    /**
+     * 鍒涘缓鎴栨洿鏂板瓨鍌ㄨ繃绋嬶紙鏀寔 DROP / CREATE PROCEDURE 璇彞锛�
+     */
+    void createOrReplaceProcedure(@Param("procSql") String procSql);
+
+    /**
+     * 妫�鏌ヨ〃鏄惁宸插瓨鍦�
+     *
+     * @param tableName 琛ㄥ悕
+     * @return 瀛樺湪杩斿洖1锛屼笉瀛樺湪杩斿洖0
+     */
+    int tableExists(@Param("tableName") String tableName);
 }

--
Gitblit v1.9.3