form 表单域的动态设计-customized tab infomation 模块代码开发总结(1)
customized tab information module is one module of the product in our compay-staffadmin system.the interfaces as follows:
view interface:
regarding the view interface:we can get the main function of this module
1.this is the log for job detials added or modified and bank detials added or modified
2.the job details and the bank detials is related with employee.
edit interface:
regarding the edit interface ,we can get the main function information
1. jobdetials&bankdetials records contains effecitvedate ,seqno,action&reason,view ,edit,delete
2.it contains add ,delete,modify,select fuction.respect as addnew function,delete function ,view function,edit fuction
and all these functions are related with db opreation.so there also need db fuction.
3.the form is the buttom fo this interface.there are many fields.these fields are not just set in the jsp.these fileds are dynamic
fields.because all these fileds are setted in database table-hirs_dynamictbale_code_setup.i will discuss this table and some re-
lated tables soon.
as follows :i will discuss table design for this module.Because i think the tables design of this module is the key point which i got
during all this module develop.
now i will show the database table design printScreen:
select * from hris_dynamictable
the main columns: field_id ,field_label,lable_row,label_column,value_row,value_column,filed type.
we can use java code to set the fields location in the table by these cloumns from database table.
for instance:
one record as follows:
1 TNLOrgUnit 0Org Unit: 3 1 1 32 13 50 100 Org Unit 0 0
label:Org Unit:
location:third row ,one cloumn for label;third row ,two cloumn for value
type:3 it means this fields is select input
we achieved this follow interface.first row: Job Details
second row:Effective Date(there is star before this fileds.it means this fields can not be null)
third row:show this record(Org Unit-organization unit)
So,we see that all these fields are setted in dynamictable in database.
regarding the second row -(*)Effective Date
this star is also setted in database.there is a filed (not null) in the dynamictable.
the more important is that we just set this field ,it will validate if null before submit this form through the java code design.
we should set the values for select input.so there is another table-hris_dynamic_code_setup
select * from hirs_dynamic_code_setup
how to connect these two tables?
pay_code_type in hris_dynamictalbe=code_category in hris_dynmaictable_code_setup.we can understand these as main key and foreign key
select * from hris_dynamictable_value2(because there exist a table named hris_dynamictable_value for another client)
see the records as follows:
so we can get all these to set the section value of this select input.
then,what about the indeed value of these form fields.
see the table:hris_dynamictable_value2
(we can see all these tables contain a field comp_id.this field means company.because the dynamictable is not used for one company.in order to not to
add more table ,then set this fileds.this table can be used much fixiable)
how this table relate to dynamictable?
field_id in this table and in hris_dynamictable
and column value in this table is very important.
for instance .if we add one records to database like this
the system will add five records to the hris_dynamictable_value2
the main key is a connected primary keys effective date &seqno
the records added as follows
this five records will be one log records by effective date and seqno.
jobRecords&bankRecords
effecitve date seqno action&reason
25/10/2013 1 jobDetails
so,the log records are vertical stored in the database,every vertical record is just one cloumn value.
summarize:
i discussed the database design in the charter. The form fields of this module are gernerated by the dynamictable and related tables
hris_dynamictable_code_setup and hris_dynamictable_value2. This design contains horizotial stored and vertical stored. it is a perfect
design. and i was very lucky to had the opportunity to accepted this task. And i filished it.
i think this kind design is very useful for different customized requirement.we also dont need to modify the code for another client.we just set
the comp_id and related three tables to acheieve requirement and client changing.
ps:
I will discuss the java code in the next charter.