Browse Source

医院排名BUG

master
zhizhi wu 4 years ago
parent
commit
7db5768f71
  1. 4
      src/main/java/com/ccsens/carbasics/api/StatisticalController.java
  2. 25
      src/main/resources/mapper_dao/OrganizationDao.xml

4
src/main/java/com/ccsens/carbasics/api/StatisticalController.java

@ -161,9 +161,9 @@ public class StatisticalController {
@ApiOperation(value = "山西省地市查询", notes = "山西省地市查询")
@RequestMapping(value = "/provinceCity", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<StatisticalVo.ProvinceCity>> provinceCityStatistical(@ApiParam @Validated @RequestBody QueryDto<StatisticalDto.ProvinceCode> params) {
log.info("各地-溶栓患者/机械再通/脑出血:{}", params);
log.info("山西省地市查询:{}", params);
List<StatisticalVo.ProvinceCity> provinceCity = statisticalService.provinceCityStatistical(params.getParam(), params.getUserId());
log.info("各地-溶栓患者/机械再通/脑出血结果:{}", provinceCity);
log.info("山西省地市查询结果:{}", provinceCity);
return JsonResponse.newInstance().ok(provinceCity);
}
}

25
src/main/resources/mapper_dao/OrganizationDao.xml

@ -135,14 +135,19 @@
IF( find_in_set( parent_id, @pids ) &gt; 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild
FROM
( SELECT t.*, p.parent_id FROM t_organization t, t_organization_parent p WHERE t.id = p.organization_id ORDER BY parent_id, id ) t1,
( SELECT @pids := 2 ) t2
<choose>
<when test="areaId == null">( SELECT @pids := 0 ) t2</when>
<otherwise>( SELECT @pids := #{areaId} ) t2</otherwise>
</choose>
) t3
WHERE
ischild != 0
organizationType = 3
<if test="areaId != null">
and ischild != 0
</if>
<if test="level != null">
AND level = #{level}
</if>
AND organizationType = 3
</otherwise>
</choose>
) h
@ -230,14 +235,22 @@
IF( find_in_set( parent_id, @pids ) &gt; 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild
FROM
( SELECT t.*, p.parent_id FROM t_organization t, t_organization_parent p WHERE t.id = p.organization_id ORDER BY parent_id, id ) t1,
( SELECT @pids := 2 ) t2
<choose>
<when test="areaId == null">( SELECT @pids := 0 ) t2</when>
<otherwise>( SELECT @pids := #{areaId} ) t2</otherwise>
</choose>
) t3
WHERE
ischild != 0
organizationType = 3
<if test="areaId != null">
and ischild != 0
</if>
<if test="level != null">
AND level = #{level}
</if>
AND organizationType = 3
</otherwise>
</choose>
) h

Loading…
Cancel
Save