ERP数据库设计说明书项目代号:CX-2010-04-XXXXXXXXX技术有限公司2011-04-28目录1、数据库设计...................................错误!未定义书签。1.1、命名规则...............................................31.2、共用表...............................................101.3、基础数据...............................................31.4、库存子系统............................................131.5、销售子系统............................................201.6、采购子系统............................................341、命名规则见数据库表名与字段名命名规范2、基础数据见erp项目数据库脚本.sql文件2.1、物料类别Materieltype(设计人:XXX)字段名类型是否为空主键外键默认值中文说明matypeidVarchar2(50)noyes物料类别编号matypenameVarchar2(50)no物料类别名称matypeengnameVarchar2(50)yes英文名称matyperemarkVarchar2(2000)yes备注safetyonevarchar2(50)yesNoNoNo保留字段safetytwovarchar2(50)yesNoNoNo保留字段enablesnumber默认1不删除,0:删除标识是否删除【表说明】【主键说明】【外键说明】【索引说明】【字段补充说明】2.2、仓库表Storage(设计人:XXX)字段名类型是否为主外键默认值中文说明【表说明】【主键说明】【外键说明】【索引说明】【字段补充说明】2.3、物料主文件Materiel(设计人:XXX)字段名类型是否为空主键外键默认值中文说明matidVarchar2(50)noyes物料编号matnameVarchar2(50)no物料名称matspecVarchar2(50)yes规格型号mattypeidVarchar2(20)no物料类别(伪外键)mattypenameVarchar2(50)no物料类别名称matadvicepricenumber(19,4)no建议售价matadvicepriceAnumber(19,4)yes售价AmatadvicepriceBnumber(19,4)Yes售价BmatadvicepriceCnumber(19,4)Yes售价CmatadvicepriceDnumber(19,4)Yes售价DmatadvicepriceEnumber(19,4)Yes售价Ematstandardpricenumber(19,4)no标准进价matshapeVarchar(50)no成品物料型态matifdutyNumber(9)No0:否是否含税matdutyratenumber(19,4)No0.17税率空键stoidVarchar2(50)noyes仓库编号stonameVarchar2(50)no仓库名称stosimplenameVarchar2(50)yes仓库简称stoconnectperVarchar2(50)yes联系人stoempidVarchar2(50)yes联系人ID(新增)stophoneVarchar2(50)yes联系电话stoaddressVarchar2(50)yes仓库地址storemarkVarchar2(2000)yes备注safetyonevarchar2(50)yesNoNoNo保留字段safetytwovarchar2(50)yesNoNoNo保留字段enablesnumber默认1不删除,0:删除标识是否删除matstockaheaddatenumber(9)no0采购提前期matmainaffordVarchar2(50)yes主供应商matmainaffordidVarchar2(50)yes主供应商IDmatgawpdatenumber(9)yes30呆滞起计天数matstopdatedateyes停用日期matremarkVarchar2(2000)yes备注matunitVarchar2(50)yes计量单位safetyonevarchar2(50)yesNoNoNo保留字段safetytwovarchar2(50)yesNoNoNo保留字段EnableNumber(9)NoNoNoNo标识是否删除【表说明】【主键说明】【外键说明】【索引说明】【字段补充说明】2.4、客户主文件client(设计人:XXX)字段名类型是否为空主键外键默认值中文说明cliidVarchar2(50)NY客户编号clitypeidVarchar2(50)客户类别IdclinameVarchar2(50)N客户全称clishortnameVarchar2(50)客户简称cliaddressVarchar2(50)地方(具体)cliareaVarchar2(50)地区clienameVarchar2(50)英文全称clieshortnameVarchar2(50)英文简称基本资料cliprincipalVarchar2(50)负责人clilinkmanVarchar2(50)联系人cliphoneoneVarchar2(50)联系电话一cliphonetwoVarchar2(50)联系电话二cliphonethreeVarchar2(50)联系电话三clibankaccountsVarchar2(50)银行帐号cliopenbankVarchar2(50)开户银行empidVarchar2(50)N业务人员idclimobilephoneVarchar2(50)移动电话cliemailVarchar2(50)电子邮件cliwebVarchar2(50)网址clifaxesVarchar2(50)传真号码销售信息clioldoutdatedate最初销售出货日clioldintodatedate最初销售退货日clinewoutdatedate最近销售出货日clinewintodatedate最近销售退货日clidiscountVarchar2(50)折数(%)clipricestepVarchar2(50)售价等级clicreatedatedate客户建立日clistopdatedate终止交易日收款信息clizhangkuaneduVarchar2(50)账款额度cliremaineduVarchar2(50)剩余额度cliconditionVarchar2(50)收款条件(天)climonthreckoningdate每月结账日clicreditstepVarchar2(50)信用等级cliqcpremoneynumber(19,4)期初预收款cliqcdealmoneynumber(19,4)期初应收款cliqmpremoneynumber(19,4)期末预收款cliqmdealmoneynumber(19,4)期末应收款其它cliotherremarkVarchar2(2000)备注clitrashNumber(4,0)是否废码safetyonevarchar2(50)保留字段safetytwovarchar2(50)保留字段enablesnumber默认1不删除,0:删除标识是否删除【表说明】【主键说明】【外键说明】【索引说明】【字段补充说明】2.5、客户类别表clienttype(设计人:XXX)字段名类型是否为空主键外键默认值中文说明clitypeidVarchar2(50)NN类别编号clitypenameVarchar2(50)N类别名称clitypeenameVarchar2(50)N英文名称cliremarkVarchar2(500)Y备注clitypetrashNumber(4,0)0是否废码safetyonevarchar2(50)yes保留字段safetytwovarchar2(50)yes保留字段EnableNumber(9)No标识是否删除【表说明】【主键说明】【外键说明】【索引说明】【字段补充说明】2.6、人员表employee(设计人:XXX)字段名类型是否为空主键外键默认值中文说明empidVarchar2(50)NY人员编号empnameVarchar2(50)N人员姓名empenameVarchar2(50)英文姓名depidVarchar2(50)N部门编号idempsexVarchar2(50)N性别(默认男)empcardVarchar2(50)N身份证号基本资料empstateVarchar2(50)N就职状态idempdutyVarchar2(50)职务(改字段名)empphoneoneVarchar2(50)联系电话一empphonetwoVarchar2(50)联系电话二empphonethreeVarchar2(50)联系电话三empbankaccountsVarchar2(50)银行账号empbirthdayDate出生日期(修改数据类型)empjobVarchar2(50)岗位EmpemailVarchar2(50)电子邮件(一个邮箱)empwebVarchar2(50)网址empfaxesVarchar2(50)传真号码empopenbankVarchar2(50)开户银行其它信息emptopVarchar2(50)最高学历empdegreeVarchar2(50)学位empgotimedate到期日期empgraduatetimeVarchar2(50)毕业学校emppactstarttimedate合同起始日期emppactendtimedate合同终止日期通讯资料empnowmailidVarchar2(50)现邮编empfamilyphoneVarchar2(50)家庭电话empfamilyplaceVarchar2(50)家庭住址empnowphoneVarchar2(50)现电话empnowplaceVarchar2(50)现住址empexigencemanVarchar2(50)紧急联系人empfamilymailidVarchar2(50)家庭邮编其它empremarkvarchar2(2000)备注emptrashNumber(4,0)0是否废码safetyonevarchar2(50)保留字段safetytwovarchar2(50)保留字段enablesnumber默认1不删除,0:删除标识是否删除【表说明】【主键说明】【外键说明】【索引说明】【字段补充说明】2.7、供应商类型表providetype(设计人:XXX)字段名类型空否主键外键默认值中文说明peeidVarchar2(50)NY类别编号peenameVarhcar2(50)N类别名称peeEnameVarchar2(50)N类别英文名称peeremarkVarchar2(2000)Y备注peetrashNumber(4,0)0是否废码safetyonevarchar2(50)保留字段safetytwovarchar2(50)保留字段enablesnumber默认1不删除,0:删除标识是否删除【表说明】【主键说明】【外键说明】【索引说明】【字段补充说明】2.8、供应商主文件表provideInfo(设计人:XXX)字段名类型空否主键外键默认值中文说明peoidVarchar2(50)NY供应商编号peonameVarchar2(50)N供应商全称peoshortnameVarchar2(50)供应商简称peoascriptionVarchar2(