陈昶聿
12 小时以前 6a53d35b5d56e2f6bc64bbfe41579f6f32039c90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package com.smartor.mapper;
 
import java.util.List;
import java.util.Map;
 
import com.smartor.domain.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
 
/**
 * 患者门诊记录Mapper接口
 *
 * @author smartor
 * @date 2023-03-04
 */
@Mapper
public interface PatMedOuthospMapper {
 
    /**
     * 新增患者门诊记录
     *
     * @param patMedOuthosp 患者门诊记录
     * @return 结果
     */
//    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);
 
 
    /**
     * 修改患者门诊记录
     *
     * @param patMedOuthosp 患者门诊记录
     * @return 结果
     */
//    public int updatePatMedOuthosp(PatMedOuthosp patMedOuthosp);
 
 
    /**
     * 创建新表
     *
     * @param templateName 模板表名
     * @param newName      新表名
     */
    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);
 
    /**
     * 查询指定表的字段元数据(column_name, data_type, column_type)
     *
     * @param tableName 表名
     * @return 每行包含 column_name / data_type / column_type
     */
    List<Map<String, String>> getTableColumnMeta(@Param("tableName") String tableName);
 
 
    /**
     * 创建或更新存储过程(支持 DROP / CREATE PROCEDURE 语句)
     */
    void createOrReplaceProcedure(@Param("procSql") String procSql);
 
    /**
     * 检查表是否已存在
     *
     * @param tableName 表名
     * @return 存在返回1,不存在返回0
     */
    int tableExists(@Param("tableName") String tableName);
}