<?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
) VALUES (
#{cid},
#{checkTime},
#{nextCheckTime},
#{hospitalId},
#{pid},
#{parentId},
#{created},
#{sourceId}
)
</insert>
<delete id="deleteAntExChuToMysql" parameterType="com.lyms.platform.permission.model.ReportAntexchu">
DELETE from report_antexchu WHERE cid = #{cid}
</delete>
<insert id="saveAntexToMysql" parameterType="com.lyms.platform.permission.model.ReportAntex">
INSERT INTO report_antex(
fid,
parentId,
pid,
checkDate,
nextCheckTime,
yn,
created,
sourceId,
hospitalId
) VALUES (
#{fid},
#{parentId},
#{pid},
#{checkDate},
#{nextCheckTime},
#{yn},
#{created},
#{sourceId},
#{hospitalId}
)
</insert>
<delete id="deleteAntexToMysql" parameterType="com.lyms.platform.permission.model.ReportAntex">
DELETE from report_antex WHERE fid = #{fid}
</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
) VALUES (
#{riskLevelId},
#{riskLevel},
#{type},
#{foreignId}
)
</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="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</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(tp.patientId) as bulidCheckPersonCount,tp.id as hospitalId,tp.name as hospitalName
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
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</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>
) tp
INNER JOIN
(SELECT c.cid as cid,c.parentId, c.checkTime as checkDate,c.sourceId from report_antexchu c) cj on
tp.patientId= cj.sourceId GROUP BY tp.name
</select>
<select id="getBulidCheckNumCount" resultType="java.util.Map" parameterType="java.util.Map">
select count(cj.cid) as bulidCheckNumCount,tp.name as hospitalName,tp.hospitalId from (
select p.hospitalId, p.patientId,o.id,o.name,o.province_id,o.area_id,o.city_id from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.type=1 and p.enable is NULL
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</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>
) tp
INNER JOIN
(SELECT r.fid as cid,r.parentId, r.checkDate,r.sourceId from report_antex r
union ALL
SELECT c.cid as cid,c.parentId, c.checkTime as checkDate,c.sourceId from report_antexchu c) cj on tp.patientId= cj.sourceId GROUP BY tp.name
</select>
<select id="getCheckPersonCount" resultType="java.util.Map" parameterType="java.util.Map">
select count(cj.sourceId) as checkPersonCount,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
<if test="hospitalId != null and hospitalId != ''">
and p.hospitalId = #{hospitalId,jdbcType=VARCHAR}
</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>
) tp
INNER JOIN
(select t.sourceId
from
(SELECT r.fid as cid,r.pid, r.checkDate,r.sourceId from report_antex r where 1 = 1
<if test="startDate != null">
and r.checkDate >= #{startDate}
</if>
<if test="endDate != null">
and r.checkDate <![CDATA[ <= ]]> #{endDate}
</if>
union ALL
SELECT c.cid as cid,c.pid, c.checkTime as checkDate,c.sourceId from report_antexchu c where 1 = 1
<if test="startDate != null">
and c.checkTime >= #{startDate}
</if>
<if test="endDate != null">
and c.checkTime <![CDATA[ <= ]]> #{endDate}
</if>
)t GROUP BY t.pid) cj on tp.patientId= cj.sourceId
GROUP BY tp.name
</select>
<select id="getMatDeliverCount" resultType="java.util.Map" parameterType="java.util.Map">
select count(fm.patientId) as matDeliverCount,fm.name as hospitalName,fm.id as hospitalId
from ( select p.patientId,o.id,o.name from report_matdeliver m
INNER JOIN organization o on m.fmHospital=o.id
INNER JOIN report_patients p on m.sourceId=p.patientId
where p.type = 3
<if test="hospitalId != null and hospitalId != ''">
and o.id = #{hospitalId,jdbcType=VARCHAR}
</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>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
) fm GROUP BY fm.name;
</select>
<select id="getLiveCount" resultType="java.util.Map" parameterType="java.util.Map">
select count(p.patientId) as liveCount,o.name as hospitalName,o.id as hospitalId from report_patients p
INNER JOIN organization o on p.hospitalId=o.id
where p.pliveTypeId='57624c5e0cf23d4631523ea2'
<if test="hospitalId != null and hospitalId != ''">
and o.id = #{hospitalId,jdbcType=VARCHAR}
</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>
<if test="startDate != null">
and p.bookbuildingDate >= #{startDate}
</if>
<if test="endDate != null">
and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate}
</if>
GROUP BY o.name
</select>
</mapper>