【丽水】首页查询出、入院看病人次和人数,出院服务量分为首次服务、再次服务、专病服务
已修改3个文件
141 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatMedRes.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java
@@ -10,7 +10,6 @@
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysConfigService;
import com.smartor.domain.PatMedInhosp;
import com.smartor.domain.PatMedInhospVO;
import com.smartor.domain.PatMedReq;
@@ -42,11 +41,6 @@
    @Autowired
    private IPatMedOuthospService iPatMedOuthospService;
    //todo
    @Autowired
    private ISysConfigService configService;
    /**
     * 查询患者住院记录列表
@@ -107,6 +101,9 @@
        return success(patMedInhospService.getDeptCodeByPatId(patMedInhosp));
    }
    /**
     * 查询出、入院看病人次和人数(人数分为首次服务、再次服务、专病服务)
     */
    @PostMapping("/selectPatMedInhospListCount")
    @ApiOperation("查询出、入院看病人次和人数")
    public AjaxResult selectPatMedInhospListCount(@RequestBody PatMedReq patMedReq) {
@@ -212,11 +209,4 @@
//        }
//    }
    @ApiOperation("测试定时任务dealOutHospInfo")
    @PostMapping("/dealOutHospInfo")
    public void dealOutHospInfo() {
        String config = configService.selectConfigByKey("visit.early.day");
        //出院表
        patMedInhospService.dealOutHospInfo(config);
    }
}
smartor/src/main/java/com/smartor/domain/PatMedRes.java
@@ -35,4 +35,21 @@
    @ApiModelProperty(value = "人数")
    private Integer rs;
    /**
     * 首次随访人数
     */
    @ApiModelProperty(value = "首次随访人数")
    private Integer scsf;
    /**
     * 再次随访人数
     */
    @ApiModelProperty(value = "再次随访人数")
    private Integer zcsf;
    /**
     * 专病随访人数
     */
    @ApiModelProperty(value = "专病随访人数")
    private Integer zbsf;
}
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -920,11 +920,18 @@
    <select id="selectPatMedInhospCount" parameterType="com.smartor.domain.PatMedReq"
            resultType="com.smartor.domain.PatMedRes">
        SELECT SUM( rs ) AS rs,
        SUM( rc ) AS rc
        SUM( rc ) AS rc,
        SUM( scsf ) AS scsf,
        SUM( zcsf ) AS zcsf,
        SUM( zbsf ) AS zbsf
        FROM (
        <!-- 出院人次-->
        SELECT
        COUNT(1) AS rc,
        0 AS rs
        0 AS rs,
        0 AS scsf,
        0 AS zcsf,
        0 AS zbsf
        FROM
        pat_med_inhosp
        <where>
@@ -954,12 +961,15 @@
                    </foreach>
                </if>
            </if>
        </where>
        <!-- 随访服务人数 -->
        union all
        select
        0 AS rc,
        count(1) AS rs
        count(1) AS rs,
        0 AS scsf,
        0 AS zcsf,
        0 AS zbsf
        FROM
        service_subtask
        <where>
@@ -981,6 +991,96 @@
                </foreach>
            </if>
        </where>
        <!-- 首次随访人数 -->
        union all
        select
        0 AS rc,
        0 AS rs,
        count(1) AS scsf,
        0 AS zcsf,
        0 AS zbsf
        FROM
        service_subtask
        <where>
            del_flag = 0
            and service_type=2
            and is_visit_again = 0
            <if test="orgid != null">
                AND orgid = #{orgid}
            </if>
            <if test="startDate != null">
                AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
            </if>
            <if test="endDate != null">
                AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
            </if>
            <if test="deptcodeList != null   and deptcodeList.size() > 0">
                and deptcode in
                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                    #{deptcode}
                </foreach>
            </if>
        </where>
        <!-- 再次随访人数 -->
        union all
        select
        0 AS rc,
        0 AS rs,
        0 AS scsf,
        count(1) AS zcsf,
        0 AS zbsf
        FROM
        service_subtask
        <where>
            del_flag = 0
            and service_type=2
            and is_visit_again = 1
            <if test="orgid != null">
                AND orgid = #{orgid}
            </if>
            <if test="startDate != null">
                AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
            </if>
            <if test="endDate != null">
                AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
            </if>
            <if test="deptcodeList != null   and deptcodeList.size() > 0">
                and deptcode in
                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                    #{deptcode}
                </foreach>
            </if>
        </where>
        <!-- 专病随访人数 -->
        union all
        select
        0 AS rc,
        0 AS rs,
        0 AS scsf,
        0 AS zcsf,
        count(1) AS zbsf
        FROM
        service_subtask
        <where>
            del_flag = 0
            and service_type=13
            <if test="orgid != null">
                AND orgid = #{orgid}
            </if>
            <if test="startDate != null">
                AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
            </if>
            <if test="endDate != null">
                AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
            </if>
            <if test="deptcodeList != null   and deptcodeList.size() > 0">
                and deptcode in
                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                    #{deptcode}
                </foreach>
            </if>
        </where>
        ) AS combined_data
    </select>
</mapper>