@ -12,6 +12,7 @@
#{id}
</foreach>
and r2.answer - r1.answer < 6 * 60 * 60 * 1000
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
</select>
<select id= "countSpecifyAnswer" resultType= "java.lang.Long" >
@ -22,6 +23,7 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0
</select>
<select id= "countDnt" resultType= "com.ccsens.carbasics.bean.vo.StatisticalVo$Dnt" >
@ -37,6 +39,7 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
</select>
<select id= "countDpt" resultType= "com.ccsens.carbasics.bean.vo.StatisticalVo$Dpt" >
@ -54,6 +57,7 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
</select>
<select id= "countMedian" resultType= "java.math.BigDecimal" >
@ -71,6 +75,7 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
)d,
(SELECT @rownum:=0) r
@ -83,15 +88,16 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "hospital_id in (" close= ")" >
#{id}
</foreach>
AND value_type = 0 and data_status in (1, 3, 5, 6)
and unix_timestamp(created_at)*1000 > = #{startTime} and unix_timestamp(created_at)*1000 < = #{endTime} and rec_status = 0
</select>
<select id= "countThrombosisRateDate" resultType= "com.ccsens.carbasics.bean.vo.StatisticalVo$Item" >
select t1.date as name, concat(round(t2.part * 100 / t1.total, 2), '%') as value from
(select
<choose >
<when test= "type == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H') as date,</when>
<when test= "type == 1" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</when>
<when test= "type == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') as date,</when>
<when test= "coun tT ype == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H') as date,</when>
<when test= "coun tT ype == 1" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</when>
<when test= "coun tT ype == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') as date,</when>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</otherwise>
</choose>
count(*) as total from t_qcp_first_aid a, t_qcp_first_aid_record r1 , t_qcp_first_aid_record r2
@ -102,20 +108,21 @@
#{id}
</foreach>
and r2.answer - r1.answer < 6 * 60 * 60 * 1000
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
group by
<choose >
<when test= "type == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H')</when>
<when test= "type == 1" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') </when>
<when test= "type == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') </when>
<when test= "coun tT ype == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H')</when>
<when test= "coun tT ype == 1" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') </when>
<when test= "coun tT ype == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') </when>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') </otherwise>
</choose>
) t1,
(select
<choose >
<when test= "type == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H') as date,</when>
<when test= "type == 1" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</when>
<when test= "type == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') as date,</when>
<when test= "coun tT ype == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H') as date,</when>
<when test= "coun tT ype == 1" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</when>
<when test= "coun tT ype == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') as date,</when>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</otherwise>
</choose>
count(a.id) as part from t_qcp_first_aid a, t_qcp_first_aid_record r1, t_qcp_first_aid_record r2
@ -125,12 +132,13 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0
group by
<choose >
<when test= "type == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H')</when>
<when test= "type == 1" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') </when>
<when test= "type == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') </when>
<when test= "coun tT ype == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H')</when>
<when test= "coun tT ype == 1" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') </when>
<when test= "coun tT ype == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') </when>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') </otherwise>
</choose>
)t2
@ -153,6 +161,7 @@
<foreach collection= "hospitalIds" open= "(" close= ")" separator= "," item= "hospitalId" >
#{hospitalId}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND r1.rec_status = 0
<if test= "param.startTime!=null and param.startTime!=0" >
@ -185,6 +194,7 @@
#{id}
</foreach>
AND r2.answer - r1.answer < 6 * 60 * 60 * 1000
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND r1.rec_status = 0
AND r2.rec_status = 0
@ -212,6 +222,7 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "AND a.hospital_id IN (" close= ")" >
#{id}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
) d,
(select @rk := 0, @team := '') t
@ -232,6 +243,7 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "AND a.hospital_id IN (" close= ")" >
#{id}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
group by
<choose >
@ -252,7 +264,7 @@
from (
select city.id, city.short_name as shortName, aid.val from
(select city.id, city.short_name from t_organization o, t_organization_parent p, t_organization city
where o.id = p.parent_id and p.organization_id = city.id
where o.id = p.parent_id and p.organization_id = city.id AND city.organization_type = 2
and o.code = #{param.code} and o.rec_status = 0 and p.rec_status = 0 and city.rec_status = 0) city
left join
(select o.id, o.name, p.parent_id from t_organization o, t_organization_parent p where o.id = p.organization_id and o.organization_type = 3 and o.rec_status = 0 and p.rec_status = 0) hospital on city.id = hospital.parent_id
@ -264,7 +276,8 @@
from t_qcp_first_aid a, t_qcp_first_aid_record r1 , t_qcp_first_aid_record r2
where a.id = r1.first_aid_id and r1.question_code = #{param.minuendCode}
and a.id = r2.first_aid_id and r2.question_code = #{param.subtractionCode}
and r1.answer + 0 > = #{startTime} and r1.answer + 0 < = #{endTime}
and r1.answer + 0 > = #{param.startTime} and r1.answer + 0 < = #{param.endTime}
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
) aid on hospital.id = aid.hospital_id
) t1, (select @rk := 0, @team := '') a order by id,val) b
@ -285,7 +298,8 @@
from t_qcp_first_aid a, t_qcp_first_aid_record r1 , t_qcp_first_aid_record r2
where a.id = r1.first_aid_id and r1.question_code = #{param.minuendCode}
and a.id = r2.first_aid_id and r2.question_code = #{param.subtractionCode}
and r1.answer + 0 > = #{startTime} and r1.answer + 0 < = #{endTime}
and r1.answer + 0 > = #{param.startTime} and r1.answer + 0 < = #{param.endTime}
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
) aid on hospital.id = aid.hospital_id
group by city.id
@ -318,6 +332,7 @@
<foreach collection= "hospitalIds" open= "(" close= ")" separator= "," item= "hospitalId" >
#{hospitalId}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND r1.rec_status = 0
GROUP BY
@ -348,7 +363,8 @@
WHERE
o.id = p.parent_id
AND p.organization_id = city.id
AND o. CODE = 'SXSZK'
AND o.code = #{code}
AND city.organization_type = 2
AND o.rec_status = 0
AND p.rec_status = 0
AND city.rec_status = 0
@ -382,11 +398,8 @@
AND r2.question_code = 'JBXX-DYSJ'
AND r2.answer + 0 > = #{startTime}
AND r2.answer + 0 < = #{endTime}
AND a.hospital_id IN
<foreach collection= "hospitalIds" item= "id" separator= "," open= "(" close= ")" >
#{id}
</foreach>
AND r2.answer - r1.answer < 6 * 60 * 60 * 1000
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND r1.rec_status = 0
AND r2.rec_status = 0
@ -409,10 +422,7 @@
AND r2.question_code = #{timeGist}
AND r2.answer + 0 > = #{startTime}
AND r2.answer + 0 < = #{endTime}
AND a.hospital_id IN
<foreach collection= "hospitalIds" item= "id" separator= "," open= "(" close= ")" >
#{id}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND r1.rec_status = 0
GROUP BY
@ -440,7 +450,8 @@
WHERE
o.id = p.parent_id
AND p.organization_id = city.id
AND o. CODE = 'SXSZK'
AND o.code = #{param.code}
AND city.organization_type = 2
AND o.rec_status = 0
AND p.rec_status = 0
AND city.rec_status = 0
@ -474,10 +485,7 @@
AND r2.question_code = #{param.accordCode}
AND r2.answer + 0 > = #{param.startTime}
AND r2.answer + 0 < = #{param.endTime}
AND a.hospital_id IN
<foreach collection= "hospitalIds" item= "id" separator= "," open= "(" close= ")" >
#{id}
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND r1.rec_status = 0
GROUP BY
@ -503,7 +511,8 @@
WHERE
o.id = p.parent_id
AND p.organization_id = city.id
AND o.CODE = 'SXSZK'
AND o.CODE = #{code}
AND city.organization_type = 2
AND o.rec_status = 0
AND p.rec_status = 0
AND city.rec_status = 0
@ -536,11 +545,8 @@
AND r1.question_code = 'JBXX-DYSJ'
AND r2.answer + 0 > = #{startTime}
AND r2.answer + 0 < = #{endTime}
AND a.hospital_id IN
<foreach collection= "hospitalIds" item= "id" separator= "," open= "(" close= ")" >
#{id}
</foreach>
AND r2.answer - r1.answer < 6 * 60 * 60 * 1000
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND r1.rec_status = 0
AND r2.rec_status = 0
@ -551,22 +557,9 @@
city.id
</select>
<resultMap id= "provinceCityStatistical" type= "com.ccsens.carbasics.bean.vo.StatisticalVo$ProvinceCity" >
<id column= "id" property= "id" />
<result column= "code" property= "code" />
<result column= "shortName" property= "shortName" />
<result column= "projectId" property= "projectId" />
<result column= "parentId" property= "parentId" />
<collection property= "children" ofType= "com.ccsens.carbasics.bean.vo.StatisticalVo$ProvinceCity" >
<id column= "parentId" property= "parentId" />
<result column= "id" property= "id" />
<result column= "code" property= "code" />
<result column= "shortName" property= "shortName" />
<result column= "projectId" property= "projectId" />
</collection>
</resultMap>
<select id= "provinceCityStatistical" resultMap= "provinceCityStatistical " >
<select id= "provinceCityStatistical" resultType= "com.ccsens.carbasics.bean.vo.StatisticalVo$ProvinceCity" >
SELECT
o.id,
o.CODE,