select service_donatebaseinfo.*
from service_donatebaseinfo
LEFT JOIN `base_organization`
ON `base_organization`.`OrganizationID` = `service_donatebaseinfo`.`TreatmentHospitalNo`
update service_donatebaseinfo
set DonorNo = #{updateNumber}
where ID = #{id}
service_donatebaseinfo.del_flag = 0
and Name like concat('%', #{name}, '%')
and Sex = #{sex}
and coordinator_name like concat('%',#{coordinatorName}, '%')
and coordinator_no = #{coordinatorNo}
and service_donatebaseinfo.case_no = #{caseNo}
and IDCardType = #{idcardtype}
and IDCardNo = #{idcardno}
and Age = #{age}
and AgeUnit = #{ageunit}
and Birthday = #{birthday}
and Phone = #{phone}
and ResidenceAddress = #{residenceaddress}
and ResidenceProvince =
#{residenceprovince}
and termination_case =
#{terminationCase}
and ResidenceProvinceName like
concat('%', #{residenceprovincename}, '%')
and ResidenceCity = #{residencecity}
and ResidenceCityName like concat('%',
#{residencecityname}, '%')
and ResidenceTown = #{residencetown}
and ResidenceTownName like concat('%',
#{residencetownname}, '%')
and ResidenceCommunity =
#{residencecommunity}
and ResidenceCommunityName like
concat('%', #{residencecommunityname}, '%')
and ResidenceCountyCode =
#{residencecountycode}
and ResidenceCountyName like
concat('%', #{residencecountyname}, '%')
and RegisterAddress = #{registeraddress}
and RegisterProvince = #{registerprovince}
and RegisterProvinceName like
concat('%', #{registerprovincename}, '%')
and RegisterCity = #{registercity}
and RegisterCityName like concat('%',
#{registercityname}, '%')
and RegisterTown = #{registertown}
and RegisterTownName like concat('%',
#{registertownname}, '%')
and RegisterCommunity =
#{registercommunity}
and RegisterCommunityName like
concat('%', #{registercommunityname}, '%')
and RegisterCountyCode =
#{registercountycode}
and RegisterCountyName like concat('%',
#{registercountyname}, '%')
and RecordState = #{recordstate}
and TreatmentHospitalNo =
#{treatmenthospitalno}
and TreatmentHospitalName like
concat('%', #{treatmenthospitalname}, '%')
and TreatmentDeptName like concat('%',
#{treatmentdeptname}, '%')
and DiagnosisNo = #{diagnosisno}
and DiagnosisName like concat('%',
#{diagnosisname}, '%')
and BloodType = #{bloodtype}
and InpatientNo = #{inpatientno}
and DonorNo like concat('%', #{donorno}, '%')
and DonationCategory = #{donationcategory}
and IllnessOverview = #{illnessoverview}
and Kinship = #{kinship}
and SelfWill = #{selfwill}
and KinshipWill = #{kinshipwill}
and InfoSources = #{infosources}
and RedOrganNo = #{redorganno}
and RedOrganName like concat('%', #{redorganname},
'%')
and ContactPerson = #{contactperson}
and ContactNumber = #{contactnumber}
and ContactTime = #{contacttime}
and ReporterNo = #{reporterno}
and ReporterName like concat('%', #{reportername},
'%')
and ReporterPhone = #{reporterphone}
and ReportTime = #{reporttime}
and info_name like concat('%',#{infoName},'%')
and info_no = #{infoNo}
and infoPhone = #{infophone}
and `service_donatebaseinfo`.create_by = #{createBy}
and donatetime >= #{starttime}
and donatetime <= #{endtime}
and NativePlace = #{nativeplace}
and `base_organization`.`City` = #{city}
and deptid = #{deptid}
and deptname = #{deptname}
and leaderno = #{leaderno}
and leadername = #{leadername}
and businessarea = #{businessarea}
and donatetime = #{donatetime}
and donateno = #{donateno}
and workflow = #{workflow}
and report_id = #{reportId}
and gcs_score = #{gcsScore}
order by ReportTime desc
select DonorNo
from service_donatebaseinfo
where id = #{id}
select count(*)
from service_donatebaseinfo
where RecordState = "9"
select count(*) from service_donatebaseinfo b
inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
AND b.del_flag=0
and b.donatetime >= #{starttime}
and b.case_no >= #{caseNo}
and b.report_id = #{reportId}
and b.donatetime <= #{endtime}
and b.gcs_score = #{gcsScore}
and o.City = #{city}
and b.ReporterNo = #{reporterno}
select count(*)
from service_donatebaseinfo
where ReportTime >= #{starttime}
and ReportTime <= #{endtime}
select BloodCode
from base_bloodtype
where BloodType = #{bloodtype}
select count(*)
from service_donatebaseinfo
where RecordState = "99"
and ReportTime >= #{starttime}
and ReportTime <= #{endtime}
select ID, ReportTime
from service_donatebaseinfo
where TreatmentHospitalNo = #{organizationid}
select * from service_donatebaseinfo b
inner join base_organization o on b.TreatmentHospitalNo = o.OrganizationID
and b.ReportTime >= #{starttime}
and b.case_no >= #{caseNo}
and b.ReportTime <= #{endtime}
and o.City = #{city}
and b.ReporterNo = #{reporterno}
Name like concat('%', #{name}, '%')
or idcardno like concat('%', #{name}, '%')
or treatmenthospitalname like concat('%', #{name}, '%')
or residenceprovincename like concat('%', #{name}, '%')
or residencecityname like concat('%', #{name}, '%')
or residencetownname like concat('%', #{name}, '%')
or bloodtype like concat('%', #{name}, '%')
or nativeplace like concat('%', #{name}, '%')
or reportername like concat('%', #{name}, '%')
select name
from service_donatebaseinfo
where id = #{infoid}
select AcquisitionTissueName
from service_donatebaseinfo
where id = #{infoid}
select *
from service_donatebaseinfo
where id = #{infoid}
select count(*)
from service_donatebaseinfo
where RecordState = #{recordState}
and ReportTime >= #{starttime}
and ReportTime <= #{endtime}
select o.city
from service_donatebaseinfo b
inner join base_organization o on o.organizationid = b.treatmenthospitalno
where (b.RecordState = '0' or b.RecordState = '1' or b.RecordState = '2')
select o.city
from service_donatebaseinfo b
inner join service_donatecompletioninfo d on d.infoid = b.id
inner join base_organization o on o.organizationid = b.treatmenthospitalno
where d.CompleteTime > 0
select o.city
from service_donatebaseinfo b
inner join service_donateorgan d on d.infoid = b.id
inner join base_organization o on o.organizationid = b.treatmenthospitalno
where d.OrganGetTime > 0
select Name
from service_donatebaseinfo
where id = #{infoid}
select o.city
from service_donatebaseinfo b
inner join base_organization o on o.organizationid = b.treatmenthospitalno
where (b.RecordState = '0' or b.RecordState = '1' or b.RecordState = '2')
and b.ReportTime >= #{starttime}
and b.ReportTime <= #{endtime}
select o.city
from service_donatebaseinfo b
inner join service_donatecompletioninfo d on d.infoid = b.id
inner join base_organization o on o.organizationid = b.treatmenthospitalno
where d.del_flag = 0
and d.CompleteTime >= #{starttime}
and d.CompleteTime <= #{endtime}
select b.treatmenthospitalno from service_donatebaseinfo b
inner join service_donatecompletioninfo d on d.infoid=b.id
inner join base_organization o on o.organizationid=b.treatmenthospitalno
d.del_flag=0
and d.CompleteTime >= #{starttime}
and d.CompleteTime <= #{endtime}
and o.City = #{city}
and b.ReporterNo = #{reporterno}
and b.case_no >= #{caseNo}
select o.city
from service_donatebaseinfo b
inner join service_donateorgan d on d.infoid = b.id
inner join base_organization o on o.organizationid = b.treatmenthospitalno
WHERE d.del_flag = 0
AND d.OrganGetTime IS NOT NULL
AND d.OrganGetTime >= #{starttime}
AND d.OrganGetTime <= #{endtime}
SELECT sd.treatmenthospitalname AS treatmenthospitalname,
sd.treatmenthospitalno AS treatmenthospitalno,
sd.DonorNo AS donorno,
sd.id AS id,
sd.InpatientNo AS inpatientNo,
sd.case_no AS caseNo,
sd.NAME AS NAME,
sd.RecordState AS recordstate,
sd.termination_case AS terminationCase,
sd.termination_type AS terminationType,
sd.termination_result AS terminationResult,
sd.workflow AS workflow,
sd.Infectious AS infectious,
sd.Infectious_other AS infectiousOther,
sd.Sex AS sex,
sd.Age AS age,
sd.BloodType AS bloodtype,
sd.idcardno AS idcardno,
sd.ReportTime AS reportTime,
sd.coordinator_no AS coordinatorNo,
sd.coordinator_name AS coordinatorName,
sd.diagnosisname AS diagnosisname,
sd.extracontent AS extracontent,
sm.assess_state AS assessState,-- 评估状态
sm.assess_time AS assessTime,-- 评估时间
sr.SignDate AS signDate,-- 亲属确认时间
se.expert_conclusion AS expertConclusion,-- 伦理审查专家结论
se.expert_time AS expertTime,-- 伦理审查专家结论时间
(SELECT COUNT(*) FROM service_donateorgan sdo WHERE sdo.InfoID = sd.ID) AS organCount,-- 器官分配数量
sdw.OperationBegTime AS operationBegTime,-- 获取见证时间
sdt.CompleteTime AS completeTime -- 完成登记时间
FROM service_donatebaseinfo sd
LEFT JOIN service_medicalevaluation sm ON sd.ID = sm.InfoID
AND sm.del_flag = 0 -- 捐献评估
LEFT JOIN service_relativesconfirmation sr ON sd.ID = sr.InfoID
AND sr.del_flag = 0-- 捐献确认
LEFT JOIN service_ethicalreviewinitiate se ON sd.ID = se.InfoID
AND se.del_flag = 0-- 伦理审查
LEFT JOIN service_donationwitness sdw ON sd.ID = sdw.InfoID
AND sdw.del_flag = 0-- 获取见证
LEFT JOIN service_donatecompletioninfo sdt ON sd.ID = sdt.InfoID
AND sdt.del_flag = 0 -- 完成登记
sd.del_flag = 0
AND sd.termination_case = #{terminationCase}
AND sd.TreatmentHospitalName = #{treatmentHospitalName}
AND sd.Name = #{name}
AND sd.InpatientNo = #{inpatientNo}
AND sd.age >= #{startAge}
AND sd.age <= #{endAge}
and IDCardNo = #{idcardno}
and sd.RecordState = #{recordstate}
and sd.workflow = #{workflow}
and sd.DiagnosisName like concat('%', #{diagnosisName}, '%')
ORDER BY sd.ReportTime DESC
limit #{pageNum},#{pageSize}