<?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.lyms.platform.permission.dao.master.MasterMysqlAntexcMapper">
<insert id="saveMysqlAntexc" parameterType="com.lyms.platform.permission.model.MysqlAntexc">
INSERT INTO c_antexc(
cid,
pid,
patientId,
checkTime,
nextCheckTime,
yn,
cDueWeek,
sieveStatus,
checkDoctor,
hospital,
pastHistory,
familyHistory,
personalHistory,
ymjzHistory,
ywgmHistory,
fksxHistory,
ysfyHistory,
cestationInfo,
pregnancyTimes,
prodTime,
delivery,
yinchan,
gongwaiyun,
planedProd,
abortion,
stillbirth,
stillChan,
neoDeath,
neoDeathTodo,
birthDefect,
birthDefectTodo,
height,
weight,
yqWeight,
ssy,
szy,
heart,
lungs,
gonggao,
fuwei,
edema,
quicken,
quickenRemark,
secondaryDiagnosisId,
diagnosis,
treatOpinion,
dirOpinion,
xhdb,
bxbjs,
platelet,
chgOther,
ndb,
nt,
urineKetone,
bld,
ncgOther,
abo,
rh,
bloodSugar,
xqgbzam,
xqgczam,
albumin,
totalBilirubin,
jhBilirubin,
bg,
ygbmky,
ygbmkt,
ygeky,
ygekt,
yghxkt,
ygbmkyValue,
ygbmktValue,
ygekyValue,
ygektValue,
yghxktValue,
xqjq,
xnsd,
syjg,
syjgSelect,
syjgValue,
hivkt,
hivktSelect,
hivktValue,
ydfmw,
ydqjd,
bChao,
created,
modified,
highriskDesc,
screenResult,
resultSupple,
vulva,
vagina,
cervical,
uterus,
fujian,
couponCode,
ft3,
ft4,
tsh,
tpaAb,
taAb,
atshr,
highRisk,
score
) VALUES (
#{cid},
#{pid},
#{patientId},
#{checkTime},
#{nextCheckTime},
#{yn},
#{cDueWeek},
#{sieveStatus},
#{checkDoctor},
#{hospital},
#{pastHistory},
#{familyHistory},
#{personalHistory},
#{ymjzHistory},
#{ywgmHistory},
#{fksxHistory},
#{ysfyHistory},
#{cestationInfo},
#{pregnancyTimes},
#{prodTime},
#{delivery},
#{yinchan},
#{gongwaiyun},
#{planedProd},
#{abortion},
#{stillbirth},
#{stillChan},
#{neoDeath},
#{neoDeathTodo},
#{birthDefect},
#{birthDefectTodo},
#{height},
#{weight},
#{yqWeight},
#{ssy},
#{szy},
#{heart},
#{lungs},
#{gonggao},
#{fuwei},
#{edema},
#{quicken},
#{quickenRemark},
#{secondaryDiagnosisId},
#{diagnosis},
#{treatOpinion},
#{dirOpinion},
#{xhdb},
#{bxbjs},
#{platelet},
#{chgOther},
#{ndb},
#{nt},
#{urineKetone},
#{bld},
#{ncgOther},
#{abo},
#{rh},
#{bloodSugar},
#{xqgbzam},
#{xqgczam},
#{albumin},
#{totalBilirubin},
#{jhBilirubin},
#{bg},
#{ygbmky},
#{ygbmkt},
#{ygeky},
#{ygekt},
#{yghxkt},
#{ygbmkyValue},
#{ygbmktValue},
#{ygekyValue},
#{ygektValue},
#{yghxktValue},
#{xqjq},
#{xnsd},
#{syjg},
#{syjgSelect},
#{syjgValue},
#{hivkt},
#{hivktSelect},
#{hivktValue},
#{ydfmw},
#{ydqjd},
#{bChao},
#{created},
#{modified},
#{highriskDesc},
#{screenResult},
#{resultSupple},
#{vulva},
#{vagina},
#{cervical},
#{uterus},
#{fujian},
#{couponCode},
#{ft3},
#{ft4},
#{tsh},
#{tpaAb},
#{taAb},
#{atshr},
#{highRisk},
#{score}
)
</insert>
<insert id="saveMysqlAntex" parameterType="com.lyms.platform.permission.model.MysqlAntex">
INSERT INTO c_antex(
pid,
patientId,
cid,
checkTime,
nextCheckTime,
yn,
cDueWeek,
sieveStatus,
checkDoctor,
hospital,
chiefComplaint,
weight,
ssy,
szy,
gonggao,
fuwei,
edema,
tireNumber,
quicken,
quickenRemark,
xhdb,
bxbjs,
platelet,
chgOther,
ndb,
nt,
urineKetone,
bld,
ncgOther,
abo,
rh,
bloodSugar,
bloodSugar2,
bloodSugar3,
bloodSugar4,
ttita,
totalThy,
ftita,
freeThy,
thyStim,
antGlan,
tmab,
thyPerAnt,
xqgbzam,
xqgczam,
albumin,
totalBilirubin,
jhBilirubin,
ygbmky,
ygbmkt,
ygeky,
ygekt,
yghxkt,
xqjq,
xnsd,
syjg,
hivkt,
diagnosis,
diagnosisOther,
secondaryDiagnosis,
secondaryDiagnosisId,
treatmentOpinion,
guide,
couponCode,
highRisk,
score,
bChao,
created,
modified,
highriskDesc,
screenResult,
resultSupple
)
VALUES
(
#{pid},
#{patientId},
#{cid},
#{checkTime},
#{nextCheckTime},
#{yn},
#{cDueWeek},
#{sieveStatus},
#{checkDoctor},
#{hospital},
#{chiefComplaint},
#{weight},
#{ssy},
#{szy},
#{gonggao},
#{fuwei},
#{edema},
#{tireNumber},
#{quicken},
#{quickenRemark},
#{xhdb},
#{bxbjs},
#{platelet},
#{chgOther},
#{ndb},
#{nt},
#{urineKetone},
#{bld},
#{ncgOther},
#{abo},
#{rh},
#{bloodSugar},
#{bloodSugar2},
#{bloodSugar3},
#{bloodSugar4},
#{ttita},
#{totalThy},
#{ftita},
#{freeThy},
#{thyStim},
#{antGlan},
#{tmab},
#{thyPerAnt},
#{xqgbzam},
#{xqgczam},
#{albumin},
#{totalBilirubin},
#{jhBilirubin},
#{ygbmky},
#{ygbmkt},
#{ygeky},
#{ygekt},
#{yghxkt},
#{xqjq},
#{xnsd},
#{syjg},
#{hivkt},
#{diagnosis},
#{diagnosisOther},
#{secondaryDiagnosis},
#{secondaryDiagnosisId},
#{treatmentOpinion},
#{guide},
#{couponCode},
#{highRisk},
#{score},
#{bChao},
#{created},
#{modified},
#{highriskDesc},
#{screenResult},
#{resultSupple}
)
</insert>
<delete id="deleteMysqlAntexc" parameterType="com.lyms.platform.permission.model.MysqlAntexc">
DELETE from c_antexc WHERE cid = #{cid}
</delete>
<delete id="deleteMysqlAntex" parameterType="com.lyms.platform.permission.model.MysqlAntex">
DELETE from c_antex WHERE cid = #{cid}
</delete>
<insert id="addTireData" parameterType="com.lyms.platform.permission.model.MysqlTireData">
INSERT INTO tiredata(
cid,
heartRate,
fetalPosition,
fetalPresentation,
vjoin
)VALUES (
#{cid},
#{heartRate},
#{fetalPosition},
#{fetalPresentation},
#{vjoin}
)
</insert>
<delete id="delTireData" parameterType="com.lyms.platform.permission.model.MysqlTireData">
DELETE from tiredata WHERE cid = #{cid}
</delete>
<insert id="saveMysqlMatdeliver" parameterType="com.lyms.platform.permission.model.MysqlMatdeliver">
INSERT INTO matdeliver(
pid,
patientId,
matdeliverId,
deliveryDate,
fmHospital,
deliverDoctor,
gcdfDoctorId,
tireNumber,
placenta,
inHospitalNo,
deliveryMode,
operationCause,
one,
two,
three,
totalProcess,
perinealCondition,
siLielevel,
needleNum,
created,
modified,
yn,
maternalInfo,
deathCause,
ssy,
szy,
ssy2h,
szy2h,
breath,
pulse,
oHloseBloodL,
tHloseBloodL,
rHloseBloodL,
sHloseBloodL,
loseBloodCause,
ocs
)VALUES (
#{pid},
#{patientId},
#{matdeliverId},
#{deliveryDate},
#{fmHospital},
#{deliverDoctor},
#{gcdfDoctorId},
#{tireNumber},
#{placenta},
#{inHospitalNo},
#{deliveryMode},
#{operationCause},
#{one},
#{two},
#{three},
#{totalProcess},
#{perinealCondition},
#{siLielevel},
#{needleNum},
#{created},
#{modified},
#{yn},
#{maternalInfo},
#{deathCause},
#{ssy},
#{szy},
#{ssy2h},
#{szy2h},
#{breath},
#{pulse},
#{oHloseBloodL},
#{tHloseBloodL},
#{rHloseBloodL},
#{sHloseBloodL},
#{loseBloodCause},
#{ocs}
)
</insert>
<delete id="deleteMysqlMatdeliver" parameterType="com.lyms.platform.permission.model.MysqlMatdeliver">
DELETE from matdeliver WHERE matdeliverId = #{matdeliverId}
</delete>
<insert id="saveMysqlMatdeliverBaby" parameterType="com.lyms.platform.permission.model.MysqlMatdeliverBaby">
INSERT INTO matdeliver_baby(
matdeliverId,
dueTime,
pregnancyOut,
deformity,
jxxq,
babyGender,
babyWeight,
babyHeight,
babyHealthy,
apgarScore,
asphyxiaM,
contactStartM,
contactM,
earlySuck
)VALUES (
#{matdeliverId},
#{dueTime},
#{pregnancyOut},
#{deformity},
#{jxxq},
#{babyGender},
#{babyWeight},
#{babyHeight},
#{babyHealthy},
#{apgarScore},
#{asphyxiaM},
#{contactStartM},
#{contactM},
#{earlySuck}
)
</insert>
<delete id="deleteMysqlMatdeliverBaby" parameterType="com.lyms.platform.permission.model.MysqlMatdeliver">
DELETE from matdeliver_baby WHERE matdeliverId = #{matdeliverId}
</delete>
<insert id="saveMysqlMatdeliverPlacentas" parameterType="com.lyms.platform.permission.model.MysqlMatdeliverPlacentas">
INSERT INTO matdeliver_placentas(
matdeliverId,
tpmcType,
mcType,
tpSize,
tpWeight,
umbilicalCordLength,
umbilicalCordEx,
umbilicalCordExType
)VALUES (
#{matdeliverId},
#{tpmcType},
#{mcType},
#{tpSize},
#{tpWeight},
#{umbilicalCordLength},
#{umbilicalCordEx},
#{umbilicalCordExType}
)
</insert>
<delete id="deleteMysqlMatdeliverPlacentas" parameterType="com.lyms.platform.permission.model.MysqlMatdeliver">
DELETE from matdeliver_placentas WHERE matdeliverId = #{matdeliverId}
</delete>
<insert id="saveMysqlMatdeliverTire" parameterType="com.lyms.platform.permission.model.MysqlMatdeliverTire">
INSERT INTO matdeliver_tire(
matdeliverId,
heartRate,
fetalPosition,
fetalPresentation
)VALUES (
#{matdeliverId},
#{heartRate},
#{fetalPosition},
#{fetalPresentation}
)
</insert>
<delete id="deleteMysqlMatdeliverTire" parameterType="com.lyms.platform.permission.model.MysqlMatdeliver">
DELETE from matdeliver_tire WHERE matdeliverId = #{matdeliverId}
</delete>
<insert id="saveMysqlBaby" parameterType="com.lyms.platform.permission.model.MysqlBaby">
INSERT INTO lyms_baby(
babyId,
babyName,
sex,
babyBirthday,
homeAddress,
babyCardNo,
fileCode,
mommyName,
mommyCertificateType,
mommyCertificateNum,
mommyPhone,
mommyBirthday,
mommyLevel,
liveType,
mommyProfessionType,
fatherName,
fatherPhone,
fatherBirthday,
fatherLevel,
fatherProfessionType,
dueWeek,
dueType,
fetusCount,
babyWeight,
babyHeight,
babyHead,
deliverOrg,
malformation,
mommyHighRiskReason,
highRisk,
highRiskInfo,
weakSon,
weakSonInfo,
babyDiagnosis,
diagnose,
apgarScore,
esfs,
txng,
eljy,
kouq,
isBCG,
bCGVaccinDate,
bCGInjectUserName,
isHBV,
hbvVaccinDate,
bCGAndHBVVaccinationDosage,
hbvInjectUserName,
isHBIG,
hBIGInjectDate,
hBIGInjectDosage,
hBIGInjectUserName,
buildDoctor,
buildDate,
vcCardNo,
remark,
couponCode,
created,
modified
)VALUES (
#{babyId},
#{babyName},
#{sex},
#{babyBirthday},
#{homeAddress},
#{babyCardNo},
#{fileCode},
#{mommyName},
#{mommyCertificateType},
#{mommyCertificateNum},
#{mommyPhone},
#{mommyBirthday},
#{mommyLevel},
#{liveType},
#{mommyProfessionType},
#{fatherName},
#{fatherPhone},
#{fatherBirthday},
#{fatherLevel},
#{fatherProfessionType},
#{dueWeek},
#{dueType},
#{fetusCount},
#{babyWeight},
#{babyHeight},
#{babyHead},
#{deliverOrg},
#{malformation},
#{mommyHighRiskReason},
#{highRisk},
#{highRiskInfo},
#{weakSon},
#{weakSonInfo},
#{babyDiagnosis},
#{diagnose},
#{apgarScore},
#{esfs},
#{txng},
#{eljy},
#{kouq},
#{isBCG},
#{bCGVaccinDate},
#{bCGInjectUserName},
#{isHBV},
#{hbvVaccinDate},
#{bCGAndHBVVaccinationDosage},
#{hbvInjectUserName},
#{isHBIG},
#{hBIGInjectDate},
#{hBIGInjectDosage},
#{hBIGInjectUserName},
#{buildDoctor},
#{buildDate},
#{vcCardNo},
#{remark},
#{couponCode},
#{created},
#{modified}
)
</insert>
<delete id="deleteMysqlBaby" parameterType="com.lyms.platform.permission.model.MysqlBaby">
DELETE from lyms_baby WHERE babyId = #{babyId}
</delete>
<insert id="saveMysqlBabyCheck" parameterType="com.lyms.platform.permission.model.MysqlBabyCheck">
INSERT INTO lyms_babycheck(
checkId,
buildId,
checkDate,
checkDoctor,
checkMonthAge,
checkHospital,
nextCheckDate,
nextCheckMonthAge,
mainFoster,
feedType,
pee,
excrement,
sleep,
activity,
vitaminD,
assistFood,
homeMeasure,
morbidity,
drugGllergic,
temperature,
weight,
height,
head,
chestw,
heightWeight,
growthEvaluate,
weightEvaluate,
heightEvaluate,
headEvaluate,
bilirubin,
bregma,
bregmaValue,
tooth,
faceColor,
skin,
eye,
eyesight,
ear,
hearing,
neck,
chest,
belly,
spineFours,
portaGenitals,
stepStatus,
stoopStatus,
stoopSign,
nerve,
bonez,
hipJoint,
hemoglobin,
hCheckStatus,
whiteCell,
platelet,
otherBlood,
urineProtein,
urineSugar,
urineAcetone,
hematuria,
otherUrine,
checkDiagnose,
handlSuggest,
guideSuggest,
highRisk,
sportsEvaluation,
heartAction,
askOther,
babyCheckOther,
assistCheckOther,
navel,
couponCode,
cnqk,
mtcnNum,
fstj,
xbNum,
dbNum,
dbDayNum,
qdtlTime,
pfhrTime,
wssAd,
douhbqk,
kq,
cyNum,
qcNum,
btt,
xf,
xlClass,
xldq,
nd,
ygbmky,
ygbmkt,
ygeky,
ygekt,
yghxkt,
wlTong,
wlXin,
wlGai,
wlMei,
wlTie,
wlQian,
wlGe,
wlMeng,
ygbmkyNum,
ygbmktNum,
ygekyNum,
ygektNum,
yghxktNum,
xqgbzam,
xqgczam,
albumin,
totalBi,
jhBilir,
bcgYs,
bcgXz,
bcgHbx,
bcgBxb,
bcgSpxb,
bcgZlxb,
bcgDfkl,
bcgZfkl,
bcgJxw,
bcgZwxw,
bcgZbj,
bcgZj,
bcgJsc,
bcgYc,
bcgQw,
wssa,
jcwd,
wsse,
rzfx,
chatSc,
yyfyTest,
zlcp,
gdzsc,
ssfx,
gjzh,
rxnl,
xxbsc,
zlsc,
qtfz,
highRiskInfo,
weakSon,
weakSonInfo,
eyeAppearance,
eyeRedReflex,
eyeDioptroscopy,
eyeAdvice,
eyeAdviceName,
eyeGuideSuggestions,
abnormalSize,
okSize,
exerciseIA,
exerciseDQ,
movementIA,
movementDQ,
adaptationIA,
adaptationDQ,
languageIA,
languageDQ,
socialContactIA,
socialContactDQ,
nextCheckItem,
diseases,
zlcpType,
jcz,
tcType,
slscx
)VALUES (
#{checkId},
#{buildId},
#{checkDate},
#{checkDoctor},
#{checkMonthAge},
#{checkHospital},
#{nextCheckDate},
#{nextCheckMonthAge},
#{mainFoster},
#{feedType},
#{pee},
#{excrement},
#{sleep},
#{activity},
#{vitaminD},
#{assistFood},
#{homeMeasure},
#{morbidity},
#{drugGllergic},
#{temperature},
#{weight},
#{height},
#{head},
#{chestw},
#{heightWeight},
#{growthEvaluate},
#{weightEvaluate},
#{heightEvaluate},
#{headEvaluate},
#{bilirubin},
#{bregma},
#{bregmaValue},
#{tooth},
#{faceColor},
#{skin},
#{eye},
#{eyesight},
#{ear},
#{hearing},
#{neck},
#{chest},
#{belly},
#{spineFours},
#{portaGenitals},
#{stepStatus},
#{stoopStatus},
#{stoopSign},
#{nerve},
#{bonez},
#{hipJoint},
#{hemoglobin},
#{hCheckStatus},
#{whiteCell},
#{platelet},
#{otherBlood},
#{urineProtein},
#{urineSugar},
#{urineAcetone},
#{hematuria},
#{otherUrine},
#{checkDiagnose},
#{handlSuggest},
#{guideSuggest},
#{highRisk},
#{sportsEvaluation},
#{heartAction},
#{askOther},
#{babyCheckOther},
#{assistCheckOther},
#{navel},
#{couponCode},
#{cnqk},
#{mtcnNum},
#{fstj},
#{xbNum},
#{dbNum},
#{dbDayNum},
#{qdtlTime},
#{pfhrTime},
#{wssAd},
#{douhbqk},
#{kq},
#{cyNum},
#{qcNum},
#{btt},
#{xf},
#{xlClass},
#{xldq},
#{nd},
#{ygbmky},
#{ygbmkt},
#{ygeky},
#{ygekt},
#{yghxkt},
#{wlTong},
#{wlXin},
#{wlGai},
#{wlMei},
#{wlTie},
#{wlQian},
#{wlGe},
#{wlMeng},
#{ygbmkyNum},
#{ygbmktNum},
#{ygekyNum},
#{ygektNum},
#{yghxktNum},
#{xqgbzam},
#{xqgczam},
#{albumin},
#{totalBi},
#{jhBilir},
#{bcgYs},
#{bcgXz},
#{bcgHbx},
#{bcgBxb},
#{bcgSpxb},
#{bcgZlxb},
#{bcgDfkl},
#{bcgZfkl},
#{bcgJxw},
#{bcgZwxw},
#{bcgZbj},
#{bcgZj},
#{bcgJsc},
#{bcgYc},
#{bcgQw},
#{wssa},
#{jcwd},
#{wsse},
#{rzfx},
#{chatSc},
#{yyfyTest},
#{zlcp},
#{gdzsc},
#{ssfx},
#{gjzh},
#{rxnl},
#{xxbsc},
#{zlsc},
#{qtfz},
#{highRiskInfo},
#{weakSon},
#{weakSonInfo},
#{eyeAppearance},
#{eyeRedReflex},
#{eyeDioptroscopy},
#{eyeAdvice},
#{eyeAdviceName},
#{eyeGuideSuggestions},
#{abnormalSize},
#{okSize},
#{exerciseIA},
#{exerciseDQ},
#{movementIA},
#{movementDQ},
#{adaptationIA},
#{adaptationDQ},
#{languageIA},
#{languageDQ},
#{socialContactIA},
#{socialContactDQ},
#{nextCheckItem},
#{diseases},
#{zlcpType},
#{jcz},
#{tcType},
#{slscx}
)
</insert>
<delete id="deleteMysqlBabyCheck" parameterType="com.lyms.platform.permission.model.MysqlBabyCheck">
DELETE from lyms_babycheck WHERE checkId = #{checkId}
</delete>
<insert id="addRisk" parameterType="com.lyms.platform.permission.model.MysqlRisk">
INSERT into risk
(
name,
color,
score,
cid,
rid
)
values
(
#{name},
#{color},
#{score},
#{cid},
#{rid}
)
</insert>
<insert id="savePatientsToMysql" parameterType="com.lyms.platform.permission.model.ReportPatients">
INSERT INTO report_patients(
pid,
patientId,
cardNo,
type,
lastMenses,
address,
provinceId,
cityId,
areaId,
streetId,
addressPostRest,
provincePostRestId,
cityPostRestId,
areaPostRestId,
streetPostRestId,
addressRegister,
provinceRegisterId,
cityRegisterId,
areaRegisterId,
streetRegisterId,
hospitalId,
bookbuildingDate,
bookbuildingDoctor,
created,
modified,
birth,
username,
yn,
phone,
pcensusTypeId,
pliveTypeId,
enable,
riskLevelId,
buildType,
isAutoFm
) VALUES (
#{pid},
#{patientId},
#{cardNo},
#{type},
#{lastMenses},
#{address},
#{provinceId},
#{cityId},
#{areaId},
#{streetId},
#{addressPostRest},
#{provincePostRestId},
#{cityPostRestId},
#{areaPostRestId},
#{streetPostRestId},
#{addressRegister},
#{provinceRegisterId},
#{cityRegisterId},
#{areaRegisterId},
#{streetRegisterId},
#{hospitalId},
#{bookbuildingDate},
#{bookbuildingDoctor},
#{created},
#{modified},
#{birth},
#{username},
#{yn},
#{phone},
#{pcensusTypeId},
#{pliveTypeId},
#{enable},
#{riskLevelId},
#{buildType},
#{isAutoFm}
)
</insert>
<delete id="deletePatientsToMysql" parameterType="com.lyms.platform.permission.model.ReportPatients">
DELETE from report_patients WHERE patientId = #{patientId}
</delete>
<insert id="saveAntExChuToMysql" parameterType="com.lyms.platform.permission.model.ReportAntexchu">
INSERT INTO report_antexchu(
cid,
checkTime,
nextCheckTime,
hospitalId,
pid,
parentId,
created,
sourceId,
type
) VALUES (
#{cid},
#{checkTime},
#{nextCheckTime},
#{hospitalId},
#{pid},
#{parentId},
#{created},
#{sourceId},
#{type}
)
</insert>
<delete id="deleteAntExChuToMysql" parameterType="com.lyms.platform.permission.model.ReportAntexchu">
DELETE from report_antexchu WHERE cid = #{cid}
</delete>
<insert id="saveMatdeliverToMysql" parameterType="com.lyms.platform.permission.model.ReportMatdeliver">
INSERT INTO report_matdeliver(
mid,
parentId,
pid,
dueDate1,
created,
fmHospital,
hospitalId,
sourceId
) VALUES (
#{mid},
#{parentId},
#{pid},
#{dueDate1},
#{created},
#{fmHospital},
#{hospitalId},
#{sourceId}
)
</insert>
<delete id="deleteMatdeliverToMysql" parameterType="com.lyms.platform.permission.model.ReportMatdeliver">
DELETE from report_matdeliver WHERE mid = #{mid}
</delete>
<insert id="saveRiskLevelToMysql" parameterType="com.lyms.platform.permission.model.ReportRiskLevel">
INSERT INTO report_risk_level(
riskLevelId,
riskLevel,
type,
foreignId,
sourceId,
patientId,
hospitalId
) VALUES (
#{riskLevelId},
#{riskLevel},
#{type},
#{foreignId},
#{sourceId},
#{patientId},
#{hospitalId}
)
</insert>
<delete id="deleteRiskLevelToMysql" parameterType="com.lyms.platform.permission.model.ReportRiskLevel">
DELETE from report_risk_level WHERE foreignId = #{foreignId}
</delete>
<select id="getBuildCount" resultType="java.util.Map" parameterType="java.util.Map">
select count(p.patientId) as buildCount,o.id as hospitalId,o.name as hospitalName,o.province_id as provinceId,o.area_id as areaId,o.city_id as cityId from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
<if test="provinceId != null and provinceId != ''">
and o.province_id = #{provinceId,jdbcType=VARCHAR}
</if>
<if test="cityId != null and cityId != ''">
and o.city_id = #{cityId,jdbcType=VARCHAR}
</if>
<if test="areaId != null and areaId != ''">
and o.area_id = #{areaId,jdbcType=VARCHAR}
</if>
GROUP BY o.name
</select>
<select id="getBulidCheckPersonCount" resultType="java.util.Map" parameterType="java.util.Map">
SELECT count(DISTINCT(r.sourceId)) as bulidCheckPersonCount,o.name as hospitalName from report_patients p
INNER JOIN report_antexchu r on p.patientId = r.sourceId
INNER JOIN organization o on p.hospitalId=o.id
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
<if test="provinceId != null and provinceId != ''">
and o.province_id = #{provinceId,jdbcType=VARCHAR}
</if>
<if test="cityId != null and cityId != ''">
and o.city_id = #{cityId,jdbcType=VARCHAR}
</if>
<if test="areaId != null and areaId != ''">
and o.area_id = #{areaId,jdbcType=VARCHAR}
</if>
GROUP BY o.name
</select>
<select id="getBulidCheckNumCount" resultType="java.util.Map" parameterType="java.util.Map">
SELECT count(r.sourceId) as bulidCheckNumCount,o.name as hospitalName from report_patients p
INNER JOIN report_antexchu r on p.patientId = r.sourceId
INNER JOIN organization o on p.hospitalId=o.id
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
<if test="provinceId != null and provinceId != ''">
and o.province_id = #{provinceId,jdbcType=VARCHAR}
</if>
<if test="cityId != null and cityId != ''">
and o.city_id = #{cityId,jdbcType=VARCHAR}
</if>
<if test="areaId != null and areaId != ''">
and o.area_id = #{areaId,jdbcType=VARCHAR}
</if>
GROUP BY o.name
</select>
<select id="getCheckPersonCount" resultType="java.util.Map" parameterType="java.util.Map">
SELECT count(DISTINCT(r.sourceId)) as checkPersonCount,o.name as hospitalName from report_patients p
INNER JOIN report_antexchu r on p.patientId = r.sourceId
INNER JOIN organization o on p.hospitalId=o.id
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and r.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and r.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
<if test="provinceId != null and provinceId != ''">
and o.province_id = #{provinceId,jdbcType=VARCHAR}
</if>
<if test="cityId != null and cityId != ''">
and o.city_id = #{cityId,jdbcType=VARCHAR}
</if>
<if test="areaId != null and areaId != ''">
and o.area_id = #{areaId,jdbcType=VARCHAR}
</if>
GROUP BY o.name
</select>
<select id="getMatDeliverCount" resultType="java.util.Map" parameterType="java.util.Map">
select count(m.sourceId) as matDeliverCount,o.name as hospitalName from report_matdeliver m
INNER JOIN report_patients p on m.sourceId=p.patientId
INNER JOIN organization o on p.hospitalId=o.id
where p.type =3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
<if test="provinceId != null and provinceId != ''">
and o.province_id = #{provinceId,jdbcType=VARCHAR}
</if>
<if test="cityId != null and cityId != ''">
and o.city_id = #{cityId,jdbcType=VARCHAR}
</if>
<if test="areaId != null and areaId != ''">
and o.area_id = #{areaId,jdbcType=VARCHAR}
</if>
GROUP BY o.name
</select>
<select id="getLiveCount" resultType="java.util.Map" parameterType="java.util.Map">
select count(p.patientId) as liveCount,o.name as hospitalName from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.pliveTypeId='57624c5e0cf23d4631523ea2' and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
<if test="provinceId != null and provinceId != ''">
and o.province_id = #{provinceId,jdbcType=VARCHAR}
</if>
<if test="cityId != null and cityId != ''">
and o.city_id = #{cityId,jdbcType=VARCHAR}
</if>
<if test="areaId != null and areaId != ''">
and o.area_id = #{areaId,jdbcType=VARCHAR}
</if>
GROUP BY o.name
</select>
<select id="getOrgCheckPersonCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(r.sourceId)) as orgCheckPersonCount,o.name as hospitalName,o.id as hospitalId from report_patients p
INNER JOIN report_antexchu r on p.patientId=r.sourceId
INNER JOIN organization o on o.id=r.hospitalId
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getOrgCheckNumCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(r.sourceId) as orgCheckNumCount,o.name as hospitalName,o.id as hospitalId from report_patients p
INNER JOIN report_antexchu r on (p.patientId=r.sourceId or p.patientId=r.parentId)
INNER JOIN organization o on o.id=r.hospitalId
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getRiskPersonCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as riskPersonCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel > 1
GROUP BY o.name
</select>
<select id="getColorYellowCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(l.sourceId) as colorYellowCount,o.name as hospitalName,o.id as hospitalId
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel = 2
GROUP BY o.name
</select>
<select id="getColorOrangeCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(l.sourceId) as colorOrangeCount,o.name as hospitalName,o.id as hospitalId
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel = 3
GROUP BY o.name
</select>
<select id="getColorRedCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(l.sourceId) as colorRedCount,o.name as hospitalName,o.id as hospitalId
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel = 4
GROUP BY o.name
</select>
<select id="getColorVioletCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(l.sourceId) as colorVioletCount,o.name as hospitalName,o.id as hospitalId
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel = 5
GROUP BY o.name
</select>
<select id="getColorGreenCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(l.sourceId) as colorGreenCount,o.name as hospitalName,o.id as hospitalId
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel = 1
GROUP BY o.name
</select>
<select id="getOneRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as oneRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.type=1 and p.enable is NULL and p.hospitalId=#{hospitalId}
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN report_antexchu a
on tp.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=1
) l on l.foreignId = a.cid GROUP BY tp.name
</select>
<select id="getTwoRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as twoRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.type=1 and p.enable is NULL and p.hospitalId=#{hospitalId}
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN report_antexchu a
on tp.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=2
) l on l.foreignId = a.cid GROUP BY tp.name
</select>
<select id="getThreeRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as threeRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.type=1 and p.enable is NULL and p.hospitalId=#{hospitalId}
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN report_antexchu a
on tp.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=3
) l on l.foreignId = a.cid GROUP BY tp.name
</select>
<select id="getFourRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as fourRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.type=1 and p.enable is NULL and p.hospitalId=#{hospitalId}
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN report_antexchu a
on tp.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=3
) l on l.foreignId = a.cid GROUP BY tp.name
</select>
<!-- -->
<select id="getCheckOrgCheckPersonCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(c.sourceId)) as checkOrgCheckPersonCount ,o.name as hospitalName,o.id as hospitalId from report_antexchu c
INNER JOIN report_patients p on c.sourceId = p.patientId
INNER JOIN organization o on c.hospitalId=o.id
where p.type = 1 and p.enable is null
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and c.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and c.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getBeforeBuildCheckPersonCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(c.sourceId)) as beforeBuildCheckPersonCount ,o.name as hospitalName,o.id as hospitalId from report_antexchu c
INNER JOIN report_patients p on c.sourceId = p.patientId
INNER JOIN organization o on c.hospitalId=o.id
where p.type = 1 and p.enable is null
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate <![CDATA[ < ]]> #{startDate}
</if>
<if test="startDate != null">
and c.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and c.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getCheckRiskPersonCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as checkRiskPersonCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN
report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel > 1
<if test="startDate != null">
and l.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and l.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getCheckColorYellowCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as checkColorYellowCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN
report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel = 2
<if test="startDate != null">
and l.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and l.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getCheckColorOrangeCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as checkColorOrangeCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN
report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel = 3
<if test="startDate != null">
and l.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and l.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getCheckColorRedCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as checkColorRedCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN
report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel = 4
<if test="startDate != null">
and l.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and l.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getCheckColorVioletCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as checkColorVioletCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN
report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel = 5
<if test="startDate != null">
and l.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and l.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getCheckColorGreenCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as checkColorGreenCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=1 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN
report_risk_level r on r.foreignId = l.cid
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and l.type=1 and riskLevel = 1
<if test="startDate != null">
and l.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and l.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getCheckOneRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as checkOneRiskCount,o.name as hospitalName,o.id as hospitalId from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
INNER JOIN report_antexchu a
on p.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=1
) l on l.foreignId = a.cid
where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL
<if test="startDate != null">
and a.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and a.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getCheckTwoRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as checkTwoRiskCount,o.name as hospitalName,o.id as hospitalId from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
INNER JOIN report_antexchu a
on p.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=2
) l on l.foreignId = a.cid
where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL
<if test="startDate != null">
and a.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and a.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getCheckThreeRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as checkThreeRiskCount,o.name as hospitalName,o.id as hospitalId from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
INNER JOIN report_antexchu a
on p.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=3
) l on l.foreignId = a.cid
where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL
<if test="startDate != null">
and a.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and a.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getCheckFourRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as checkFourRiskCount,o.name as hospitalName,o.id as hospitalId from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
INNER JOIN report_antexchu a
on p.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=4
) l on l.foreignId = a.cid
where p.hospitalId=#{hospitalId} and p.type=1 and p.enable is NULL
<if test="startDate != null">
and a.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and a.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getMatDeliverOrgCheckPersonCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(f.sourceId) as matDeliverOrgCheckPersonCount,o.name as hospitalName,o.id as hospitalId
from report_matdeliver f
INNER JOIN report_patients p on f.sourceId=p.patientId
INNER JOIN organization o on f.fmHospital=o.id
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
<select id="getMatDeliverRiskPersonCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as matDeliverRiskPersonCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN report_matdeliver m on m.sourceId=tp.patientId
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and r.riskLevel > 1 and l.type=1 GROUP BY o.name
</select>
<select id="getMatDeliverColorYellowCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as matDeliverColorYellowCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN report_matdeliver m on m.sourceId=tp.patientId
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and r.riskLevel = 2 and l.type=1 GROUP BY o.name
</select>
<select id="getMatDeliverColorOrangeCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as matDeliverColorOrangeCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN report_matdeliver m on m.sourceId=tp.patientId
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and r.riskLevel = 3 and l.type=1 GROUP BY o.name
</select>
<select id="getMatDeliverColorRedCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as matDeliverColorRedCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN report_matdeliver m on m.sourceId=tp.patientId
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and r.riskLevel = 4 and l.type=1 GROUP BY o.name
</select>
<select id="getMatDeliverColorVioletCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as matDeliverColorVioletCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN report_matdeliver m on m.sourceId=tp.patientId
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and r.riskLevel = 5 and l.type=1 GROUP BY o.name
</select>
<select id="getMatDeliverColorGreenCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(DISTINCT(l.sourceId))as matDeliverColorGreenCount,o.id as hospitalId,o.name as hospitalName
from (select p.patientId from report_patients p
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN
report_antexchu l on tp.patientId=l.sourceId
INNER JOIN report_risk_level r on r.foreignId = l.cid
INNER JOIN report_matdeliver m on m.sourceId=tp.patientId
INNER JOIN organization o on l.hospitalId=o.id
where r.type = 2 and r.riskLevel = 1 and l.type=1 GROUP BY o.name
</select>
<select id="getMatDeliverOneRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as matDeliverOneRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN report_antexchu a
on tp.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=1
) l on l.foreignId = a.cid GROUP BY tp.name
</select>
<select id="getMatDeliverTwoRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as matDeliverTwoRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN report_antexchu a
on tp.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=2
) l on l.foreignId = a.cid GROUP BY tp.name
</select>
<select id="getMatDeliverThreeRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as matDeliverThreeRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN report_antexchu a
on tp.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=3
) l on l.foreignId = a.cid GROUP BY tp.name
</select>
<select id="getMatDeliverFourRiskCounts" resultType="java.util.Map" parameterType="java.util.Map">
select count(a.sourceId) as matDeliverFourRiskCount,tp.name as hospitalName,tp.id as hospitalId from (select p.patientId,o.id,o.name from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.type=3 and p.enable is NULL
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</if>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) tp
INNER JOIN report_antexchu a
on tp.patientId=a.sourceId
INNER JOIN
(
SELECT r.foreignId,count(r.foreignId) as t,r.type,r.riskLevel from report_risk_level r
where r.type = 2 and r.riskLevel >1 group by r.foreignId having t=4
) l on l.foreignId = a.cid GROUP BY tp.name
</select>
</mapper>