@ -12,6 +12,7 @@
#{id}
#{id}
</foreach>
</foreach>
and r2.answer - r1.answer < 6 * 60 * 60 * 1000
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
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
</select>
</select>
<select id= "countSpecifyAnswer" resultType= "java.lang.Long" >
<select id= "countSpecifyAnswer" resultType= "java.lang.Long" >
@ -22,6 +23,7 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
#{id}
</foreach>
</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 a.rec_status = 0 and r1.rec_status = 0
</select>
</select>
<select id= "countDnt" resultType= "com.ccsens.carbasics.bean.vo.StatisticalVo$Dnt" >
<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= ")" >
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
#{id}
</foreach>
</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
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
</select>
</select>
<select id= "countDpt" resultType= "com.ccsens.carbasics.bean.vo.StatisticalVo$Dpt" >
<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= ")" >
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
#{id}
</foreach>
</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
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
</select>
</select>
<select id= "countMedian" resultType= "java.math.BigDecimal" >
<select id= "countMedian" resultType= "java.math.BigDecimal" >
@ -71,6 +75,7 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
#{id}
</foreach>
</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
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
)d,
)d,
(SELECT @rownum:=0) r
(SELECT @rownum:=0) r
@ -80,40 +85,44 @@
</select>
</select>
<select id= "countPatient" resultType= "java.lang.Long" >
<select id= "countPatient" resultType= "java.lang.Long" >
select count(*) from t_qcp_first_aid where
select count(*) from t_qcp_first_aid where
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a. hospital_id in (" close= ")" >
<foreach collection= "hospitalIds" item= "id" separator= "," open= "hospital_id in (" close= ")" >
#{id}
#{id}
</foreach>
</foreach>
and unix_timestamp(create_at)*1000 > = #{startTime} and unix_timestamp(create_at)*1000 < = #{endTime} and rec_status = 0
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>
<select id= "countThrombosisRateDate" resultType= "com.ccsens.carbasics.bean.vo.StatisticalVo$Item" >
<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 t1.date as name, concat(round(t2.part * 100 / t1.total, 2), '%') as value from
(select
(select
<choose >
<choose >
<when test= "type == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H') as date,</when>
<when test= "coun tT ype == 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= "coun tT ype == 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 == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') as date,</when>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</otherwise>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</otherwise>
</choose>
</choose>
count(*) as total from t_qcp_first_aid a, t_qcp_first_aid_record r1 , t_qcp_first_aid_record r2
count(*) as total 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 = 'JBXX-FBSJ'
where a.id = r1.first_aid_id and r1.question_code = 'JBXX-FBSJ'
and a.id = r2.first_aid_id and r1.question_code = 'JBXX-DYSJ'
and a.id = r2.first_aid_id and r1.question_code = 'JBXX-DYSJ'
and r2.answer + 0 > = 0 and r2.answer + 0 < = 0
and r2.answer + 0 > = #{startTime} and r2.answer + 0 < = #{endTime}
and a.hospital_id in (0)
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
</foreach>
and r2.answer - r1.answer < 6 * 60 * 60 * 1000
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
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
group by
group by
<choose >
<choose >
<when test= "type == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H')</when>
<when test= "coun tT ype == 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= "coun tT ype == 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 == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') </when>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') </otherwise>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') </otherwise>
</choose>
</choose>
) t1,
) t1,
(select
(select
<choose >
<choose >
<when test= "type == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H') as date,</when>
<when test= "coun tT ype == 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= "coun tT ype == 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 == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') as date,</when>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</otherwise>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</otherwise>
</choose>
</choose>
count(a.id) as part from t_qcp_first_aid a, t_qcp_first_aid_record r1, t_qcp_first_aid_record r2
count(a.id) as part from t_qcp_first_aid a, t_qcp_first_aid_record r1, t_qcp_first_aid_record r2
@ -123,12 +132,13 @@
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
<foreach collection= "hospitalIds" item= "id" separator= "," open= "and a.hospital_id in (" close= ")" >
#{id}
#{id}
</foreach>
</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 a.rec_status = 0 and r1.rec_status = 0
group by
group by
<choose >
<choose >
<when test= "type == 0" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d %H')</when>
<when test= "coun tT ype == 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= "coun tT ype == 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 == 2" > FROM_UNIXTIME(r2.answer/1000,'%Y-%m') </when>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') </otherwise>
<otherwise > FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') </otherwise>
</choose>
</choose>
)t2
)t2
@ -151,6 +161,7 @@
<foreach collection= "hospitalIds" open= "(" close= ")" separator= "," item= "hospitalId" >
<foreach collection= "hospitalIds" open= "(" close= ")" separator= "," item= "hospitalId" >
#{hospitalId}
#{hospitalId}
</foreach>
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND a.rec_status = 0
AND r1.rec_status = 0
AND r1.rec_status = 0
<if test= "param.startTime!=null and param.startTime!=0" >
<if test= "param.startTime!=null and param.startTime!=0" >
@ -183,6 +194,7 @@
#{id}
#{id}
</foreach>
</foreach>
AND r2.answer - r1.answer < 6 * 60 * 60 * 1000
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 a.rec_status = 0
AND r1.rec_status = 0
AND r1.rec_status = 0
AND r2.rec_status = 0
AND r2.rec_status = 0
@ -207,9 +219,10 @@
where a.id = r1.first_aid_id and r1.question_code = #{minuendCode}
where a.id = r1.first_aid_id and r1.question_code = #{minuendCode}
and a.id = r2.first_aid_id and r2.question_code = #{subtractionCode}
and a.id = r2.first_aid_id and r2.question_code = #{subtractionCode}
and r1.answer + 0 > = #{startTime} and r1.answer + 0 < = #{endTime}
and r1.answer + 0 > = #{startTime} and r1.answer + 0 < = #{endTime}
<foreach collection= "hospitalIds" item= "id" separator= "," open= "(" close= ")" >
<foreach collection= "hospitalIds" item= "id" separator= "," open= "AND a.hospital_id IN (" close= ")" >
#{id}
#{id}
</foreach>
</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
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
) d,
) d,
(select @rk := 0, @team := '') t
(select @rk := 0, @team := '') t
@ -227,9 +240,10 @@
where a.id = r1.first_aid_id and r1.question_code = #{minuendCode}
where a.id = r1.first_aid_id and r1.question_code = #{minuendCode}
and a.id = r2.first_aid_id and r2.question_code = #{subtractionCode}
and a.id = r2.first_aid_id and r2.question_code = #{subtractionCode}
and r1.answer + 0 > = #{startTime} and r1.answer + 0 < = #{endTime}
and r1.answer + 0 > = #{startTime} and r1.answer + 0 < = #{endTime}
<foreach collection= "hospitalIds" item= "id" separator= "," open= "(" close= ")" >
<foreach collection= "hospitalIds" item= "id" separator= "," open= "AND a.hospital_id IN (" close= ")" >
#{id}
#{id}
</foreach>
</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
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
group by
group by
<choose >
<choose >
@ -250,7 +264,7 @@
from (
from (
select city.id, city.short_name as shortName, aid.val 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
(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
and o.code = #{param.code} and o.rec_status = 0 and p.rec_status = 0 and city.rec_status = 0) city
left join
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
(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
@ -262,7 +276,8 @@
from t_qcp_first_aid a, t_qcp_first_aid_record r1 , t_qcp_first_aid_record r2
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}
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 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
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
) aid on hospital.id = aid.hospital_id
) aid on hospital.id = aid.hospital_id
) t1, (select @rk := 0, @team := '') a order by id,val) b
) t1, (select @rk := 0, @team := '') a order by id,val) b
@ -283,7 +298,8 @@
from t_qcp_first_aid a, t_qcp_first_aid_record r1 , t_qcp_first_aid_record r2
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}
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 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
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
) aid on hospital.id = aid.hospital_id
) aid on hospital.id = aid.hospital_id
group by city.id
group by city.id
@ -316,6 +332,7 @@
<foreach collection= "hospitalIds" open= "(" close= ")" separator= "," item= "hospitalId" >
<foreach collection= "hospitalIds" open= "(" close= ")" separator= "," item= "hospitalId" >
#{hospitalId}
#{hospitalId}
</foreach>
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND a.rec_status = 0
AND r1.rec_status = 0
AND r1.rec_status = 0
GROUP BY
GROUP BY
@ -346,7 +363,8 @@
WHERE
WHERE
o.id = p.parent_id
o.id = p.parent_id
AND p.organization_id = city.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 o.rec_status = 0
AND p.rec_status = 0
AND p.rec_status = 0
AND city.rec_status = 0
AND city.rec_status = 0
@ -380,11 +398,8 @@
AND r2.question_code = 'JBXX-DYSJ'
AND r2.question_code = 'JBXX-DYSJ'
AND r2.answer + 0 > = #{startTime}
AND r2.answer + 0 > = #{startTime}
AND r2.answer + 0 < = #{endTime}
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 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 a.rec_status = 0
AND r1.rec_status = 0
AND r1.rec_status = 0
AND r2.rec_status = 0
AND r2.rec_status = 0
@ -407,10 +422,7 @@
AND r2.question_code = #{timeGist}
AND r2.question_code = #{timeGist}
AND r2.answer + 0 > = #{startTime}
AND r2.answer + 0 > = #{startTime}
AND r2.answer + 0 < = #{endTime}
AND r2.answer + 0 < = #{endTime}
AND a.hospital_id IN
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
<foreach collection= "hospitalIds" item= "id" separator= "," open= "(" close= ")" >
#{id}
</foreach>
AND a.rec_status = 0
AND a.rec_status = 0
AND r1.rec_status = 0
AND r1.rec_status = 0
GROUP BY
GROUP BY
@ -438,7 +450,8 @@
WHERE
WHERE
o.id = p.parent_id
o.id = p.parent_id
AND p.organization_id = city.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 o.rec_status = 0
AND p.rec_status = 0
AND p.rec_status = 0
AND city.rec_status = 0
AND city.rec_status = 0
@ -472,10 +485,7 @@
AND r2.question_code = #{param.accordCode}
AND r2.question_code = #{param.accordCode}
AND r2.answer + 0 > = #{param.startTime}
AND r2.answer + 0 > = #{param.startTime}
AND r2.answer + 0 < = #{param.endTime}
AND r2.answer + 0 < = #{param.endTime}
AND a.hospital_id IN
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
<foreach collection= "hospitalIds" item= "id" separator= "," open= "(" close= ")" >
#{id}
</foreach>
AND a.rec_status = 0
AND a.rec_status = 0
AND r1.rec_status = 0
AND r1.rec_status = 0
GROUP BY
GROUP BY
@ -501,7 +511,8 @@
WHERE
WHERE
o.id = p.parent_id
o.id = p.parent_id
AND p.organization_id = city.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 o.rec_status = 0
AND p.rec_status = 0
AND p.rec_status = 0
AND city.rec_status = 0
AND city.rec_status = 0
@ -534,11 +545,8 @@
AND r1.question_code = 'JBXX-DYSJ'
AND r1.question_code = 'JBXX-DYSJ'
AND r2.answer + 0 > = #{startTime}
AND r2.answer + 0 > = #{startTime}
AND r2.answer + 0 < = #{endTime}
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 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 a.rec_status = 0
AND r1.rec_status = 0
AND r1.rec_status = 0
AND r2.rec_status = 0
AND r2.rec_status = 0
@ -549,22 +557,9 @@
city.id
city.id
</select>
</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
SELECT
o.id,
o.id,
o.CODE,
o.CODE,