@ -116,7 +116,8 @@
from commomtable
from commomtable
</select>
</select>
<!-- 根据住院次数和病案号和姓名查询patientId -->
<!-- 根据住院次数和病案号和姓名查询patientId -->
<select id= "selectPatientIdByAdmissTimesAndInpatientNoAndName" resultType= "java.lang.String" parameterType= "java.lang.String" >
<select id= "selectPatientIdByAdmissTimesAndInpatientNoAndName" resultType= "java.lang.String"
parameterType="java.lang.String">
SELECT
SELECT
patient_id
patient_id
FROM
FROM
@ -318,13 +319,34 @@
dbo.commomtable.main_dis_thing,
dbo.commomtable.main_dis_thing,
dbo.commomtable.dis_dept,
dbo.commomtable.dis_dept,
dbo.commomtable.dis_date,
dbo.commomtable.dis_date,
(select stuff((select ', '+diag_name from dbo.t_diag where diag.patient_id=patient_id and diag_no > '1' for xml path('')),1,1,'')) as otherDiagName
(select stuff((select ', ' + diag_name
from dbo.t_diag
where diag.patient_id = patient_id
and diag_no > '1' for xml path('')),
1,
1,
'')
) as
otherDiagName
FROM
FROM
dbo.commomtable
dbo
LEFT JOIN
.
dbo.t_diag diag
commomtable
LEFT
JOIN
dbo
.
t_diag
diag
ON
ON
dbo.commomtable.patient_id = diag.patient_id
dbo
.
commomtable
.
patient_id =
diag
.
patient_id
WHERE
WHERE
dbo.commomtable.patient_id = #{patientId}
dbo.commomtable.patient_id = #{patientId}
</select>
</select>
@ -361,7 +383,8 @@
dbo.commomtable.admiss_id,
dbo.commomtable.admiss_id,
dbo.commomtable.admiss_times,
dbo.commomtable.admiss_times,
dbo.commomtable.dis_dept,
dbo.commomtable.dis_dept,
(CASE WHEN dbo.commomtable.dis_date is not null and dbo.commomtable.dis_date != '' THEN CONVERT(varchar(100),dbo.commomtable.dis_date, 23) ELSE null end) dis_date,
(CASE WHEN dbo.commomtable.dis_date is not null and dbo.commomtable.dis_date != '' THEN
CONVERT(varchar(100),dbo.commomtable.dis_date, 23) ELSE null end) dis_date,
dbo.commomtable1.id_card,
dbo.commomtable1.id_card,
dbo.t_basic.clinic_id,
dbo.t_basic.clinic_id,
dbo.t_basic.bed_no,
dbo.t_basic.bed_no,
@ -370,10 +393,12 @@
dbo.commomtable.age,
dbo.commomtable.age,
dbo.commomtable.age_month,
dbo.commomtable.age_month,
dbo.commomtable.age_day,
dbo.commomtable.age_day,
(CASE WHEN dbo.commomtable1.birthday is not null and dbo.commomtable1.birthday != '' THEN CONVERT(varchar(100),dbo.commomtable1.birthday, 23) ELSE null end) birthday,
(CASE WHEN dbo.commomtable1.birthday is not null and dbo.commomtable1.birthday != '' THEN
CONVERT(varchar(100),dbo.commomtable1.birthday, 23) ELSE null end) birthday,
dbo.commomtable1.marriage,
dbo.commomtable1.marriage,
dbo.commomtable1.admiss_dept,
dbo.commomtable1.admiss_dept,
(CASE WHEN dbo.commomtable.admiss_date is not null and dbo.commomtable.admiss_date != '' THEN CONVERT(varchar(100),dbo.commomtable.admiss_date, 23) ELSE null end) admiss_date
(CASE WHEN dbo.commomtable.admiss_date is not null and dbo.commomtable.admiss_date != '' THEN
CONVERT(varchar(100),dbo.commomtable.admiss_date, 23) ELSE null end) admiss_date
FROM
FROM
dbo.commomtable
dbo.commomtable
INNER JOIN dbo.commomtable1 ON dbo.commomtable.patient_id = dbo.commomtable1.patient_id
INNER JOIN dbo.commomtable1 ON dbo.commomtable.patient_id = dbo.commomtable1.patient_id
@ -405,9 +430,26 @@
<sql id= "Base_Column_List" >
<sql id= "Base_Column_List" >
patient_id, admiss_times, inpatient_no, NAME, admiss_id, sex, age, age_month, age_day,
patient_id
home_addr, name_cym, admiss_date, dis_date, admiss_days, dis_dept, is_oper, attending,
,
main_diag_name, main_dis_thing
admiss_times,
inpatient_no,
NAME,
admiss_id,
sex,
age,
age_month,
age_day,
home_addr,
name_cym,
admiss_date,
dis_date,
admiss_days,
dis_dept,
is_oper,
attending,
main_diag_name,
main_dis_thing
</sql>
</sql>
<select id= "selectByPrimaryKey" resultType= "com.emr.vo.commomSearch.CommomVo" parameterType= "java.lang.String" >
<select id= "selectByPrimaryKey" resultType= "com.emr.vo.commomSearch.CommomVo" parameterType= "java.lang.String" >
select
select
@ -417,7 +459,8 @@
</select>
</select>
<select id= "selectByPrimaryKeyPath" resultType= "com.emr.vo.commomSearch.CommomVo" parameterType= "java.lang.String" >
<select id= "selectByPrimaryKeyPath" resultType= "com.emr.vo.commomSearch.CommomVo" parameterType= "java.lang.String" >
select
select
patient_id,file_path
patient_id,
file_path
from commomtable
from commomtable
where patient_id = #{patientId,jdbcType=VARCHAR}
where patient_id = #{patientId,jdbcType=VARCHAR}
</select>
</select>
@ -608,10 +651,53 @@
<sql id= "Base_Column_List1" >
<sql id= "Base_Column_List1" >
patient_id, country, birth_addr, id_card, job, marriage, home_tel, home_zip,work_name, work_addr,
patient_id
work_tel, work_zip, linkman, relation, rel_addr, rel_tel, pay_type, birthday, avoirdupois,
,
admiss_type, admiss_dept, admiss_ward, change_dept, dis_ward, clinic_diag, clinic_name,
country,
pathology_code,pathology_no,pathology_name,medicine, is_medicine, emit_pathology, dept_director, director, admiss_doctor,refresher, praxis, coding, quality, control, nurses, quality_date, input_name,input_createTime,blood_type, RH
birth_addr,
id_card,
job,
marriage,
home_tel,
home_zip,
work_name,
work_addr,
work_tel,
work_zip,
linkman,
relation,
rel_addr,
rel_tel,
pay_type,
birthday,
avoirdupois,
admiss_type,
admiss_dept,
admiss_ward,
change_dept,
dis_ward,
clinic_diag,
clinic_name,
pathology_code,
pathology_no,
pathology_name,
medicine,
is_medicine,
emit_pathology,
dept_director,
director,
admiss_doctor,
refresher,
praxis,
coding,
quality,
control,
nurses,
quality_date,
input_name,
input_createTime,
blood_type,
RH
</sql>
</sql>
<select id= "selectByPrimaryKey1" resultType= "com.emr.vo.commomSearch.CommomVo" parameterType= "java.lang.String" >
<select id= "selectByPrimaryKey1" resultType= "com.emr.vo.commomSearch.CommomVo" parameterType= "java.lang.String" >
select
select
@ -661,8 +747,7 @@
pathology_name, input_name, input_createTime,
pathology_name, input_name, input_createTime,
ryqhm_days, ryqhm_hours, ryqhm_mins,
ryqhm_days, ryqhm_hours, ryqhm_mins,
ryhm_days, ryhm_hours, ryhm_mins,
ryhm_days, ryhm_hours, ryhm_mins,
transfer_hospital_name, transfer_healcenter_name
transfer_hospital_name, transfer_healcenter_name)
)
values (#{patientId,jdbcType=VARCHAR}, #{country,jdbcType=NVARCHAR}, #{birthAddr,jdbcType=NVARCHAR},
values (#{patientId,jdbcType=VARCHAR}, #{country,jdbcType=NVARCHAR}, #{birthAddr,jdbcType=NVARCHAR},
#{idCard,jdbcType=NVARCHAR}, #{job,jdbcType=NVARCHAR}, #{marriage,jdbcType=NVARCHAR},
#{idCard,jdbcType=NVARCHAR}, #{job,jdbcType=NVARCHAR}, #{marriage,jdbcType=NVARCHAR},
#{homeTel,jdbcType=NVARCHAR}, #{homeZip,jdbcType=NVARCHAR}, #{workAddr,jdbcType=NVARCHAR},
#{homeTel,jdbcType=NVARCHAR}, #{homeZip,jdbcType=NVARCHAR}, #{workAddr,jdbcType=NVARCHAR},
@ -679,10 +764,13 @@
#{nativePlace,jdbcType=NVARCHAR}, #{addr,jdbcType=NVARCHAR}, #{telphone,jdbcType=NVARCHAR},
#{nativePlace,jdbcType=NVARCHAR}, #{addr,jdbcType=NVARCHAR}, #{telphone,jdbcType=NVARCHAR},
#{zip,jdbcType=NVARCHAR}, #{changeDate1,jdbcType=NVARCHAR}, #{changeDate2,jdbcType=NVARCHAR},
#{zip,jdbcType=NVARCHAR}, #{changeDate1,jdbcType=NVARCHAR}, #{changeDate2,jdbcType=NVARCHAR},
#{changeDate3,jdbcType=NVARCHAR}, #{changeDept1,jdbcType=NVARCHAR}, #{changeDept2,jdbcType=NVARCHAR},
#{changeDate3,jdbcType=NVARCHAR}, #{changeDept1,jdbcType=NVARCHAR}, #{changeDept2,jdbcType=NVARCHAR},
#{changeDept3,jdbcType=NVARCHAR}, #{isHospitalization,jdbcType=NVARCHAR}, #{hospitalizationObjective,jdbcType=NVARCHAR},
#{changeDept3,jdbcType=NVARCHAR}, #{isHospitalization,jdbcType=NVARCHAR},
#{hospitalizationObjective,jdbcType=NVARCHAR},
#{isMedicalRecordPath,jdbcType=NVARCHAR}, #{responsibleNurse,jdbcType=NVARCHAR},
#{isMedicalRecordPath,jdbcType=NVARCHAR}, #{responsibleNurse,jdbcType=NVARCHAR},
#{tumorStagingType,jdbcType=NVARCHAR}, #{radiotherapyType,jdbcType=NVARCHAR}, #{radiotherapyProgram,jdbcType=NVARCHAR},
#{tumorStagingType,jdbcType=NVARCHAR}, #{radiotherapyType,jdbcType=NVARCHAR},
#{radiotherapyDevice,jdbcType=NVARCHAR}, #{primaryTumorDay,jdbcType=INTEGER}, #{primaryTumorTimes,jdbcType=INTEGER},
#{radiotherapyProgram,jdbcType=NVARCHAR},
#{radiotherapyDevice,jdbcType=NVARCHAR}, #{primaryTumorDay,jdbcType=INTEGER},
#{primaryTumorTimes,jdbcType=INTEGER},
#{primaryTumorDose,jdbcType=NVARCHAR}, #{primaryTumorStarttime,jdbcType=NVARCHAR},
#{primaryTumorDose,jdbcType=NVARCHAR}, #{primaryTumorStarttime,jdbcType=NVARCHAR},
#{primaryTumorEndtime,jdbcType=NVARCHAR}, #{chemotherapyType,jdbcType=NVARCHAR},
#{primaryTumorEndtime,jdbcType=NVARCHAR}, #{chemotherapyType,jdbcType=NVARCHAR},
#{chemotherapyMethod,jdbcType=NVARCHAR}, #{caseType,jdbcType=VARCHAR}, #{totalCharge,jdbcType=DECIMAL},
#{chemotherapyMethod,jdbcType=NVARCHAR}, #{caseType,jdbcType=VARCHAR}, #{totalCharge,jdbcType=DECIMAL},
@ -698,13 +786,13 @@
#{charge44,jdbcType=DECIMAL}, #{charge45,jdbcType=DECIMAL}, #{nation,jdbcType=NVARCHAR},
#{charge44,jdbcType=DECIMAL}, #{charge45,jdbcType=DECIMAL}, #{nation,jdbcType=NVARCHAR},
#{homeAddr,jdbcType=NVARCHAR}, #{clinicDoctor,jdbcType=NVARCHAR}, #{disType,jdbcType=NVARCHAR},
#{homeAddr,jdbcType=NVARCHAR}, #{clinicDoctor,jdbcType=NVARCHAR}, #{disType,jdbcType=NVARCHAR},
#{birthbabyWeight,jdbcType=DECIMAL}, #{healthyCard,jdbcType=NVARCHAR}, #{saveTimes,jdbcType=NVARCHAR},
#{birthbabyWeight,jdbcType=DECIMAL}, #{healthyCard,jdbcType=NVARCHAR}, #{saveTimes,jdbcType=NVARCHAR},
#{saveSuccessTimes,jdbcType=NVARCHAR}, #{avoirdupois,jdbcType=DECIMAL}, #{admissThing,jdbcType=NVARCHAR},
#{saveSuccessTimes,jdbcType=NVARCHAR}, #{avoirdupois,jdbcType=DECIMAL},
#{admissThing,jdbcType=NVARCHAR},
#{workName,jdbcType=NVARCHAR}, #{pathologyCode,jdbcType=VARCHAR}, #{pathologyNo,jdbcType=VARCHAR},
#{workName,jdbcType=NVARCHAR}, #{pathologyCode,jdbcType=VARCHAR}, #{pathologyNo,jdbcType=VARCHAR},
#{pathologyName,jdbcType=VARCHAR}, #{inputName,jdbcType=NVARCHAR}, #{inputCreatetime,jdbcType=NVARCHAR},
#{pathologyName,jdbcType=VARCHAR}, #{inputName,jdbcType=NVARCHAR}, #{inputCreatetime,jdbcType=NVARCHAR},
#{ryqhmDays,jdbcType=INTEGER}, #{ryqhmHours,jdbcType=INTEGER}, #{ryqhmMins,jdbcType=INTEGER},
#{ryqhmDays,jdbcType=INTEGER}, #{ryqhmHours,jdbcType=INTEGER}, #{ryqhmMins,jdbcType=INTEGER},
#{ryhmDays,jdbcType=INTEGER}, #{ryhmHours,jdbcType=INTEGER}, #{ryhmMins,jdbcType=INTEGER},
#{ryhmDays,jdbcType=INTEGER}, #{ryhmHours,jdbcType=INTEGER}, #{ryhmMins,jdbcType=INTEGER},
#{transferHospitalName,jdbcType=NVARCHAR}, #{transferHealcenterName,jdbcType=NVARCHAR}
#{transferHospitalName,jdbcType=NVARCHAR}, #{transferHealcenterName,jdbcType=NVARCHAR})
)
</insert>
</insert>
<!-- 更新commomtable1表 -->
<!-- 更新commomtable1表 -->
@ -1118,21 +1206,31 @@
</select>
</select>
<!-- 查询表字段数 -->
<!-- 查询表字段数 -->
<select id= "selectColByTableName" resultType= "java.lang.Integer" >
<select id= "selectColByTableName" resultType= "java.lang.Integer" >
select count(*) from syscolumns s where s.id = object_id(#{tableName});
select count(*)
from syscolumns s
where s.id = object_id(#{tableName});
</select>
</select>
<!-- 查commomtable1表的肿瘤信息 -->
<!-- 查commomtable1表的肿瘤信息 -->
<select id= "selectTumourByPatientId" resultType= "com.emr.vo.commomSearch.CommomVo" >
<select id= "selectTumourByPatientId" resultType= "com.emr.vo.commomSearch.CommomVo" >
select
select
tumor_staging_type,
tumor_staging_type,
radiotherapy_type, radiotherapy_program,
radiotherapy_type,
radiotherapy_device, primary_tumor_day, primary_tumor_times,
radiotherapy_program,
primary_tumor_dose, primary_tumor_starttime,
radiotherapy_device,
primary_tumor_endtime, chemotherapy_type,
primary_tumor_day,
primary_tumor_times,
primary_tumor_dose,
primary_tumor_starttime,
primary_tumor_endtime,
chemotherapy_type,
chemotherapy_method
chemotherapy_method
from commomtable1 where patient_id = #{patientId}
from commomtable1
where patient_id = #{patientId}
</select>
</select>
<!-- 根据病案号查询 -->
<!-- 根据病案号查询 -->
<select id= "selectCommomByInpatientNo" resultMap= "BaseResultMap" >
<select id= "selectCommomByInpatientNo" resultMap= "BaseResultMap" >
select patient_id,inpatient_no,name,admiss_id,admiss_times,dis_date,dis_dept from commomtable where inpatient_no like '%${inpatientNo}%'
select patient_id,inpatient_no,name,admiss_id,admiss_times,dis_date,dis_dept
from commomtable
where inpatient_no like '%${inpatientNo}%'
</select>
</select>
</mapper>
</mapper>