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 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 getAllOuthospTableNames(); // 查询指定表的字段列表(按 ordinal_position 排序) List getTableColumns(@Param("tableName") String tableName); /** * 查询指定表的字段元数据(column_name, data_type, column_type) * * @param tableName 表名 * @return 每行包含 column_name / data_type / column_type */ List> 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); }