-- 初始化数据===============================================================================================================
INSERT INTO `shopping_goods` (`id`, `name`, `introduction`, `description`, `staus`, `seal_pice`, `reference_pice`, `img`, `seal_count`, `is_assemble`, `deleted`, `cate_id`, `jf_pice`, `jf_number`, `good_type`, `sale_off_time`, `is_present`, `is_once`, `sale_platform`, `wei_img`, `wei_description`, `validity`, `brand_id`, `car_max_sale_count`, `car_use_count`, `car_is_all`, `is_vip_car`, `vip_grad_id`, `is_integral`, `commission_rate`, `real_seal_count`, `store`, `is_bargain`, `module_id`, `is_course`, `is_distribution`, `frist_commission`, `second_commission`, `create_time`)
VALUES
	(5075, '会籍卡充值', '会籍卡充值使用,请勿修改!', '会籍卡充值使用,请勿修改!', '下架', 0, 0, 'http://127.0.0.1:8080/meidu-crm/resource/images/sgoods_defualt.jpg', 0, NULL, 'S', NULL, NULL, NULL, '充值卡', NULL, '否', '否', '线下', 'http://127.0.0.1:8080/meidu-crm/resource/images/sgoods_defualt.jpg', NULL, 0, 25, 0, 0, '是', '否', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

-- ===============================================================================================================

insert into
sys_users(

create_by,create_time,update_by,update_time,

su_id,su_name,su_tel,su_address,su_photo,su_sex,su_register_time,parent_user_id,

su_dept_id,su_user_type,su_idcard,su_job_no,company_id,su_account_status,

su_valid,su_birthday,shop_id,degree,work_exp,entry_date,wx_no,en_name
)

select

'系统管理员',now(), '系统管理员',now(),

id,	STAFF_NAME,RELAX_WAY,ADDR_HOME,photo,SEX,now(),PAR_DIRECT_ID,

DEPART_ID,'employee',CRED_NO,STAFF_NO,17,'activate',

'Y',BIRTHDAY,SHOP_ID,DEGREE,WORK_EXP,ENTRY_DATE,WX_NO,EN_NAME

 from sys_shopstaff_info




-- 未执行
ALTER TABLE `sys_role` ADD COLUMN `is_default`  int(1) NULL COMMENT '是否默认' AFTER `plates`;
ALTER TABLE `sys_beautician_state`
ADD COLUMN `puse_id`  bigint NULL COMMENT '项目使用情况id' AFTER `extract`;
alter table sys_shop_info
	add company_id bigint null comment '公司id';

ALTER TABLE `sys_beautician_state`
CHANGE COLUMN `proj_use_id` `puse_id`  bigint(20) NULL DEFAULT NULL COMMENT '项目使用情况id' AFTER `extract`,
ADD COLUMN `count`  int NULL COMMENT '项目次数' AFTER `puse_id`;
ALTER TABLE `sys_beautician_state`
DROP COLUMN `ACL_BEGIN_TIME`,
DROP COLUMN `ACL_END_TIME`;
ALTER TABLE `sys_beautician_state`
ADD COLUMN `proj_id`  bigint NULL COMMENT '项目的id' AFTER `count`;
ALTER TABLE `sys_beautician_state`
ADD COLUMN `proj_id`  bigint NULL COMMENT '项目id' AFTER `count`;
ALTER TABLE `zq_erp`.`sys_proj_services` DROP COLUMN `PROJ_USE_ID`;

ALTER TABLE `sys_beautician_state`
DROP COLUMN `STAFF_COMMENT`;



/**
 * 经营数据
 * @author
 * @date 2020-02-08 10:18
 */
CREATE TABLE sys_business_data
(
    create_by   varchar(100) NOT NULL COMMENT '创建人',
    create_time datetime     NOT NULL COMMENT '创建时间',
    update_by   varchar(100) NOT NULL COMMENT '更新人',
    update_time datetime     NOT NULL COMMENT '更新时间',
    id          int          NOT NULL AUTO_INCREMENT COMMENT '主键',

    time        date COMMENT '日期',

    company_id  int COMMENT '公司',

    shop_id     int COMMENT '门店',

    name        varchar(50) COMMENT '字段名称',

    value       varchar(1000) COMMENT '值',

    code        varchar(50) COMMENT '唯一编码',

    sequence       int COMMENT '排序角标',

    data_type   int COMMENT '数据类型',

    t1          varchar(50) COMMENT '扩展字段1',

    t2          varchar(50) COMMENT '扩展字段2',

    t3          varchar(50) COMMENT '扩展字段3',

    t4          varchar(50) COMMENT '扩展字段4',

    t5          varchar(50) COMMENT '扩展字段5',

    t6          varchar(50) COMMENT '扩展字段6',

    t7          varchar(50) COMMENT '扩展字段7',

    t8          varchar(50) COMMENT '扩展字段8',

    t9          varchar(50) COMMENT '扩展字段9',

    t10         varchar(50) COMMENT '扩展字段10',

    t11         varchar(50) COMMENT '扩展字段11',

    t12         varchar(50) COMMENT '扩展字段12',

    t13         varchar(50) COMMENT '扩展字段13',

    t14         varchar(50) COMMENT '扩展字段14',

    t15         varchar(50) COMMENT '扩展字段15',

    PRIMARY KEY (id)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8 COMMENT ='经营数据';


alter table sys_proj_services
	add consume_time datetime null comment '划扣时间';

alter table sys_order
	add pay_time datetime null comment '收款时间';




insert into
    sys_users(

    create_by,create_time,update_by,update_time,

    su_id,su_name,su_tel,su_address,su_photo,su_sex,su_register_time,parent_user_id,

    su_dept_id,su_user_type,su_idcard,su_job_no,company_id,su_account_status,

    su_valid,su_birthday,shop_id,degree,work_exp,entry_date,wx_no,en_name
)

select

    '系统管理员',now(), '系统管理员',now(),

    id,	STAFF_NAME,RELAX_WAY,ADDR_HOME,photo,SEX,now(),PAR_DIRECT_ID,

    DEPART_ID,'employee',CRED_NO,STAFF_NO,17,'activate',

    'Y',BIRTHDAY,SHOP_ID,DEGREE,WORK_EXP,ENTRY_DATE,WX_NO,EN_NAME

from sys_shopstaff_info
