Commit 150fa42b4d141ceb0dd48fcb041d64faf60893ba

Authored by shiyang
1 parent a57ada9b0e

隆化11月需求-孕产妇围产管理---统计管理---外院建档本院分娩统计、外院建档本院分娩统计

Showing 6 changed files with 168 additions and 0 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterMysqlAntexcMapper.java View file @ 150fa42
... ... @@ -144,5 +144,9 @@
144 144 int getNameFmCount(Map param);
145 145 int getNameBuildCount(Map param);
146 146 int getBuildAndFmCount(Map param);
  147 +
  148 + List<Map<String, String>> getgetLhByFmManage(Map param);
  149 +
  150 + List<Map<String, String>> getLhWyFmManage(Map param);
147 151 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/MysqlAntexcService.java View file @ 150fa42
... ... @@ -149,5 +149,9 @@
149 149 int getNameFmCount(Map param);
150 150 int getNameBuildCount(Map param);
151 151 int getBuildAndFmCount(Map param);
  152 +
  153 + List<Map<String, String>> getLhByFmManage(Map param);
  154 +
  155 + List<Map<String, String>> getLhWyFmManage(Map param);
152 156 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MysqlAntexcServiceImpl.java View file @ 150fa42
... ... @@ -434,5 +434,15 @@
434 434 return masterMysqlAntexcMapper.getBuildAndFmCount(param);
435 435 }
436 436  
  437 + @Override
  438 + public List<Map<String, String>> getLhByFmManage(Map param) {
  439 + return masterMysqlAntexcMapper.getgetLhByFmManage(param);
  440 + }
  441 +
  442 + @Override
  443 + public List<Map<String, String>> getLhWyFmManage(Map param) {
  444 + return masterMysqlAntexcMapper.getLhWyFmManage(param);
  445 + }
  446 +
437 447 }
platform-biz-service/src/main/resources/mainOrm/master/MasterMysqlAntexc.xml View file @ 150fa42
... ... @@ -2898,6 +2898,76 @@
2898 2898 </if>
2899 2899 </select>
2900 2900  
  2901 + <select id="getgetLhByFmManage" resultType="java.util.Map" parameterType="java.util.Map">
  2902 + SELECT
  2903 + p.username,
  2904 + f.dueDate1 AS fmDate,
  2905 + o.NAME AS hospitalName,
  2906 + u.NAME AS buildDoctorName
  2907 + FROM
  2908 + report_matdeliver f
  2909 + INNER JOIN organization o ON f.fmHospital = o.id
  2910 + INNER JOIN report_patients p ON p.patientId = f.sourceId
  2911 + INNER JOIN users u ON u.id = p.bookbuildingDoctor
  2912 + WHERE
  2913 + p.ENABLE IS NULL
  2914 + <if test="hospitalId != null">
  2915 + and p.hospitalId IN
  2916 + <foreach item="item" index="index" collection="hospitalId" open="(" separator="," close=")">
  2917 + #{item}
  2918 + </foreach>
  2919 + </if>
  2920 + <if test="startTime != null">
  2921 + and f.dueDate1 >= #{startTime}
  2922 + </if>
  2923 + <if test="endTime != null">
  2924 + and f.dueDate1 <![CDATA[ <= ]]> #{endTime}
  2925 + </if>
  2926 + <if test="doctorId != null">
  2927 + and u.id= #{doctorId,jdbcType=INTEGER}
  2928 + </if>
  2929 + ORDER BY
  2930 + o.NAME ASC
  2931 +
  2932 + </select>
  2933 +
  2934 + <select id="getLhWyFmManage" resultType="java.util.Map" parameterType="java.util.Map">
  2935 + SELECT
  2936 + p.cardNo,
  2937 + p.username,
  2938 + f.dueDate1 AS fmDate,
  2939 + o.NAME AS hospitalName,
  2940 + uf.NAME AS fmDoctorName,
  2941 + bo.NAME AS buildHospital
  2942 + FROM
  2943 + report_matdeliver f
  2944 + INNER JOIN organization o ON f.fmHospital = o.id
  2945 + INNER JOIN report_patients p ON p.patientId = f.sourceId
  2946 + INNER JOIN users uf ON uf.id = f.fmDoctor
  2947 + INNER JOIN organization bo ON p.hospitalId = bo.id
  2948 + WHERE
  2949 + p.ENABLE IS NULL
  2950 + <if test="hospitalId != null">
  2951 + AND f.fmHospital=#{hospitalId,jdbcType=INTEGER}
  2952 + </if>
  2953 + <if test="startTime != null">
  2954 + AND f.dueDate1 >= #{startTime}
  2955 + </if>
  2956 + <if test="endTime != null">
  2957 + AND f.dueDate1 <![CDATA[ <= ]]> #{endTime}
  2958 + </if>
  2959 + AND p.bookbuildingDoctor NOT IN (
  2960 + SELECT
  2961 + id
  2962 + FROM
  2963 + users u
  2964 + WHERE 1=1
  2965 + <if test="hospitalId != null">
  2966 + AND u.org_id=#{hospitalId,jdbcType=INTEGER}
  2967 + </if>
  2968 + )
  2969 +
  2970 + </select>
2901 2971  
2902 2972  
2903 2973 </mapper>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java View file @ 150fa42
... ... @@ -698,5 +698,37 @@
698 698 return matDeliverFacade.getFmManageCount(time, loginState.getId());
699 699 }
700 700  
  701 + /**
  702 + * 隆化-定制,外院建档本院分娩统计
  703 + * @param request
  704 + * @param startTime,endtime,doctorId
  705 + * @return
  706 + */
  707 + @TokenRequired
  708 + @ResponseBody
  709 + @RequestMapping(value = "getLhByFmManage", method = RequestMethod.GET)
  710 + public BaseObjectResponse getLhByFmManage(HttpServletRequest request,
  711 + @RequestParam(required = false) Date startTime,
  712 + @RequestParam(required = false) Date endTime,
  713 + @RequestParam(required = false) Integer doctorId) {
  714 + return matDeliverFacade.getLhByFmManage(startTime,endTime,doctorId);
  715 + }
  716 +
  717 + /**
  718 + * 隆化-定制,外院建档本院分娩统计
  719 + * @param request
  720 + * @param startTime,endTime
  721 + * @return
  722 + */
  723 + @TokenRequired
  724 + @ResponseBody
  725 + @RequestMapping(value = "getLhWyFmManage", method = RequestMethod.GET)
  726 + public BaseObjectResponse getLhWyFmManage(HttpServletRequest request,
  727 + @RequestParam(required = false) Date startTime,
  728 + @RequestParam(required = false) Date endTime) {
  729 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  730 + return matDeliverFacade.getLhWyFmManage(startTime,endTime, loginState.getId());
  731 + }
  732 +
701 733 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ 150fa42
... ... @@ -3758,5 +3758,53 @@
3758 3758 objectResponse.setData(datas);
3759 3759 return objectResponse;
3760 3760 }
  3761 +
  3762 + public BaseObjectResponse getLhByFmManage(Date startTime,Date endTime,Integer doctorId) {
  3763 + Map param = new HashMap();
  3764 + //承德市中心医院、承德市附属医院、承德市妇幼、河北省隆化县医院、隆化县中医医院、隆化县妇幼保健院、隆化县隆化镇医院
  3765 + String[] array={"2100001605","2100001402","2100001401","2100001291","2100001695","2100001696","2100002048"};
  3766 + param.put("hospitalId",array);
  3767 + param.put("startTime",startTime);
  3768 + param.put("endTime",endTime);
  3769 + param.put("doctorId",doctorId);//建档医生id int u.id
  3770 + List<Map<String,String>>list =mysqlAntexcService.getLhByFmManage(param);
  3771 + //统计本院和外院分娩数量
  3772 + Map<String,String> mapCount=new HashMap<>();
  3773 + int by=0;
  3774 + int wy=0;
  3775 + for (Map<String, String> strMap : list) {
  3776 + //本院
  3777 + if("隆化县妇幼保健院".equals(strMap.get("hospitalName"))){
  3778 + by++;
  3779 + }else {
  3780 + wy++;
  3781 + }
  3782 + }
  3783 + mapCount.put("by",String.valueOf(by));
  3784 + mapCount.put("wy",String.valueOf(wy));
  3785 + mapCount.put("total",String.valueOf(by+wy));
  3786 + mapCount.put("ratio",(by+wy)==0?"0%":String.valueOf(by/(by+wy)*100)+"%");
  3787 + list.add(mapCount);
  3788 + BaseObjectResponse objectResponse = new BaseObjectResponse();
  3789 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  3790 + objectResponse.setErrormsg("成功");
  3791 + objectResponse.setData(list);
  3792 + return objectResponse;
  3793 + }
  3794 +
  3795 + public BaseObjectResponse getLhWyFmManage(Date startTime,Date endTime, Integer userId) {
  3796 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  3797 + Map param = new HashMap();
  3798 + param.put("hospitalId",Integer.valueOf(hospitalId));//当前登录用户医院的id
  3799 + param.put("startTime",startTime);
  3800 + param.put("endTime",endTime);
  3801 + List<Map<String,String>>list =mysqlAntexcService.getLhWyFmManage(param);
  3802 +
  3803 + BaseObjectResponse objectResponse = new BaseObjectResponse();
  3804 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  3805 + objectResponse.setErrormsg("成功");
  3806 + objectResponse.setData(list);
  3807 + return objectResponse;
  3808 + }
3761 3809 }