关键在与创建一个工资项目字典表,每条记录包括项目名称,字段名称,是否是录入项目,是否是修改项目等等
我们就是这样做的。
附上主要表的脚本,可以参考(老板要是知道了,非吃了我呀)
--工资基本数据
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBGZJBSJ]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TBGZJBSJ]
GO
--计算公式
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBGZJSGS]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TBGZJSGS]
GO
--修改记录
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBGZXGJL]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TBGZXGJL]
GO
--工资项目模板
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBGZXMMB]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TBGZXMMB]
GO
--工资项目字典
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBGZZDXM]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TBGZZDXM]
GO
CREATE TABLE [dbo].[TBGZJBSJ] (
[CTZBH] [char] (2) COLLATE Chinese_PRC_CI_AS NULL ,
[CBH] [varchar] (6) COLLATE Chinese_PRC_CI_AS NULL ,
[CGZH] [varchar] (12) COLLATE Chinese_PRC_CI_AS NULL ,
[CLB] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[CDFYH] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[CZT] [char] (4) COLLATE Chinese_PRC_CI_AS NULL ,
[DGZRQ] [char] (8) COLLATE Chinese_PRC_CI_AS NULL ,
[MXM1] [money] NULL ,
[MXM2] [money] NULL ,
[MXM3] [money] NULL ,
[MXM4] [money] NULL ,
[MXM5] [money] NULL ,
[MXM6] [money] NULL ,
[MXM7] [money] NULL ,
[MXM8] [money] NULL ,
[MXM9] [money] NULL ,
[MXM10] [money] NULL ,
[MXM11] [money] NULL ,
[MXM12] [money] NULL ,
[MXM13] [money] NULL ,
[MXM14] [money] NULL ,
[MXM15] [money] NULL ,
[MXM16] [money] NULL ,
[MXM17] [money] NULL ,
[MXM18] [money] NULL ,
[MXM19] [money] NULL ,
[MXM20] [money] NULL ,
[MXM21] [money] NULL ,
[MXM22] [money] NULL ,
[MXM23] [money] NULL ,
[MXM24] [money] NULL ,
[MXM25] [money] NULL ,
[MXM26] [money] NULL ,
[MXM27] [money] NULL ,
[MXM28] [money] NULL ,
[MXM29] [money] NULL ,
[MXM30] [money] NULL ,
[MXM31] [money] NULL ,
[MXM32] [money] NULL ,
[MXM33] [money] NULL ,
[MXM34] [money] NULL ,
[MXM35] [money] NULL ,
[MXM36] [money] NULL ,
[MXM37] [money] NULL ,
[MXM38] [money] NULL ,
[MXM39] [money] NULL ,
[MXM40] [money] NULL ,
[CCZY] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[CBZ] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[IBM] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[CBM] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[CXM] [varchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
[CPYM] [varchar] (8) COLLATE Chinese_PRC_CI_AS NULL ,
[CCZH] [varchar] (12) COLLATE Chinese_PRC_CI_AS NULL ,
[CCXKH] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[TBGZJSGS] (
[CTZBH] [char] (2) COLLATE Chinese_PRC_CI_AS NULL ,
[CJSXM] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[CJSGS] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
[CJSTJ] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
[CJSXMC] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[CJSGSC] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
[CJSTJC] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
[IBH] [int] NOT NULL ,
[IGSXH] [int] NULL ,
[IENABLE] [bit] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[TBGZXGJL] (
[CTZBH] [char] (2) COLLATE Chinese_PRC_CI_AS NULL ,
[CBH] [varchar] (6) COLLATE Chinese_PRC_CI_AS NULL ,
[CXM] [varchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
[CGZRQ] [char] (8) COLLATE Chinese_PRC_CI_AS NULL ,
[DSJ] [datetime] NULL ,
[CXMMC] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[CXGQ] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[CXGH] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[CXGYY] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[CCZY] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[TBGZXMMB] (
[IXH] [int] NULL ,
[CTZBH] [char] (2) COLLATE Chinese_PRC_CI_AS NULL ,
[CXM] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[CXMMC] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[BJZQL] [bit] NULL ,
[RMIN] [real] NULL ,
[RMAX] [real] NULL ,
[IXSWS] [int] NULL ,
[ITJXM] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[CTJXM] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[ILRXMXZ] [int] NULL ,//是否是录入项目
[IBDXGXZ] [int] NULL ,//等等
[IGDXGXZ] [int] NULL ,
[ICXXMXZ] [int] NULL ,
[IGZBTDXZ] [int] NULL ,
[ISHXZ] [int] NULL ,
[ITJHZXZ] [int] NULL ,
[IRBBFXZ] [int] NULL ,
[IZJJSBDXZ] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[TBGZZDXM] (
[IXH] [int] NULL ,
[CTZBH] [char] (2) COLLATE Chinese_PRC_CI_AS NULL ,
[CXM] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[CXMMC] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[BJZQL] [bit] NULL ,
[RMIN] [real] NULL ,
[RMAX] [real] NULL ,
[IXSWS] [int] NULL ,
[ITJXM] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[CTJXM] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[ILRXMXZ] [int] NULL , //是否是录入项目
[IBDXGXZ] [int] NULL , //等等
[IGDXGXZ] [int] NULL ,
[ICXXMXZ] [int] NULL ,
[IGZBTDXZ] [int] NULL ,
[ISHXZ] [int] NULL ,
[ITJHZXZ] [int] NULL ,
[IRBBFXZ] [int] NULL ,
[IZJJSBDXZ] [int] NULL
) ON [PRIMARY]
GO