添加筛查统计
This commit is contained in:
parent
1d86f99afa
commit
0aeb082eff
@ -160,6 +160,7 @@ public class PatientAndDiseaseVO implements Serializable {
|
||||
|
||||
|
||||
private String disease;
|
||||
private String signNo;
|
||||
/**
|
||||
* 基础疾病信息
|
||||
*/
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
<result property="disablingReason" column="disabling_reason"/>
|
||||
<result property="patientCode" column="patient_code"/>
|
||||
<result property="disease" column="disease"/>
|
||||
<result property="signNo" column="sign_no"/>
|
||||
<collection property="patientDiseaseInfoList" javaType="java.util.List" resultMap="PatientDiseaseInfoResult"/>
|
||||
</resultMap>
|
||||
|
||||
@ -83,6 +84,7 @@
|
||||
pi.disabling_reason,
|
||||
pi.patient_code,
|
||||
pi.disease,
|
||||
pi.sign_no,
|
||||
pdi.id patientDiseaseId,
|
||||
pdi.disease_id,
|
||||
pdi.disease_name,
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package com.xinelu.manage.controller.evaluateresult;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.manage.service.evaluateresult.EvaluateResultService;
|
||||
import com.xinelu.manage.vo.evaluateresult.EvaluateResultVo;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 筛查结果统计
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/evaluateResult")
|
||||
public class EvaluateResultController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private EvaluateResultService evaluateResultService;
|
||||
|
||||
/**
|
||||
* 根据年龄端性别统计筛查结果
|
||||
* @param ageA
|
||||
* @param ageB
|
||||
* @param sex
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list/{ageA}/{ageB}/{sex}")
|
||||
public TableDataInfo list(@PathVariable("ageA") String ageA, @PathVariable("ageB") String ageB,@PathVariable("sex")String sex) {
|
||||
startPage();
|
||||
List<EvaluateResultVo> list = evaluateResultService.list(ageA,ageB,sex);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.xinelu.manage.mapper.evaluateresult;
|
||||
|
||||
import com.xinelu.manage.vo.evaluateresult.EvaluateResultVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface EvaluateResultMapper {
|
||||
|
||||
/**
|
||||
* 根据年龄端性别统计筛查结果
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @param sex
|
||||
*/
|
||||
List<EvaluateResultVo> list(@Param("startTime") String startTime, @Param("endTime")String endTime, @Param("sex") String sex);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xinelu.manage.service.evaluateresult;
|
||||
|
||||
import com.xinelu.manage.vo.evaluateresult.EvaluateResultVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface EvaluateResultService {
|
||||
/**
|
||||
* 根据年龄端性别统计筛查结果
|
||||
* @param ageA
|
||||
* @param ageB
|
||||
* @param sex
|
||||
* @return
|
||||
*/
|
||||
List<EvaluateResultVo> list(String ageA, String ageB, String sex);
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.xinelu.manage.service.evaluateresult.impl;
|
||||
import com.xinelu.manage.mapper.evaluateresult.EvaluateResultMapper;
|
||||
import com.xinelu.manage.service.evaluateresult.EvaluateResultService;
|
||||
import com.xinelu.manage.vo.evaluateresult.EvaluateResultVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class EvaluateResultServiceimpl implements EvaluateResultService {
|
||||
|
||||
@Resource
|
||||
private EvaluateResultMapper evaluateResultMapper;
|
||||
|
||||
/**
|
||||
* 根据年龄端性别统计筛查结果
|
||||
* @param ageA
|
||||
* @param ageB
|
||||
* @param sex
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<EvaluateResultVo> list(String ageA, String ageB, String sex) {
|
||||
String timeMinus = "-01"+"-01";
|
||||
//开始时间
|
||||
String startTime = calculateBirthYear(Integer.parseInt(ageB))+timeMinus;
|
||||
//结束时间
|
||||
String endTime = calculateBirthYear(Integer.parseInt(ageA))+timeMinus;
|
||||
return evaluateResultMapper.list(startTime, endTime, sex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 年龄转日期
|
||||
* @param age
|
||||
* @return
|
||||
*/
|
||||
public static int calculateBirthYear(int age) {
|
||||
int currentYear = java.time.Year.now().getValue();
|
||||
int birthYear = currentYear - age;
|
||||
return birthYear;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.xinelu.manage.vo.evaluateresult;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class EvaluateResultVo implements Serializable {
|
||||
/**数量*/
|
||||
|
||||
private Integer count;
|
||||
/**结果*/
|
||||
|
||||
private String evaluateResult;
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.manage.mapper.evaluateresult.EvaluateResultMapper">
|
||||
<resultMap type="com.xinelu.manage.vo.evaluateresult.EvaluateResultVo" id="EvaluateResult">
|
||||
<result property="count" column="t"/>
|
||||
<result property="evaluateResult" column="evaluate_result"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="list" parameterType="String" resultMap="EvaluateResult">
|
||||
select count(1) t,er.evaluate_result
|
||||
from patient_info pi
|
||||
left join evaluate_record er
|
||||
on pi.id = er.user_id
|
||||
<where>
|
||||
<if test="sex != null and sex != ''">
|
||||
and pi.sex = #{sex}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
and pi.birth_date BETWEEN #{startTime} and #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
group by er.evaluate_result
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user