-- 更新HIS支付方式字典表，适配你的四种支付方式

-- 1. 更新现有的PAY_TYPE字典值，确保与汇总统计逻辑匹配

-- 现金支付保持为5
UPDATE `dicinfo` SET `dicvalue` = '4' WHERE `diccode` = 'f0230cea94134322982d45544255ee8f' AND `parent_code` = 'PAY_TYPE';

-- 微信支付改为1（扫码支付）
UPDATE `dicinfo` SET `dicname` = '微信支付', `dicvalue` = '1' WHERE `diccode` = '48c8044ee33649bcaf64181b570c1c75' AND `parent_code` = 'PAY_TYPE';

-- 银行卡支付保持为1，但改名为扫码支付
UPDATE `dicinfo` SET `dicname` = '扫码支付', `dicvalue` = '1' WHERE `diccode` = 'a6ef5f470ae744a4ae1571825ddb8ca5' AND `parent_code` = 'PAY_TYPE';

-- 2. 新增聚合支付和军保支付
INSERT INTO `dicinfo` VALUES ('juhezf001', '聚合支付', '1', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 6);
INSERT INTO `dicinfo` VALUES ('junbao001', '军保支付', '3', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 7);

-- 3. 确保字典表结构正确
-- 最终PAY_TYPE字典应该是：
-- 扫码支付(包含微信、聚合) -> 1  
-- 银行卡支付 -> 2
-- 军保支付 -> 3  
-- 现金支付 -> 4
-- 其他 -> 5

-- 如果需要重新整理，可以删除旧数据重新插入：
/*
DELETE FROM `dicinfo` WHERE `parent_code` = 'PAY_TYPE' AND `diccode` != 'PAY_TYPE';

INSERT INTO `dicinfo` VALUES ('pay_type_001', '扫码支付', '1', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 1);
INSERT INTO `dicinfo` VALUES ('pay_type_002', '银行卡支付', '2', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 2);
INSERT INTO `dicinfo` VALUES ('pay_type_003', '军保支付', '3', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 3);
INSERT INTO `dicinfo` VALUES ('pay_type_004', '现金支付', '4', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 4);
INSERT INTO `dicinfo` VALUES ('pay_type_005', '其他', '5', 'PAY_TYPE', '2024-01-01 00:00:00', '2024-01-01 00:00:00', 5);
*/

