9 changed files with 209 additions and 9 deletions
@ -1,6 +1,6 @@ |
|||
spring: |
|||
profiles: |
|||
active: prod |
|||
include: common, util-prod |
|||
active: dev |
|||
include: common, util-dev |
|||
|
|||
|
|||
|
@ -0,0 +1,18 @@ |
|||
package com.ccsens.wisdomcar.persist.dao; |
|||
|
|||
import com.ccsens.wisdomcar.bean.dto.StatisticsDto; |
|||
import com.ccsens.wisdomcar.bean.vo.StatisticsVo; |
|||
import com.ccsens.wisdomcar.persist.mapper.FirstAidMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface StatisticsDao extends FirstAidMapper { |
|||
public List<StatisticsVo.UseNumVo> selResult(@Param("param")StatisticsDto.UseNum param); |
|||
|
|||
List<StatisticsVo.PointTime> getPointTimeCurrent(@Param("id") Long id); |
|||
|
|||
List<StatisticsVo.PointTime> getPointTimeHospital(@Param("id") Long id); |
|||
|
|||
List<StatisticsVo.PointTime> getPointTimeInternation(@Param("id") Long id); |
|||
} |
@ -0,0 +1,63 @@ |
|||
<?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.ccsens.wisdomcar.persist.dao.StatisticsDao"> |
|||
|
|||
<select id="selResult" resultType="com.ccsens.wisdomcar.bean.vo.StatisticsVo$UseNumVo" parameterType="com.ccsens.wisdomcar.bean.dto.StatisticsDto$UseNum"> |
|||
select tsm.`name`,if(tfa.num is NULL,0,tfa.num) as num FROM |
|||
(SELECT |
|||
concat( #{param.year}, `name` ) AS `name` |
|||
FROM |
|||
t_statistics_month ) tsm |
|||
LEFT JOIN ( |
|||
SELECT |
|||
tfa.da, |
|||
count( tfa.da ) AS num |
|||
FROM |
|||
( |
|||
SELECT |
|||
*, |
|||
FROM_UNIXTIME( begin_time / 1000, '%Y-%m' ) AS da |
|||
FROM |
|||
`t_first_aid` |
|||
WHERE |
|||
`t_first_aid`.rec_status = 0 |
|||
AND `t_first_aid`.hospital_id =#{param.hospitalId} |
|||
AND FROM_UNIXTIME( begin_time / 1000, '%Y-%m' ) LIKE concat(#{param.year},'-%') |
|||
) tfa |
|||
GROUP BY |
|||
tfa.da |
|||
ORDER BY |
|||
tfa.da |
|||
) tfa on tsm.`name`=tfa.`da` |
|||
</select> |
|||
|
|||
|
|||
|
|||
|
|||
<select id="getPointTimeCurrent" parameterType="java.util.Map" resultType="com.ccsens.wisdomcar.bean.vo.StatisticsVo$PointTime"> |
|||
select tfar.begin_time, tfar.type |
|||
from |
|||
t_first_aid_record tfar ,(select id from t_first_aid tfa where tfa.hospital_id=0 and tfa.rec_status=0 ORDER BY tfa.begin_time) t |
|||
where tfar.rec_status=0 and t.id = tfar.first_aid_id |
|||
</select> |
|||
|
|||
<select id="getPointTimeHospital" parameterType="java.util.Map" resultType="com.ccsens.wisdomcar.bean.vo.StatisticsVo$PointTime"> |
|||
select |
|||
ts.`name`, |
|||
MIN(tfas.duration) |
|||
from |
|||
t_first_aid_standard tfas left JOIN t_step ts on tfas.step_id = ts.id |
|||
where tfas.hospital_id=0 and tfas.type=1 and tfas.rec_status = 0 and ts.rec_status=0 |
|||
GROUP BY tfas.step_id; |
|||
</select> |
|||
|
|||
<select id="getPointTimeInternation" parameterType="java.util.Map" resultType="com.ccsens.wisdomcar.bean.vo.StatisticsVo$PointTime"> |
|||
select |
|||
ts.`name`, |
|||
MIN(tfas.duration) |
|||
from |
|||
t_first_aid_standard tfas left JOIN t_step ts on tfas.step_id = ts.id |
|||
where tfas.hospital_id=0 and tfas.type=0 and tfas.rec_status = 0 and ts.rec_status=0 |
|||
GROUP BY tfas.step_id; |
|||
</select> |
|||
</mapper> |
Loading…
Reference in new issue