liusheng
9 天以前 5a6f20263ef584485ae3df8b6f25b4e2fb970293
代码提交
已修改5个文件
50 ■■■■ 文件已修改
smartor/src/main/java/com/smartor/domain/PatArchive.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/HNGatherPatArchiveMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchive.java
@@ -404,5 +404,16 @@
     */
    @ApiModelProperty("pageSize")
    private Integer pageSize;
    /**
     * pageNum
     */
    @ApiModelProperty("pn")
    private Integer pn;
    /**
     * pageSize
     */
    @ApiModelProperty("ps")
    private Integer ps;
}
smartor/src/main/java/com/smartor/mapper/HNGatherPatArchiveMapper.java
@@ -36,6 +36,7 @@
    public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp);
    public Long selectPatMedInhospListCount(PatMedInhosp patMedInhosp);
    public Long selectPatArchiveCount(PatMedInhosp patMedInhosp);
    /**
     * 门急诊信息
smartor/src/main/java/com/smartor/service/impl/HNGatherPatArchiveServiceImpl.java
@@ -73,6 +73,22 @@
    @Override
    public Integer selectPatMedInhospList(PatMedInhosp patMedInhosp) {
        Long patArchiveCount = hnGatherPatArchiveMapper.selectPatArchiveCount(null);
        Long patOffst = (patArchiveCount + 1000 - 1) / 1000;
        PatArchive patArchive = new PatArchive();
        Long patSize = 0L;
        for (int i = 0; i <= patOffst; i++) {
            patArchive.setPs(1000);
            patArchive.setPn(1000 * i);
            List<PatArchive> patArchives = hnGatherPatArchiveMapper.selectPatArchiveList(patArchive);
            if (patArchives != null && !patArchives.isEmpty()) {
                patArchiveMapper.insertPatArchive(patArchives);
            }
            patSize = patSize + patArchives.size();
        }
        log.info("patArchives处理结束一共:{}", patSize);
        Long count = hnGatherPatArchiveMapper.selectPatMedInhospListCount(null);
        Long aa = (count + 1000 - 1) / 1000;
        //进行分页查询
@@ -82,18 +98,12 @@
            List<PatMedInhosp> patMedInhospList = hnGatherPatArchiveMapper.selectPatMedInhospList(patMedInhosp);
            for (PatMedInhosp pm : patMedInhospList) {
                String patno = pm.getPatno();
                PatArchive patArchive = new PatArchive();
                PatArchive pa = new PatArchive();
                //先去我们自己的表里通过patno查询该患者是否存在
                patArchive.setPatientno(patno);
                List<PatArchive> patArchives = patArchiveMapper.selectPatArchiveList(patArchive);
                pa.setPatientno(patno);
                List<PatArchive> patArchives = patArchiveMapper.selectPatArchiveList(pa);
                if (CollectionUtils.isEmpty(patArchives)) {
                    //不存在,则通过patno去HIS表hzjbxx查询
                    List<PatArchive> patArchives1 = hnGatherPatArchiveMapper.selectPatArchiveList(patArchive);
                    //把查询出来的数据存到pat_archive表
                    PatArchive pa = patArchives1.get(0);
                    pa.setId(null);
                    patArchiveMapper.insertPatArchiveSingle(pa);
                    pm.setPatid(pa.getId());
                    continue;
                } else {
                    //直接将patid放到出入院表中
                    pm.setPatid(patArchives.get(0).getId());
@@ -103,7 +113,6 @@
                patMedInhospMapper.insertPatMedInhospBatch(patMedInhospList);
            }
        }
        return null;
    }
smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
@@ -389,6 +389,7 @@
            <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
            <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
        </where>
        limit #{ps} OFFSET #{pn}
    </select>
@@ -396,6 +397,10 @@
        select count(*)
        FROM cryxx
    </select>
    <select id="selectPatArchiveCount" parameterType="com.smartor.domain.PatMedInhosp" resultType="Long">
        select count(*)
        FROM hzjbxx
    </select>
    <select id="selectPatMedInhospList" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult">
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -996,8 +996,6 @@
        a.place_of_residence,
        a.birthplace,
        a.birthdate,
        -- a.icd10code as leaveicd10code,
        -- a.diagname as leavediagname,
        a.age,
        a.age2,
        a.viptype,