suplus_salary_test_tables_view.sql
4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
-- == 表【cfg_salary_group】建视图语句 ==
-- drop view view_cfg_salary_group;
DROP VIEW IF EXISTS cfg_salary_group;
create view view_cfg_salary_group as select id,name,period_month,salary_type,company_id,create_time,enabled,count,period_day from cfg_salary_group;
-- pk
-- jsonb
-- == 表【cfg_subject】建视图语句 ==
-- drop view view_cfg_subject;
DROP VIEW IF EXISTS cfg_subject;
create view view_cfg_subject as select id,name,parent_id,type,key_value,value_Type,company_id,update_time,create_time,enabled,description,pay_time from cfg_subject;
-- pk
-- jsonb
-- == 表【role_income_rule】建视图语句 ==
-- drop view view_role_income_rule;
DROP VIEW IF EXISTS role_income_rule;
create view view_role_income_rule as select id,role_id,push_rate,type,company_id,update_time,create_time,enabled,pushMoneyType,min_range,max_range from role_income_rule;
-- pk
-- jsonb
-- == 表【salary_group_income_rule】建视图语句 ==
-- drop view view_salary_group_income_rule;
DROP VIEW IF EXISTS salary_group_income_rule;
create view view_salary_group_income_rule as select id,salary_group_id,push_rate,rate_type,type,child_type,company_id,update_time,create_time,enabled,ranges,year,effect_type from salary_group_income_rule;
-- pk
-- jsonb
-- == 表【salary_group_rule】建视图语句 ==
-- drop view view_salary_group_rule;
DROP VIEW IF EXISTS salary_group_rule;
create view view_salary_group_rule as select id,subject_id,weight,company_id,create_time,enabled,salary_group_id from salary_group_rule;
-- pk
-- jsonb
-- == 表【salary_group_user】建视图语句 ==
-- drop view view_salary_group_user;
DROP VIEW IF EXISTS salary_group_user;
create view view_salary_group_user as select id,uid,salary_group_id,company_id,create_time,enabled,department_id from salary_group_user;
-- pk
-- jsonb
-- == 表【salary_month】建视图语句 ==
-- drop view view_salary_month;
DROP VIEW IF EXISTS salary_month;
create view view_salary_month as select id,uid,basic_wage,kpi_bonus,basic_bonus,increment_push_money,profit_push_money,other_bonus,profession_subsidy,new_rake,windfall,total,extra_text,option_uid,company_id,create_time,update_time,enabled,salary_group_id,year,month,annual_increment,real_increment,excellent_increment,pre_total,normal_increment,chance_increment,normal_profit,chance_profit,annual_profit,history,adjustment,system_subject from salary_month;
-- pk
-- jsonb
-- == 表【salary_month_history】建视图语句 ==
-- drop view view_salary_month_history;
DROP VIEW IF EXISTS salary_month_history;
create view view_salary_month_history as select id,uid,basic_wage,kpi_bonus,basic_bonus,increment_push_money,profit_push_money,other_bonus,profession_subsidy,new_rake,windfall,total,extra_text,option_uid,company_id,create_time,update_time,enabled,salary_group_id,year,month,annual_increment,real_increment,normal_increment,chance_increment,excellent_increment,pre_total,normal_profit,chance_profit,annual_profit from salary_month_history;
-- pk
-- jsonb
-- == 表【salary_record】建视图语句 ==
-- drop view view_salary_record;
DROP VIEW IF EXISTS salary_record;
create view view_salary_record as select id,uid,basic_wage,kpi_bonus,basic_bonus,increment_push_money,profit_push_money,other_bonus,profession_subsidy,new_rake,windfall,company_id,create_time,update_time,enabled,extra_text,option_uid,excellent_increment,annual_increment from salary_record;
-- pk
-- jsonb
-- == 表【salary_record_history】建视图语句 ==
-- drop view view_salary_record_history;
DROP VIEW IF EXISTS salary_record_history;
create view view_salary_record_history as select id,uid,basic_wage,kpi_bonus,basic_bonus,increment_push_money,profit_push_money,other_bonus,profession_subsidy,new_rake,windfall,company_id,create_time,enabled,extra_text,option_uid,excellent_increment,annual_increment from salary_record_history;
-- pk
-- jsonb
-- == 表【subject_pay_time】建视图语句 ==
-- drop view view_subject_pay_time;
DROP VIEW IF EXISTS subject_pay_time;
create view view_subject_pay_time as select id,subject_id,pay_time,company_id,create_time,enabled from subject_pay_time;
-- pk
-- jsonb
-- == 表【subject_state】建视图语句 ==
-- drop view view_subject_state;
DROP VIEW IF EXISTS subject_state;
create view view_subject_state as select id,subject_id,type,company_id,create_time,enabled from subject_state;
-- pk
-- jsonb
-- == 表【view_subject_state】建视图语句 ==
-- drop view view_view_subject_state;
DROP VIEW IF EXISTS view_subject_state;
create view view_view_subject_state as select id,type,company_id from view_subject_state;
-- pk
-- jsonb