-- 2023-05-04
ALTER table base_menu_dict add COLUMN `author` varchar(255) DEFAULT NULL COMMENT '来源、作者';
ALTER table base_menu_dict add COLUMN `doctors` varchar(255) DEFAULT NULL COMMENT '推荐医生 多个逗号间隔';
ALTER table base_menu_dict add COLUMN `music_url` varchar(255) DEFAULT NULL COMMENT '音频';
ALTER table base_menu_dict add COLUMN `release_type` varchar(255) DEFAULT NULL COMMENT '发布类型 1图文 2视频 3音频';

INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('releaseType1', NULL, 'releaseType', '1', '图文', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('releaseType2', NULL, 'releaseType', '2', '视频', NULL, '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('releaseType3', NULL, 'releaseType', '3', '音频', NULL, '3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

CREATE TABLE `base_menu_dict_user` (
     `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
     `user_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
     `user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
     `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
     `fabulous` int DEFAULT NULL COMMENT '1已赞0未赞',
     `is_read` int DEFAULT NULL COMMENT '1已读0未读',
     `is_share` int DEFAULT NULL COMMENT '1已分享0未分享',
     `collection` int DEFAULT NULL COMMENT '是否收藏1是0否',
     `used` int DEFAULT NULL COMMENT '1常用0不常用',
     `del` int DEFAULT '1' COMMENT '是否删除，1正常，0删除',
     `relation_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
     `relation_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
     `relation_type` int DEFAULT NULL COMMENT '1、文章2、问卷',
     PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;




-- 2023-04-24
CREATE TABLE `base_team_relation` (
   `id` varchar(50) NOT NULL,
   `team_id` varchar(50) DEFAULT NULL COMMENT '专科团队id',
   `admin_team_id` int DEFAULT NULL COMMENT '社区团队id',
   `create_time` datetime DEFAULT NULL,
   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='专科团队关联社区团队表';




-- 2023-04-20
ALTER table base_team add COLUMN `intro` varchar(2000) DEFAULT NULL COMMENT '团队简介';
ALTER table base_team add COLUMN `recommend` varchar(1) DEFAULT NULL COMMENT '推荐 1是0否';
ALTER table base_team add COLUMN `recommend_doctor` varchar(50) DEFAULT NULL COMMENT '推荐医生code';
ALTER table base_team add COLUMN `recommend_doctor_name` varchar(50) DEFAULT NULL COMMENT '推荐医生姓名';
ALTER table base_team add COLUMN `dept` varchar(50) DEFAULT NULL COMMENT '科室code';
ALTER table base_team add COLUMN `dept_name` varchar(50) DEFAULT NULL COMMENT '科室名称';
ALTER table base_team add COLUMN `img` varchar(255) DEFAULT NULL COMMENT '图片';

-- 2023-02-27
base_patient_doctor 暂时用来代替 wlyy_sign_family



==========================开始==================================
ALTER TABLE `base`.`wlyy_rehabilitation_plan_template`
ADD COLUMN `disease_id` varchar(50) NULL COMMENT '病种code' AFTER `update_time`,
ADD COLUMN `disease_name` varchar(50) NULL COMMENT '病种name' AFTER `update_time`,
ADD COLUMN `status` varchar(10) NULL COMMENT '状态是否生效' AFTER `disease_id`;

ALTER TABLE `base`.`wlyy_rehabilitation_plan_template`
ADD COLUMN `type` varchar(255) NULL COMMENT 'template表示模板，plan表示计划' AFTER `status`;

ALTER TABLE `base`.`wlyy_rehabilitation_template_detail`
ADD COLUMN `assess_type` varchar(10) NULL COMMENT '项目评价' AFTER `expense`,
ADD COLUMN `booking_type` varchar(10) NULL COMMENT '是否预约' AFTER `assess_type`,
ADD COLUMN `late_serve_type` varchar(10) NULL COMMENT '是否运行逾期服务' AFTER `booking_type`,
ADD COLUMN `plan_start_time_type` varchar(10) NULL COMMENT '计划开始时间类型' AFTER `late_serve_type`,
ADD COLUMN `server_time_type` varchar(10) NULL COMMENT '服务方法' AFTER `plan_start_time_type`,
ADD COLUMN `server_count` varchar(10) NULL COMMENT '服务次数' AFTER `server_time_type`,
ADD COLUMN `pricing_units_code` varchar(10) NULL COMMENT '计价单位' AFTER `server_count`;
ADD COLUMN `pricing_units_name` varchar(10) NULL COMMENT '计价单位名称' AFTER `pricing_units_name`;




ALTER TABLE `base`.`base_service_package_item`
ADD COLUMN `leased_code` varchar(100) NULL COMMENT '租户code' AFTER `topic_item`,
ADD COLUMN `leased_name` varchar(50) NULL COMMENT '租户name' AFTER `leased_code`,
ADD COLUMN `sub_item_type` varchar(10) NULL COMMENT '是否包含子项目' AFTER `leased_name`;
ALTER TABLE `base`.`base_service_package_item`
ADD COLUMN `template_type` varchar(20) NULL COMMENT '模板的类型-目前是随访为1' AFTER `sub_item_type`,
ADD COLUMN `template_code` varchar(255) NULL COMMENT '对应模板的id' AFTER `template_type`;



CREATE TABLE `base`.`base_service_item_config`  (
  `id` varchar(100) NOT NULL COMMENT '主键',
  `package_id` varchar(100) NULL COMMENT '服务包id',
  `server_item_id` varchar(100) NULL COMMENT '服务项id',
  `assess_type` varchar(100) NULL COMMENT '项目评价',
  `booking_type` varchar(100) NULL COMMENT '是否预约',
  `late_serve_type` varchar(100) NULL COMMENT '是否运行逾期服务',
  `plan_start_time_type` varchar(100) NULL COMMENT '计划开始时间类型',
  `server_time_type` varchar(100) NULL COMMENT '服务方法',
  `server_count` varchar(100) NULL COMMENT '服务次数',
  `template_type` varchar(100) NULL COMMENT '模板的类型-目前是随访为1',
  `template_code` varchar(100) NULL COMMENT '对应模板的id',
  PRIMARY KEY (`id`)
);


CREATE TABLE `template_json` (
  `id`  varchar(100)  NOT NULL COMMENT '主键',
  `template_id` varchar(100) DEFAULT NULL COMMENT '模板id',
  `template_name` varchar(50) DEFAULT NULL COMMENT '模板名称',
  `template_json` text COMMENT '模板json',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_user` varchar(255) DEFAULT NULL COMMENT '创建人',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


ALTER TABLE `base`.`base_service_package`
ADD COLUMN `leased_code` varchar(50) NULL COMMENT '租户code' AFTER `org_name`,
ADD COLUMN `leased_name` varchar(50) NULL COMMENT '租户name' AFTER `leased_code`,
ADD COLUMN `server_time_type` varchar(20) NULL COMMENT '服务时间类型' AFTER `leased_name`,
ADD COLUMN `server_time` varchar(50) NULL COMMENT '服务期限' AFTER `server_time_type`,
ADD COLUMN `server_time_description` varchar(255) NULL COMMENT '服务时间说明' AFTER `server_time`,
ADD COLUMN `create_user` varchar(50) NULL COMMENT '创建人code' AFTER `server_time_description`,
ADD COLUMN `create_user_name` varchar(20) NULL COMMENT '创建人name' AFTER `create_user`,
ADD COLUMN `update_user` varchar(50) NULL COMMENT '更新人code' AFTER `create_user_name`,
ADD COLUMN `update_user_name` varchar(50) NULL COMMENT '更新人name' AFTER `update_user`,
ADD COLUMN `update_time` datetime NULL COMMENT '更新时间' AFTER `create_time`;


CREATE TABLE `base`.`base_service_package_sub_item`  (
  `id` varchar(100) NOT NULL COMMENT '主键',
  `name` varchar(100) NULL COMMENT '名称',
  `item_id` varchar(100) NULL COMMENT '项目的id',
  `introduce` varchar(255) NULL COMMENT '说明',
  `status` varchar(10) NULL COMMENT '状态',
  `sort` varchar(10) NULL,
  `leased_code` varchar(100) NULL,
  `leased_name` varchar(100) NULL,
  `org_code` varchar(100) NULL COMMENT '机构code',
  `org_name` varchar(100) NULL COMMENT '机构name',
  `photo` varchar(100) NULL COMMENT '照片',
  `create_time` varchar(100) NULL COMMENT '照片',
  `create_time` datetime ;
  PRIMARY KEY (`id`)
);

ALTER TABLE `base`.`base_service_package_sub_item`
ADD COLUMN `item_id` varchar(100) NULL COMMENT '父项目id' AFTER `id`;


CREATE TABLE `base`.`base_service_package_item_relational`  (
  `id` varchar(100) NOT NULL COMMENT '主键',
  `item_id` varchar(100) NULL COMMENT '项目id',
  `sub_item_id` varchar(100) NULL COMMENT '子项目id',
  PRIMARY KEY (`id`)
);



CREATE TABLE `base`.`base_followup_template`  (
  `id` varchar(100) NOT NULL,
  `template_name` varchar(255) NULL,
  `followup_statrt_time_type` varchar(100) NULL,
  `followup_count` varchar(10) NULL,
  `description` varchar(255) NULL,
  `template_detail_json` text NULL,
  `status` varchar(10) NULL,
  `leased_code` varchar(100) NULL,
  `leased_name` varchar(100) NULL,
  `org_code` varchar(100) NULL,
  `org_name` varchar(255) NULL,
  `create_time` datetime NULL,
  `update_time` datetime NULL,
  `create_user` varchar(100) NULL,
  `create_user_name` varchar(100) NULL,
  `update_user` varchar(100) NULL,
  `update_user_name` varchar(100) NULL,
  PRIMARY KEY (`id`)
);


ALTER TABLE `base`.`base_disease_hospital`
ADD COLUMN `rehabilitation_type` varchar(100) NULL COMMENT '是否开通诊后康复 0否 1是' AFTER `sort`,
ADD COLUMN `rehabilitation_down_type` varchar(100) NULL COMMENT '康复下转 1自动 2手动' AFTER `rehabilitation_type`,
ADD COLUMN `rehabilitation_template_id` varchar(100) NULL COMMENT '康复计划模板id' AFTER `rehabilitation_down_type`;


ALTER TABLE `base`.`base_service_package_sub_item`
CHANGE COLUMN `item_id` `dict_item_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '字典配置的服务项的id' AFTER `id`;

ALTER TABLE `base`.`base_service_package_item`
ADD COLUMN `service_package_item_id` varchar(50) NULL COMMENT '创建服务项的id。也是本表的id。system那些数据' AFTER `service_package_id`;


ALTER TABLE `base`.`wlyy_rehabilitation_template_detail`
ADD COLUMN `template_type` varchar(100) NULL COMMENT '随访模板类型' AFTER `pricing_units_name`,
ADD COLUMN `template_code` varchar(100) NULL COMMENT '随访模板id' AFTER `template_type`;


ALTER TABLE `base`.`base_service_item_config`
ADD COLUMN `pricing_units_code` varchar(100) NULL COMMENT '计价单位' AFTER `template_code`,
ADD COLUMN `pricing_units_name` varchar(100) NULL COMMENT '计价单位名称' AFTER `pricing_units_code`;


ALTER TABLE `base`.`base_service_item_config`
ADD COLUMN `frequency_code` varchar(100) NULL COMMENT '频次' AFTER `pricing_units_name`;
===========================结束=================================

-- 2023-10-31 ysj 计算百分比函数
CREATE FUNCTION percentage(numerator FLOAT, denominator FLOAT) RETURNS VARCHAR(255)
    NO SQL
BEGIN
  DECLARE result VARCHAR(255);
	IF numerator IS NULL OR numerator=0 THEN
    SET result = '0%';
  ELSEIF (denominator = 0 OR denominator is null) AND numerator > 0 THEN
    SET result = '100%';
  ELSEIF denominator IS NULL THEN
    SET result = '0%';
ELSE
    SET result = CONCAT(ROUND((numerator / denominator) * 100, 2), '%');
END IF;
RETURN result;
END;

=========================== 康复模块[开始]=================================
ALTER TABLE `base`.`wlyy_rehabilitation_patient_info`
ADD COLUMN `type` tinyint(10) NULL COMMENT '1患者家签列表 2康复下转列表' AFTER `dept_name`,
ADD COLUMN `sign_status` tinyint(10) ZEROFILL NULL COMMENT '签约状态（1已家签 0 待家签）' AFTER `type`,
ADD COLUMN `patient` varchar(50) NULL COMMENT '居民code' AFTER `code`,
ADD COLUMN `create_user` varchar(100) NULL COMMENT '创建人' AFTER `sign_status`,
ADD COLUMN `create_user_name` varchar(50) NULL COMMENT '创建人姓名' AFTER `create_user`;

ALTER TABLE `base`.`wlyy_patient_rehabilitation_plan`
ADD COLUMN `patient_info_code` varchar(255) NULL AFTER `plan_doctor_name`;

=========================== 康复模块[结束]=================================

-- ysj 2023-12-01
CREATE TABLE `base_check_org` (
                                  `id` int(50) NOT NULL AUTO_INCREMENT,
                                  `orgCode` varchar(50) DEFAULT NULL COMMENT '机构code',
                                  `check_Date` varchar(50) DEFAULT NULL COMMENT '考核时间',
                                  `check_file` varchar(255) DEFAULT NULL COMMENT '考核文件',
                                  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机构考核';

INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('1000000001', NULL, 'PROFESSIONAL_STATE', '0', '国家机关、党群组织、企业、事业单位负责人', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('1000000002', NULL, 'PROFESSIONAL_STATE', '1', '专业技术人员', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('1000000003', NULL, 'PROFESSIONAL_STATE', '2', '办事人员和有关人员', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('1000000004', NULL, 'PROFESSIONAL_STATE', '3', '商业、服务业人员', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('1000000005', NULL, 'PROFESSIONAL_STATE', '4', '农、林、牧、渔、水利业生产人员', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('1000000006', NULL, 'PROFESSIONAL_STATE', '5', '生产、运输设备操作人员及有关人员', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('1000000007', NULL, 'PROFESSIONAL_STATE', '6', '军人', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('1000000008', NULL, 'PROFESSIONAL_STATE', '7', '不便分类的其他从业人员', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('1', '0', '1', '汉族', '1', '', '', 'HZ', 'IY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('2', '0', '2', '蒙古族', '1', '', '', 'MGZ', 'ADY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('3', '0', '3', '回族', '1', '', '', 'HZ', 'LY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('4', '0', '4', '藏族', '1', '', '', 'CZ', 'AY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('5', '0', '5', '维吾尔族', '1', '', '', 'WWEZ', 'XGQY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('6', '0', '6', '苗族', '1', '', '', 'MZ', 'AY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('7', '0', '7', '彝族', '1', '', '', 'YZ', 'XY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('8', '0', '8', '壮族', '1', '', '', 'ZZ', 'UY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('9', '0', '9', '布依族', '1', '', '', 'BYZ', 'DWY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('10', '0', '10', '朝鲜族', '1', '', '', 'CXZ', 'FQY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('11', '0', '11', '满族', '1', '', '', 'MZ', 'IY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('12', '0', '12', '侗族', '1', '', '', 'DZ', 'WY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('13', '0', '13', '瑶族', '1', '', '', 'YZ', 'GY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('14', '0', '14', '白族', '1', '', '', 'BZ', 'RY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('15', '0', '15', '土家族', '1', '', '', 'TJZ', 'FPY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('16', '0', '16', '哈尼族', '1', '', '', 'HNZ', 'KNY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('17', '0', '17', '哈萨克族', '1', '', '', 'HSKZ', 'KADY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('18', '0', '18', '傣族', '1', '', '', 'DZ', 'WY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('19', '0', '19', '黎族', '1', '', '', 'LZ', 'TY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('20', '0', '20', '傈僳族', '1', '', '', 'LSZ', 'WWY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('21', '0', '21', '佤族', '1', '', '', 'WZ', 'WY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('22', '0', '22', '畲族', '1', '', '', 'SZ', 'WY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('23', '0', '23', '高山族', '1', '', '', 'GSZ', 'YMY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('24', '0', '24', '拉祜族', '1', '', '', 'LBZ', 'RPY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('25', '0', '25', '水族', '1', '', '', 'SZ', 'IY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('26', '0', '26', '东乡族', '1', '', '', 'DXZ', 'AXY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('27', '0', '27', '纳西族', '1', '', '', 'NXZ', 'XSY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('28', '0', '28', '景颇族', '1', '', '', 'JPZ', 'JHY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('29', '0', '29', '柯尔克孜族', '1', '', '', 'KEKZZ', 'SQDBY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('30', '0', '30', '土族', '1', '', '', 'TZ', 'FY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('31', '0', '31', '达斡尔族', '1', '', '', 'DHEZ', 'DFQY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('32', '0', '32', '仫佬族', '1', '', '', 'MLZ', 'WWY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('33', '0', '33', '羌族', '1', '', '', 'QZ', 'UY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('34', '0', '34', '布朗族', '1', '', '', 'BLZ', 'DYY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('35', '0', '35', '撒拉族', '1', '', '', 'SLZ', 'RRY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('36', '0', '36', '毛南族', '1', '', '', 'MNZ', 'TFY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('37', '0', '37', '仡佬族', '1', '', '', 'GLZ', 'WWY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('38', '0', '38', '锡伯族', '1', '', '', 'XBZ', 'QWY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('39', '0', '39', '阿昌族', '1', '', '', 'ACZ', 'BJY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('40', '0', '40', '普米族', '1', '', '', 'PMZ', 'UOY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('41', '0', '41', '塔吉克族', '1', '', '', 'TJKZ', 'FFDY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('42', '0', '42', '怒族', '1', '', '', 'NZ', 'VY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('43', '0', '43', '乌孜别克族', '1', '', '', 'WZBKZ', 'QBKDY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('44', '0', '44', '俄罗斯族', '1', '', '', 'ELSZ', 'WLAY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('45', '0', '45', '鄂温克族', '1', '', '', 'EWKZ', 'KIDY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('46', '0', '46', '德昂族', '1', '', '', 'DAZ', 'TJY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('47', '0', '47', '保安族', '1', '', '', 'BAZ', 'WPY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('48', '0', '48', '裕固族', '1', '', '', 'YGZ', 'PLY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('49', '0', '49', '京族', '1', '', '', 'JZ', 'YY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('50', '0', '50', '塔塔尔族', '1', '', '', 'TTEZ', 'FFQY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('51', '0', '51', '独龙族', '1', '', '', 'DLZ', 'QDY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('52', '0', '52', '鄂伦春族', '1', '', '', 'ELCZ', 'KWDY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('53', '0', '53', '赫哲族', '1', '', '', 'HZZ', 'FRY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('54', '0', '54', '门巴族', '1', '', '', 'MBZ', 'UCY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('55', '0', '55', '珞巴族', '1', '', '', 'LBZ', 'CY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('56', '0', '56', '基诺族', '1', '', '', 'JNZ', 'AYY', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('57', '0', '99', '其他', '1', '', '', 'QT', 'AW', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('58', '0', '57', '穿青人', '1', '', '57', 'CQZ', 'CQZ', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('59', '0', '58', 'Turkish', '1', '', '', 'teq', 'Turkish', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('60', '0', '59', 'BRITAIN', '1', '', '', 'BRITISH', 'BRITAIN', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('61', '0', '60', 'AUSTRALIAN', '1', '', '', 'AUSTRALIAN', 'AUSTRALIAN', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('62', '0', '61', '/', '1', '', '', '/', '/', '0', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('63', '0', '63', 'Ukrainian', '1', '', '', 'Ukrainian', 'Ukrainian', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('64', '0', '101', '亻革家人', '1', '', '', 'RGJR', '', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('65', '0', '62', '山由族', '1', '', '', 'SYZ', 'MMY', '', NULL, '', NULL, '', '');

ALTER TABLE `wlyy_rehabilitation_guidance` MODIFY COLUMN `type` varchar(50);

ALTER TABLE base_service_item_plan
    ADD COLUMN reservation_type TINYINT(1) NULL;


CREATE TABLE `wlyy_patient_health_standard` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `patient` varchar(50) NOT NULL COMMENT '患者标识',
  `type` int(11) NOT NULL COMMENT '健康指标类型：1血糖，2血压，3体重，4腰围',
  `min_value_1` double DEFAULT NULL COMMENT '最低安全值(血糖餐前\\收缩压\\体重\\腰围)',
  `max_value_1` double DEFAULT NULL COMMENT '最高安全值(血糖餐前\\收缩压\\体重\\腰围)',
  `min_value_2` double DEFAULT NULL COMMENT '最低安全值(血糖餐后\\舒张压)',
  `max_value_2` double DEFAULT NULL COMMENT '最高安全值(血糖餐后\\舒张压)',
  `doctor` varchar(50) NOT NULL COMMENT '设置医生',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '设置时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_wlyy_patient_health_standard_1` (`patient`,`type`)
) ENGINE=InnoDB AUTO_INCREMENT=134944 DEFAULT CHARSET=utf8mb4 COMMENT='患者健康指标预警值';


CREATE TABLE `dm_device_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '设备类型标识',
  `name` varchar(50) NOT NULL COMMENT '设备类型名称',
  `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
  `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='设备分类表';

-- ysj 2023-12-14
CREATE TABLE `dm_sports` (
    `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
    `code` varchar(50) DEFAULT NULL COMMENT '运动编码',
    `name` varchar(100) DEFAULT NULL COMMENT '运动名称',
    `type` varchar(20) DEFAULT NULL COMMENT '运动强度类型标识',
    `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
    PRIMARY KEY (`id`) USING BTREE,
    KEY `idx_dm_sports_1` (`code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COMMENT='运动类型字典表';

CREATE TABLE `dm_sports_type` (
     `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
     `code` varchar(50) DEFAULT NULL COMMENT '强度编码',
     `name` varchar(100) DEFAULT NULL COMMENT '强度名称',
     `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
     PRIMARY KEY (`id`) USING BTREE,
     KEY `idx_dm_sports_type_1` (`code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='运动强度字典表';

CREATE TABLE `wlyy_food_comp` (
   `id` int(10) NOT NULL AUTO_INCREMENT,
   `pid` int(10) DEFAULT NULL,
   `name` varchar(50) DEFAULT NULL,
   `hot` int(10) DEFAULT '0' COMMENT '食物能量',
   `component` varchar(2000) DEFAULT NULL COMMENT '食物营养成分',
   `weight` varchar(50) DEFAULT '0' COMMENT '重量',
   `photo` varchar(50) DEFAULT NULL,
   PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4;

CREATE TABLE `dm_medicines` (
   `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
   `code` varchar(50) NOT NULL COMMENT '药品编码',
   `name` varchar(50) NOT NULL COMMENT '药品名称',
   `type` int(11) DEFAULT NULL COMMENT '药品类型：1健康记录',
   `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
   PRIMARY KEY (`id`) USING BTREE,
   KEY `idx_dm_medicines_1` (`code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='药品字典';

CREATE TABLE `wlyy_patient_health_record_diet` (
    `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
    `code` varchar(50) NOT NULL COMMENT '记录标识',
    `patient` varchar(50) NOT NULL COMMENT '患者标识',
    `record_date` date DEFAULT NULL COMMENT '记录时间',
    `content` varchar(500) DEFAULT NULL COMMENT '饮食内容',
    `images` varchar(3000) DEFAULT NULL COMMENT '图片HTTP地址，多图以逗号分隔',
    `sort_date` datetime DEFAULT NULL COMMENT '用于查询排序的时间',
    `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
    `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
    `source` varchar(50) DEFAULT NULL COMMENT '记录来源(0 手动 )',
    PRIMARY KEY (`id`),
    KEY `idx_wlyy_patient_health_record_diet_1` (`patient`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COMMENT='患者健康记录(饮食)表';

CREATE TABLE `wlyy_patient_health_record_medication` (
     `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
     `code` varchar(50) NOT NULL COMMENT '记录标识',
     `patient` varchar(50) NOT NULL COMMENT '患者标识',
     `record_date` date DEFAULT NULL COMMENT '记录时间',
     `medicines` varchar(50) DEFAULT NULL COMMENT '药品标识',
     `medicines_name` varchar(100) DEFAULT NULL COMMENT '药品名称',
     `sort_date` datetime DEFAULT NULL COMMENT '用于查询排序的时间',
     `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
     `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
     `source` varchar(50) DEFAULT NULL COMMENT '记录来源(0 手动 )',
     PRIMARY KEY (`id`),
     KEY `idx_wlyy_patient_health_record_medication_1` (`patient`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='患者健康记录(用药)表';

CREATE TABLE `wlyy_patient_health_record_sports` (
     `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
     `code` varchar(50) NOT NULL COMMENT '记录标识',
     `patient` varchar(50) NOT NULL COMMENT '患者标识',
     `record_date` date DEFAULT NULL COMMENT '记录时间',
     `sports_time` decimal(11,2) DEFAULT NULL,
     `sports_type` varchar(50) DEFAULT NULL COMMENT '运动强度',
     `sports_type_name` varchar(100) DEFAULT NULL COMMENT '运动强度名称',
     `sports` varchar(50) DEFAULT NULL COMMENT '运动类型',
     `sports_name` varchar(100) DEFAULT NULL COMMENT '运动类型名称',
     `sort_date` datetime DEFAULT NULL COMMENT '用于查询排序的时间',
     `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
     `del` varchar(1) DEFAULT '1' COMMENT '作废标识，1正常，0作废',
     `source` varchar(50) DEFAULT NULL COMMENT '记录来源(0 手动 )',
     PRIMARY KEY (`id`),
     KEY `idx_wlyy_patient_health_record_sports_1` (`patient`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='患者健康(运动)记录表';

INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('registerToWlyy1', NULL, 'registerToWlyy', 'pushAddress', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '设备推送地址');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('registerToWlyy2', NULL, 'registerToWlyy', 'url', 'http://www.cityihealth.com:43210/deviceManage/register', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

CREATE TABLE `wlyy_patient_device_log` (
   `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
   `device_id` int(11) DEFAULT NULL COMMENT 'dm_device表主键id',
   `patient` varchar(50) DEFAULT NULL COMMENT '患者id',
   `device_sn` varchar(50) DEFAULT NULL COMMENT '设备sn码',
   `device_name` varchar(50) DEFAULT NULL COMMENT '设备名称',
   `category_code` varchar(50) DEFAULT NULL COMMENT '设备类型(1血糖仪 2血压计)',
   `operator` varchar(50) DEFAULT NULL COMMENT '操作人code',
   `operator_name` varchar(50) DEFAULT NULL COMMENT '操作人姓名',
   `role` int(2) DEFAULT NULL COMMENT '医生或者患者（1医生2患者）',
   `operate_code` int(2) DEFAULT NULL COMMENT '操作动作（1绑定 2解绑）',
   `create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
   `is_del` int(2) DEFAULT '1' COMMENT '是否有效（0无效 1有效）',
   `agreement_photo` varchar(300) DEFAULT NULL COMMENT '上传协议图片地址',
   `hospital` varchar(50) DEFAULT NULL COMMENT '居民签约所在社区',
   `hospital_name` varchar(50) DEFAULT NULL COMMENT '居民签约居民社区名字',
   `check_doctor_name` varchar(50) DEFAULT NULL COMMENT '登记医生姓名',
   PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12773 DEFAULT CHARSET=utf8mb4;

ALTER table wlyy_patient_health_index add COLUMN `is_upload` tinyint(1) DEFAULT NULL COMMENT '是否上传物联网 0和null否 1是，2失败';

-- 2023-12-25 ysj
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('PatientCancel28', NULL, 'PatientCancel28', '1', '咨询信息填写错误', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('PatientCancel281', NULL, 'PatientCancel28', '2', '临时有事，无法按时复诊', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('PatientCancel282', NULL, 'PatientCancel28', '3', '其他', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

CREATE TABLE `wlyy_patient_aim_sports` (
   `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id主键，与业务主键无关',
   `code` varchar(50) NOT NULL COMMENT '业务主键UUID',
   `patientcode` varchar(50) DEFAULT NULL COMMENT '患者CODE',
   `daily_step_count` int(11) DEFAULT NULL COMMENT '每日步数',
   `bmi_max` varchar(10) DEFAULT NULL COMMENT '体重指数BMI标准值上限',
   `bmi_min` varchar(10) DEFAULT NULL COMMENT '体重指数BMI标准值下限',
   `create_date` varchar(10) DEFAULT NULL COMMENT '上传日期',
   `create_time` datetime DEFAULT NULL COMMENT '创建时间',
   PRIMARY KEY (`id`),
   UNIQUE KEY `code` (`patientcode`,`create_date`) USING BTREE
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COMMENT='患者-运动目标';

INSERT INTO `dm_sports_type` (`id`, `code`, `name`, `del`) VALUES ('1', '1', '轻度运动', '1');
INSERT INTO `dm_sports_type` (`id`, `code`, `name`, `del`) VALUES ('2', '2', '中度运动', '1');
INSERT INTO `dm_sports_type` (`id`, `code`, `name`, `del`) VALUES ('3', '3', '稍强运动', '1');
INSERT INTO `dm_sports_type` (`id`, `code`, `name`, `del`) VALUES ('4', '4', '强度运动', '1');

INSERT INTO `dm_sports` (`id`, `code`, `name`, `type`, `del`) VALUES ('1', '1', '购物', NULL, '1');
INSERT INTO `dm_sports` (`id`, `code`, `name`, `type`, `del`) VALUES ('2', '2', '散步', NULL, '1');
INSERT INTO `dm_sports` (`id`, `code`, `name`, `type`, `del`) VALUES ('3', '3', '做操', NULL, '1');
INSERT INTO `dm_sports` (`id`, `code`, `name`, `type`, `del`) VALUES ('4', '4', '太极拳', NULL, '1');
INSERT INTO `dm_sports` (`id`, `code`, `name`, `type`, `del`) VALUES ('5', '5', '气功', NULL, '1');
INSERT INTO `dm_sports` (`id`, `code`, `name`, `type`, `del`) VALUES ('6', '6', '跑步', NULL, '1');


ALTER table base_org add COLUMN `clinic_time` varchar (500) DEFAULT NULL COMMENT '门诊时间';
ALTER table base_org add COLUMN `transportation_mode` varchar (500) DEFAULT NULL COMMENT '交通方式';


INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_use_to1', NULL, 'copy_use_to', '1', '各种商业保险', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '复印用途');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_use_to10', NULL, 'copy_use_to', '10', '公检法调阅', NULL, '10', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '复印用途');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_use_to2', NULL, 'copy_use_to', '2', '农村合作医疗', NULL, '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '复印用途');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_use_to3', NULL, 'copy_use_to', '3', '异地医保报销', NULL, '3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '复印用途');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_use_to4', NULL, 'copy_use_to', '4', '工伤鉴定', NULL, '4', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '复印用途');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_use_to5', NULL, 'copy_use_to', '5', '继续治疗', NULL, '5', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '复印用途');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_use_to6', NULL, 'copy_use_to', '6', '诉讼理赔', NULL, '6', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '复印用途');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_use_to7', NULL, 'copy_use_to', '7', '保险公司代理', NULL, '7', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '复印用途');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_use_to8', NULL, 'copy_use_to', '8', '医疗纠纷', NULL, '8', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '复印用途');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_use_to9', NULL, 'copy_use_to', '9', '自备', NULL, '9', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '复印用途');

INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation1', NULL, 'patient_relation', '1', '本人', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation2', NULL, 'patient_relation', '2', '夫妻', NULL, '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation3', NULL, 'patient_relation', '3', '子女', NULL, '3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation4', NULL, 'patient_relation', '4', '（外）孙子女', NULL, '4', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation5', NULL, 'patient_relation', '5', '（岳）父母', NULL, '5', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation6', NULL, 'patient_relation', '6', '（外）祖父母', NULL, '6', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation7', NULL, 'patient_relation', '7', '兄弟姐妹', NULL, '7', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation8', NULL, 'patient_relation', '8', '亲属', NULL, '8', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation9', NULL, 'patient_relation', '9', '朋友', NULL, '9', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation10', NULL, 'patient_relation', '10', '同事', NULL, '10', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('patient_relation11', NULL, 'patient_relation', '11', '其他', NULL, '11', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '与就诊人关系');

INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_content_type1', NULL, 'copy_content_type', '1', '入院记录', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '病案复印内容类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_content_type2', NULL, 'copy_content_type', '2', '体温单', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '病案复印内容类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_content_type3', NULL, 'copy_content_type', '3', '医嘱单', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '病案复印内容类型');


ALTER table wlyy_prescription_expressage add COLUMN `relation_type` varchar (50) DEFAULT NULL COMMENT '关联类型 类型1 病案复印（关联病案复印申请id）';
ALTER table wlyy_prescription_expressage add COLUMN `relation_code` varchar (50) DEFAULT NULL COMMENT '关联id';
ALTER table wlyy_outpatient_expressage_log add COLUMN `relation_type` varchar (50) DEFAULT NULL COMMENT '关联类型 类型1 病案复印（关联病案复印申请id）';
ALTER table wlyy_outpatient_expressage_log add COLUMN `relation_code` varchar (50) DEFAULT NULL COMMENT '关联id';

INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_apply_status0', NULL, 'copy_apply_status', '0', '待审核', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '病案复印申请状态');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_apply_status1', NULL, 'copy_apply_status', '1', '审核通过', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '病案复印申请状态');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_apply_status2', NULL, 'copy_apply_status', '2', '审核拒绝', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '病案复印申请状态');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('copy_apply_status3', NULL, 'copy_apply_status', '3', '已取消', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '病案复印申请状态');

CREATE TABLE `wlyy_patient_health_time` (
     `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '无关主键',
     `user` varchar(50) NOT NULL COMMENT '居民标识（编码）',
     `device_sn` varchar(50) NOT NULL COMMENT '血糖仪sn码',
     `del` int(11) NOT NULL DEFAULT '1' COMMENT '是否作废，1正常，0作废',
     `fasting_start` varchar(50) NOT NULL COMMENT '早餐前开始时间',
     `fasting_end` varchar(50) NOT NULL COMMENT '早餐前截止时间',
     `after_breakfast_start` varchar(50) NOT NULL COMMENT '早餐后开始时间',
     `after_breakfast_end` varchar(50) NOT NULL COMMENT '早餐后截止时间',
     `before_lunch_start` varchar(50) NOT NULL COMMENT '午餐前开始时间',
     `before_lunch_end` varchar(50) NOT NULL COMMENT '午餐前截止时间',
     `after_lunch_start` varchar(50) NOT NULL COMMENT '午餐后开始时间',
     `after_lunch_end` varchar(50) NOT NULL COMMENT '午餐后截止时间',
     `before_dinner_start` varchar(50) NOT NULL COMMENT '晚餐前开始时间',
     `before_dinner_end` varchar(50) NOT NULL COMMENT '晚餐前截止时间',
     `after_dinner_start` varchar(50) NOT NULL COMMENT '晚餐后开始时间',
     `after_dinner_end` varchar(50) NOT NULL COMMENT '晚餐后截止时间',
     `before_sleep_start` varchar(50) NOT NULL COMMENT '睡前开始时间',
     `before_sleep_end` varchar(50) NOT NULL COMMENT '睡前截止时间',
     `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
     PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

CREATE TABLE `wlyy_patient_blood_sugger` (
      `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
      `fasting_start` varchar(50) NOT NULL COMMENT '早餐前开始时间',
      `fasting_end` varchar(50) NOT NULL COMMENT '早餐前截止时间',
      `after_breakfast_start` varchar(50) NOT NULL COMMENT '早餐后开始时间',
      `after_breakfast_end` varchar(50) NOT NULL COMMENT '早餐后截止时间',
      `before_lunch_start` varchar(50) NOT NULL COMMENT '午餐前开始时间',
      `before_lunch_end` varchar(50) NOT NULL COMMENT '午餐前截止时间',
      `after_lunch_start` varchar(50) NOT NULL COMMENT '午餐后开始时间',
      `after_lunch_end` varchar(50) NOT NULL COMMENT '午餐后截止时间',
      `before_dinner_start` varchar(50) NOT NULL COMMENT '晚餐前开始时间',
      `before_dinner_end` varchar(50) NOT NULL COMMENT '晚餐前截止时间',
      `after_dinner_start` varchar(50) NOT NULL COMMENT '晚餐后开始时间',
      `after_dinner_end` varchar(50) NOT NULL COMMENT '晚餐后截止时间',
      `before_sleep_start` varchar(50) NOT NULL COMMENT '睡前开始时间',
      `before_sleep_end` varchar(50) NOT NULL COMMENT '睡前截止时间',
      `czrq` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '添加时间',
      `del` int(1) NOT NULL DEFAULT '1' COMMENT '是否作废，1正常，0作废',
      PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9292 DEFAULT CHARSET=utf8mb4 COMMENT='血糖仪默认时间段表';

INSERT INTO `base`.`wlyy_patient_blood_sugger` (`id`, `fasting_start`, `fasting_end`, `after_breakfast_start`, `after_breakfast_end`, `before_lunch_start`, `before_lunch_end`, `after_lunch_start`, `after_lunch_end`, `before_dinner_start`, `before_dinner_end`, `after_dinner_start`, `after_dinner_end`, `before_sleep_start`, `before_sleep_end`, `czrq`, `del`) VALUES ('9291', '00:00:00', '07:59:59', '08:00:00', '09:59:59', '10:00:00', '11:59:59', '12:00:00', '13:59:59', '14:00:00', '17:59:59', '18:00:00', '19:59:59', '20:00:00', '23:59:59', '2017-05-15 13:33:00', '1');

INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('suitable_crowd1', NULL, 'suitable_crowd', '1', '医护人员', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '适用人群');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('suitable_crowd2', NULL, 'suitable_crowd', '2', '住院陪护人员', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '适用人群');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('suitable_crowd3', NULL, 'suitable_crowd', '3', '普通居民', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '适用人群');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('suitable_crowd4', NULL, 'suitable_crowd', '4', '军人', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '适用人群');

CREATE TABLE `base_medical_record_copying_apply` (
  `id` varchar(50) NOT NULL,
  `apply_no` varchar(20) DEFAULT NULL COMMENT '申请单号',
  `status` varchar(1) DEFAULT NULL COMMENT '状态0待审核 1审核通过 2审核拒绝',
  `apply_name` varchar(50) DEFAULT NULL COMMENT '申请人姓名',
  `apply_idcard` varchar(50) DEFAULT NULL COMMENT '申请人身份证',
  `apply_mobile` varchar(50) DEFAULT NULL,
  `patient_relation` varchar(50) DEFAULT NULL COMMENT '与患者关系',
  `patient_id` varchar(50) DEFAULT NULL COMMENT '患者id',
  `patient_name` varchar(50) DEFAULT NULL COMMENT '患者姓名',
  `patient_idcard` varchar(50) DEFAULT NULL COMMENT '患者身份证',
  `patient_mobile` varchar(50) DEFAULT NULL COMMENT '患者电话',
  `use_to` varchar(50) DEFAULT NULL COMMENT '复印用途',
  `apply_time` varchar(50) DEFAULT NULL COMMENT '申请时间',
  `pickup_way` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '取件方式 1自取 0快递',
  `receive_name` varchar(50) DEFAULT NULL COMMENT '快递收件人',
  `receive_mobile` varchar(50) DEFAULT NULL COMMENT '快递收件人电话',
  `check_time` varchar(50) DEFAULT NULL COMMENT '审核时间',
  `check_result` varchar(50) DEFAULT NULL COMMENT '审核结果',
  `total_num` int DEFAULT NULL COMMENT '总页数',
  `price` double(10,2) DEFAULT NULL COMMENT '总价格',
  `copying_num` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '复印份数',
  `pay_lost_time` varchar(50) DEFAULT NULL COMMENT '支付失效时间',
  `pay_status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '支付状态 0待支付 1已支付',
  `case_id` varchar(50) DEFAULT NULL COMMENT '病例id',
  `appendix1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '证件附件-患者证件头像面',
  `appendix2` varchar(255) DEFAULT NULL COMMENT '证件附件-患者证件国徽面',
  `appendix3` varchar(255) DEFAULT NULL COMMENT '证件附件-患者手持头像面',
  `appendix4` varchar(255) DEFAULT NULL COMMENT '证件附件-申请人头像面',
  `appendix5` varchar(255) DEFAULT NULL COMMENT '证件附件-申请人国徽面',
  `dept_name` varchar(50) DEFAULT NULL COMMENT '住院科室',
  `hospital_num` varchar(10) DEFAULT NULL COMMENT '住院次数',
  `outpatient_time` varchar(50) DEFAULT NULL COMMENT '出院时间',
  `hospital` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='病案复印申请表';

CREATE TABLE `base_medical_record_copying_apply_type` (
     `id` varchar(50) NOT NULL,
     `apply_id` varchar(50) DEFAULT NULL COMMENT '申请id',
     `content` varchar(50) DEFAULT NULL COMMENT '复印内容',
     `type` varchar(50) DEFAULT NULL COMMENT '复印内容类型',
     `copying_num` varchar(10) DEFAULT NULL COMMENT '复印份数',
     PRIMARY KEY (`id`),
     KEY `index` (`apply_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


CREATE TABLE `base_nat_item` (
    `id` varchar(50) NOT NULL,
    `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '医技项目名称',
    `code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '项目名称编码',
    `suitable_crowd` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '适用人群编码（逗号间隔）',
    `suitable_crowd_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '适用人群名称',
    `dept_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '开单科室编码',
    `dept_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '开单科室',
    `doctor_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '开单医生编码',
    `doctor_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '开单医生',
    `price` decimal(10,2) DEFAULT NULL COMMENT '项目金额',
    `status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '项目状态 1生效中 0失效',
    `limit_frequency` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '是否限定预约频率 1限定 0不限定',
    `time_type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '时段设置 1每天 2每周 3每月 4每年',
    `frequency` int DEFAULT NULL COMMENT '频率平次',
    `create_time` datetime DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='医技预约项目配置表';

INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('time_type1', NULL, 'time_type', '1', '每天', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '时段设置');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('time_type2', NULL, 'time_type', '2', '每周', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '时段设置');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('time_type3', NULL, 'time_type', '3', '每月', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '时段设置');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('time_type4', NULL, 'time_type', '4', '每年', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '时段设置');

ALTER table base_nat_appointment add COLUMN `merchant_order_no` varchar (50) DEFAULT NULL COMMENT '商户订单号';
ALTER table base_nat_appointment add COLUMN `invoice_serial_no` varchar (50) DEFAULT NULL COMMENT '发票流水号';



