| | |
| | | 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; |
| | | |
| | |
| | | */ |
| | | @Mapper |
| | | public interface PatMedOuthospMapper { |
| | | /** |
| | | * 查询患者门诊记录 |
| | | * |
| | | * @param id 患者门诊记录主键 |
| | | * @return 患者门诊记录 |
| | | */ |
| | | public PatMedOuthosp selectPatMedOuthospById(Long id); |
| | | |
| | | /** |
| | | * 查询患者门诊记录列表 |
| | | * |
| | | * @param patMedOuthosp 患者门诊记录 |
| | | * @return 患者门诊记录集合 |
| | | */ |
| | | public List<PatMedOuthosp> selectPatMedOuthospList(PatMedOuthosp patMedOuthosp); |
| | | |
| | | /** |
| | | * 新增患者门诊记录 |
| | |
| | | * @param patMedOuthosp 患者门诊记录 |
| | | * @return 结果 |
| | | */ |
| | | public int insertPatMedOuthosp(PatMedOuthosp patMedOuthosp); |
| | | // public int insertPatMedOuthosp(PatMedOuthosp patMedOuthosp); |
| | | |
| | | public int batchPatMedOuthosp(List<PatMedOuthosp> patMedOuthosps); |
| | | /** |
| | | * 新增到指定分表(用于路由到最新分表) |
| | | * |
| | | * @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); |
| | | // public int updatePatMedOuthosp(PatMedOuthosp patMedOuthosp); |
| | | |
| | | /** |
| | | * 删除患者门诊记录 |
| | | * |
| | | * @param id 患者门诊记录主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deletePatMedOuthospById(Long id); |
| | | |
| | | /** |
| | | * 批量删除患者门诊记录 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deletePatMedOuthospByIds(Long[] ids); |
| | | |
| | | PatMedRes selectPatMedOuthospCount(PatMedReq patMedReq); |
| | | |
| | | public List<PatMedRes> getDeptRanking(PatMedReq patMedReq); |
| | | |
| | | /** |
| | | * 获取表的数量 |
| | | * |
| | | * @return |
| | | */ |
| | | int countPatMedOuthosp(); |
| | | |
| | | /** |
| | | * 修改表名 |
| | | * |
| | | * @return |
| | | */ |
| | | void renameTable(@Param("oldName") String oldName, @Param("newName") String newName); |
| | | |
| | | /** |
| | | * 创建新表 |
| | | * |
| | | * @param templateName |
| | | * @param newName |
| | | * @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(); |
| | | |
| | | // 查询指定表的最大id |
| | | Long getMaxIdFromTable(@Param("tableName") String tableName); |
| | | // 查询指定表的字段列表(按 ordinal_position 排序) |
| | | List<String> getTableColumns(@Param("tableName") String tableName); |
| | | |
| | | void createOrReplaceView(@Param("viewSql") String viewSql); |
| | | /** |
| | | * 查询指定表的字段元数据(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); |
| | | } |
| | | |
| | | |