创建表:
CREATE TABLE `t_inpatient_medical_records` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`inpatient_record_code` varchar(32) DEFAULT NULL COMMENT '就诊流水号',
`patient_name` varchar(256) DEFAULT NULL COMMENT '患者姓名',
`pat_id` varchar(16) DEFAULT NULL COMMENT '住院patid',
`document_no` varchar(16) NOT NULL COMMENT '病历文档编号',
`medical_record_code` varchar(255) NOT NULL COMMENT '病历文档段代码',
`medical_record_name` varchar(255) NOT NULL COMMENT '病历文档段名称',
`medical_record_content` LONGBLOB COMMENT '病历文本内容',
`display_sequence_no` int(11) DEFAULT NULL COMMENT '显示顺序号',
`medical_record_type` char(1) NOT NULL COMMENT '病历类型;1入院病历;2出院小结',
`organ_code` varchar(32) DEFAULT NULL COMMENT '机构编码',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除 0 未删除 1 已删除',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_pat_id` (`pat_id`) USING BTREE,
KEY `idx_inpatient_record_code_record_type` (`inpatient_record_code`,`medical_record_type`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=641 DEFAULT CHARSET=utf8mb4 COMMENT='住院病历表';
插入语句(插入和原来的区别)
INSERT INTO t_inpatient_medical_records (inpatient_record_code, patient_name, pat_id, document_no, medical_record_code, medical_record_name, medical_record_content, display_sequence_no, medical_record_type, organ_code, create_user, create_time, update_user, update_time) VALUES ('10000001','胡小芬', '10001','b0001','ABC02','档案001','肠胃炎需要注意事项肠胃炎需要注意事项',10,'2', 'C1111','陈晓','2023-03-20', '王沉','2023-03-21')
查询语句:
select CONVERT(t.medical_record_content USING UTF8) from t_inpatient_medical_records t;