| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="ExternalStorageConfigurationManager" enabled="true" /> |
| | | <component name="MavenProjectsManager"> |
| | | <option name="originalFiles"> |
| | | <list> |
| | |
| | | </option> |
| | | </component> |
| | | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" /> |
| | | </project> |
| | | </project> |
| | |
| | | <project version="4"> |
| | | <component name="ProjectModuleManager"> |
| | | <modules> |
| | | <module fileurl="file://$PROJECT_DIR$/ruoyi.iml" filepath="$PROJECT_DIR$/ruoyi.iml" /> |
| | | <module fileurl="file://$PROJECT_DIR$/ruoyi-admin/ruoyi-admin.iml" filepath="$PROJECT_DIR$/ruoyi-admin/ruoyi-admin.iml" /> |
| | | <module fileurl="file://$PROJECT_DIR$/ruoyi-common/ruoyi-common.iml" filepath="$PROJECT_DIR$/ruoyi-common/ruoyi-common.iml" /> |
| | | <module fileurl="file://$PROJECT_DIR$/ruoyi-framework/ruoyi-framework.iml" filepath="$PROJECT_DIR$/ruoyi-framework/ruoyi-framework.iml" /> |
| | |
| | | <module fileurl="file://$PROJECT_DIR$/ruoyi-quartz/ruoyi-quartz.iml" filepath="$PROJECT_DIR$/ruoyi-quartz/ruoyi-quartz.iml" /> |
| | | <module fileurl="file://$PROJECT_DIR$/ruoyi-system/ruoyi-system.iml" filepath="$PROJECT_DIR$/ruoyi-system/ruoyi-system.iml" /> |
| | | <module fileurl="file://$PROJECT_DIR$/smartor/smartor.iml" filepath="$PROJECT_DIR$/smartor/smartor.iml" /> |
| | | <module fileurl="file://$PROJECT_DIR$/ruoyi-admin/smartor-admin.iml" filepath="$PROJECT_DIR$/ruoyi-admin/smartor-admin.iml" /> |
| | | </modules> |
| | | </component> |
| | | </project> |
| | | </project> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- 日志存放路径 8095--> |
| | | <property name="log.path" value="D:/health/logs"/> |
| | | <property name="log.path" value="E:/health/logs"/> |
| | | <!-- 日志存放路径 8096--> |
| | | <!-- <property name="log.path" value="D:/lihu/logs"/>--> |
| | | <!-- 丽水日志存放路径 --> |
| | |
| | | */ |
| | | public int insertIcd10(Icd10 icd10); |
| | | |
| | | public int batchIcd10(List<Icd10> icd10s); |
| | | |
| | | |
| | | /** |
| | | * 修改疾病 |
| | | * |
| | |
| | | import com.smartor.domain.PatMedReq; |
| | | import com.smartor.domain.PatMedRes; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 患者门诊记录Mapper接口 |
| | |
| | | */ |
| | | public int insertPatMedOuthosp(PatMedOuthosp patMedOuthosp); |
| | | |
| | | public int batchPatMedOuthosp(List<PatMedOuthosp> patMedOuthosps); |
| | | |
| | | /** |
| | | * 修改患者门诊记录 |
| | | * |
| | |
| | | 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 |
| | | */ |
| | | void createPatMedOuthosp(@Param("templateName") String templateName, @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); |
| | | |
| | | void createOrReplaceView(@Param("viewSql") String viewSql); |
| | | } |
| | | |
| | | |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Mapper |
| | | public interface SysDept2Mapper |
| | | { |
| | | public interface SysDept2Mapper { |
| | | /** |
| | | * 查询部门管理数据 |
| | | * |
| | |
| | | /** |
| | | * 根据角色ID查询部门树信息 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @param roleId 角色ID |
| | | * @param deptCheckStrictly 部门树选择项是否关联显示 |
| | | * @return 选中部门列表 |
| | | */ |
| | |
| | | public int insertDept(SysDept dept); |
| | | |
| | | /** |
| | | * 批量新增部门信息 |
| | | * |
| | | * @param depts 部门信息 |
| | | * @return 结果 |
| | | */ |
| | | public int batchDept(List<SysDept> depts); |
| | | |
| | | /** |
| | | * 修改部门信息 |
| | | * |
| | | * @param dept 部门信息 |
| | |
| | | public int insertUser(SysUser user); |
| | | |
| | | /** |
| | | * 批量新增用户信息 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public int batchUser(List<SysUser> users); |
| | | |
| | | /** |
| | | * 修改用户信息 |
| | | * |
| | | * @param user 用户信息 |
| | |
| | | @Override |
| | | public Boolean addFinshJZInfo(Map dataMap) { |
| | | log.info("ServiceExternalServiceImpl---addFinshJZInfo的新增的值为:{}", dataMap); |
| | | //先对表进行维护 |
| | | tableMaintenance(); |
| | | |
| | | Map yeWuXX = (Map) dataMap.get("YeWuXX"); |
| | | Map XiaoXiTou = (Map) dataMap.get("XiaoXiTou"); |
| | | String FaSongJGID = ObjectUtils.isNotEmpty(XiaoXiTou.get("FaSongJGID")) ? XiaoXiTou.get("FaSongJGID").toString() : null; |
| | |
| | | if (i > 0) { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public void tableMaintenance() { |
| | | // 1. 判断表数据量 |
| | | int count = patMedOuthospMapper.countPatMedOuthosp(); |
| | | if (count > 3000000) { |
| | | // 2. 冷藏表并新建 |
| | | String timeSuffix = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); |
| | | String oldName = "pat_med_outhosp"; |
| | | String newName = oldName + "_" + timeSuffix; |
| | | |
| | | // 冷藏 |
| | | patMedOuthospMapper.renameTable(oldName, newName); |
| | | |
| | | // 3. 计算所有表的最大id |
| | | List<String> tableNames = patMedOuthospMapper.getAllOuthospTableNames(); |
| | | long maxId = 0; |
| | | for (String tableName : tableNames) { |
| | | Long tableMaxId = patMedOuthospMapper.getMaxIdFromTable(tableName); |
| | | if (tableMaxId != null && tableMaxId > maxId) { |
| | | maxId = tableMaxId; |
| | | } |
| | | } |
| | | |
| | | // 4. 新建 |
| | | patMedOuthospMapper.createPatMedOuthosp(oldName, newName); |
| | | |
| | | // 5. 设置新表自增起始值 |
| | | patMedOuthospMapper.setAutoIncrement(oldName, maxId + 1); |
| | | |
| | | // 6. 更新/新建视图 |
| | | // 重新获取所有表名(包含刚新建的主表) |
| | | List<String> allTables = patMedOuthospMapper.getAllOuthospTableNames(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("CREATE OR REPLACE VIEW v_pat_med_outhosp AS "); |
| | | for (int i = 0; i < allTables.size(); i++) { |
| | | sb.append("SELECT * FROM ").append(allTables.get(i)); |
| | | if (i < allTables.size() - 1) { |
| | | sb.append(" UNION ALL "); |
| | | } |
| | | } |
| | | patMedOuthospMapper.createOrReplaceView(sb.toString()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean addDiseaseInfo(Map dataMap) { |
| | | log.info("ServiceExternalServiceImpl---addDiseaseInfo的新增的值为:{}", dataMap); |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <insert id="batchIcd10"> |
| | | insert into icd10 |
| | | ( |
| | | icdcode, |
| | | icdname, |
| | | icdpym, |
| | | icdwbm, |
| | | orgid, |
| | | del_flag, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | pid, |
| | | guid, |
| | | lastflag, |
| | | chimedflag, |
| | | his_icdid) |
| | | VALUES |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.icdcode}, |
| | | #{item.icdname}, |
| | | #{item.icdpym}, |
| | | #{item.icdwbm}, |
| | | #{item.orgid}, |
| | | #{item.delFlag}, |
| | | #{item.createBy}, |
| | | #{item. createTime}, |
| | | #{item.updateBy}, |
| | | #{item.updateTime}, |
| | | #{item.pid}, |
| | | #{item.guid}, |
| | | #{item.lastflag}, |
| | | #{item.chimedflag}, |
| | | #{item. hisIcdid,} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <update id="updateIcd10" parameterType="com.smartor.domain.Icd10"> |
| | | update icd10 |
| | | <trim prefix="SET" suffixOverrides=","> |
| | |
| | | </if> |
| | | <if test="patid != null ">and pmo.patid = #{patid}</if> |
| | | <if test="patno != null ">and pmo.patno = #{patno}</if> |
| | | <if test="orgid != null and orgid != ''">and pmo.orgid = #{orgid}</if> |
| | | <if test="outhospno != null and outhospno != ''">and pmo.outhospno = #{outhospno}</if> |
| | | <if test="diagcheckFlag != null and diagcheckFlag != ''">and pmo.diagcheck_flag = #{diagcheckFlag}</if> |
| | | </where> |
| | |
| | | <if test="remark != null">#{remark},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <insert id="batchPatMedOuthosp"> |
| | | insert into pat_med_outhosp |
| | | ( |
| | | serialnum, |
| | | patid, |
| | | hospitalname, |
| | | hospitalcode, |
| | | icd10code, |
| | | diagname, |
| | | deptcode, |
| | | deptname, |
| | | drcode, |
| | | drname, |
| | | admitdate, |
| | | orgid, |
| | | del_flag, |
| | | update_by, |
| | | update_time, |
| | | create_by, |
| | | create_time, |
| | | isupload, |
| | | upload_time, |
| | | schemestatus, |
| | | deptid, |
| | | schemetime, |
| | | hpi, |
| | | mainsuit, |
| | | outhospno, |
| | | patname, |
| | | guid, |
| | | patno, |
| | | diagcheck_flag, |
| | | remark) |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.serialnum}, |
| | | #{item.patid}, |
| | | #{item.hospitalname}, |
| | | #{item.hospitalcode}, |
| | | #{item.icd10code}, |
| | | #{item.diagname}, |
| | | #{item.deptcode}, |
| | | #{item.deptname}, |
| | | #{item.drcode}, |
| | | #{item.drname}, |
| | | #{item.admitdate}, |
| | | #{item.orgid}, |
| | | #{item.delFlag}, |
| | | #{item.updateBy}, |
| | | #{item.updateTime}, |
| | | #{item.createBy}, |
| | | #{item.createTime}, |
| | | #{item.isupload}, |
| | | #{item.uploadTime}, |
| | | #{item.schemestatus}, |
| | | #{item.deptid}, |
| | | #{item.schemetime}, |
| | | #{item.hpi}, |
| | | #{item.hpi}, |
| | | #{item.mainsuit}, |
| | | #{item.outhospno}, |
| | | #{item.patname}, |
| | | #{item.guid}, |
| | | #{item.patno}, |
| | | #{item.diagcheckFlag}, |
| | | #{item.remark} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | |
| | | <update id="updatePatMedOuthosp" parameterType="com.smartor.domain.PatMedOuthosp"> |
| | | update pat_med_outhosp |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- PatMedOuthospMapper.xml --> |
| | | <select id="countPatMedOuthosp" resultType="int"> |
| | | SELECT COUNT(*) FROM pat_med_outhosp |
| | | </select> |
| | | |
| | | <update id="renameTable"> |
| | | RENAME TABLE ${oldName} TO ${newName} |
| | | </update> |
| | | |
| | | <update id="createPatMedOuthosp"> |
| | | CREATE TABLE ${newName} LIKE ${templateName} |
| | | </update> |
| | | |
| | | <update id="setAutoIncrement"> |
| | | ALTER TABLE ${tableName} AUTO_INCREMENT = #{autoInc} |
| | | </update> |
| | | |
| | | <select id="getAllOuthospTableNames" resultType="String"> |
| | | SELECT table_name FROM information_schema.tables |
| | | WHERE table_schema = DATABASE() AND table_name LIKE 'pat_med_outhosp%' |
| | | </select> |
| | | |
| | | <select id="getMaxIdFromTable" resultType="Long"> |
| | | SELECT IFNULL(MAX(id), 0) FROM ${tableName} |
| | | </select> |
| | | |
| | | <update id="createOrReplaceView"> |
| | | ${viewSql} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | where d.del_flag = '0' |
| | | <if test="deptId != null and deptId != 0"> |
| | | AND dept_id = #{deptId} |
| | | </if> <if test="type != null"> |
| | | </if> |
| | | <if test="type != null"> |
| | | AND type = #{type} |
| | | </if> |
| | | <if test="parentId != null and parentId != 0"> |
| | |
| | | d.orgid, |
| | | d.his_dept_id, |
| | | d.his_parent_id |
| | | (select dept_name from sys_dept where dept_id = d.parent_id) parent_name |
| | | (select dept_name from sys_dept where dept_id = d.parent_id) parent_name |
| | | from sys_dept d |
| | | where d.dept_id = #{deptId} |
| | | </select> |
| | |
| | | d.orgid, |
| | | d.his_dept_id, |
| | | d.his_parent_id |
| | | d.status |
| | | d.status |
| | | from sys_dept d |
| | | where del_flag = 0 |
| | | and d.dept_code = #{deptCode} |
| | |
| | | where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | |
| | | <insert id="batchDept"> |
| | | insert into sys_dept( |
| | | dept_id, |
| | | parent_id, |
| | | dept_name, |
| | | ancestors, |
| | | order_num, |
| | | leader, |
| | | phone, |
| | | email, |
| | | status, |
| | | dept_code, |
| | | dept_type, |
| | | create_by, |
| | | his_dept_id, |
| | | his_parent_id, |
| | | type, |
| | | guid, |
| | | orgid, |
| | | create_time |
| | | ) values |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.deptId}, |
| | | #{item.parentId}, |
| | | #{item.deptName}, |
| | | #{item.ancestors}, |
| | | #{item.orderNum}, |
| | | #{item.leader}, |
| | | #{item.phone}, |
| | | #{item.email}, |
| | | #{item.status}, |
| | | #{item.deptCode}, |
| | | #{item.deptType}, |
| | | #{item.createBy}, |
| | | #{item.hisDeptId}, |
| | | #{item.hisParentId}, |
| | | #{item.type}, |
| | | #{item.guid}, |
| | | #{item.orgid}, |
| | | now() |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | |
| | | <insert id="insertDept" parameterType="com.ruoyi.common.core.domain.entity.SysDept"> |
| | | insert into sys_dept( |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <insert id="batchUser"> |
| | | insert into sys_user( |
| | | user_id, dept_id, user_name, nick_name, email, avatar, phonenumber, sex, password, status, create_by, remark, |
| | | user_type, dept_info, hosp_info, searchscope, id_card, title, job_phone, birthday, his_user_id, guid, orgid, |
| | | create_time |
| | | ) values |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.userId}, |
| | | #{item.deptId}, |
| | | #{item.userName}, |
| | | #{item.nickName}, |
| | | #{item.email}, |
| | | #{item.avatar}, |
| | | #{item.phonenumber}, |
| | | #{item.sex}, |
| | | #{item.password}, |
| | | #{item.status}, |
| | | #{item.createBy}, |
| | | #{item.remark}, |
| | | #{item.userType}, |
| | | #{item.deptInfo}, |
| | | #{item.hospInfo}, |
| | | #{item.searchscope}, |
| | | #{item.idCard}, |
| | | #{item.title}, |
| | | #{item.jobPhone}, |
| | | #{item.birthday}, |
| | | #{item.hisUserId}, |
| | | #{item.guid}, |
| | | #{item.orgid}, |
| | | now() |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <update id="updateUser" parameterType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | update sys_user |
| | | <set> |
| | |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="updateUserStatus" parameterType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | update sys_user |
| | | set status = #{status} |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="updateUserAvatar" parameterType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | update sys_user |