


ALTER TABLE `sys_user` ADD `province_code` varchar(11) DEFAULT NULL  COMMENT '省份编码';
ALTER TABLE `sys_user` ADD `city_code` varchar(11) DEFAULT NULL  COMMENT '城市编码';


ALTER TABLE `wm_da_agent` ADD `pgqx` varchar(11) DEFAULT NULL  COMMENT '派工权限';
ALTER TABLE `wm_da_agent` ADD `qylx` varchar(11) DEFAULT NULL  COMMENT '企业类型';

update wm_da_agent set  pgqx = 1;
update wm_da_agent set  qylx = 0;

ALTER TABLE `wm_task_content` ADD `temp31` varchar(255) DEFAULT NULL  COMMENT 'temp31';
ALTER TABLE `wm_task_content` ADD `temp32` varchar(255) DEFAULT NULL  COMMENT 'temp32';


ALTER TABLE `wm_task` ADD `task_from` varchar(2) DEFAULT '1'  COMMENT '来源';

ALTER TABLE `wm_score_package_settle_note` ADD `remark` varchar(256) DEFAULT NULL  COMMENT '结算描述';

update wm_task set task_from = '1';

update wm_score_package set package_user_scope = '1'

update wm_score_package set package_type2 = '1';
update wm_score_package set package_type1 = '1';

update wm_score_package set task_add_flag = '0' where package_finish_status = '1';
update wm_score_package_status s set s.task_add_flag = (
select task_add_flag from wm_score_package p where p.id  = s.package_id );

update wm_score_package set related_service =  send_package_dept_id  where typeid = 1
update wm_score_package set accept_sug =  drug_ent_id  where typeid = 1 and send_package_dept_id = dept_id
update wm_score_package set accept_sug =  level1_id  where typeid = 1 and send_package_dept_id != dept_id
update wm_score_package set typeid =  0  where typeid = 1 and send_package_dept_id = dept_id


INSERT into wm_score_package_status  (user_id,package_id ,status,dept_id,create_time)
select xxdb_id , id ,2,dept_id ,create_time from wm_score_package where typeid = 3

-- 更新药品生产企业
ALTER TABLE `wm_da_drug_ent_drugtable` ADD `drug_ent_name` varchar(255) DEFAULT NULL  COMMENT '所属药企名称';
ALTER TABLE `wm_da_drug_ent_drugtable` ADD `drug_ent_num` int(11) DEFAULT NULL  COMMENT '分配统计';
UPDATE wm_da_drug_ent_drugtable e set drug_ent_name = (select entname from  wm_da_drug_ent t where  e.drug_ent_id = t.id)
