---在要添加的数据库中按F5执行就可以添加,注意,在执行前请先备份数据库,以免造成不可意料的错误后损坏数据
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role5624939574486901996')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'门市', N'Role5624939574486901996', N'0', N'开单,查询客户订单,付款情况,摄控,件完成情况,会员资料查看', CAST(0x0000A52C00DDF126 AS DateTime), N'20141125111443713', CAST(0x0000A52C00E99722 AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role4640595258782358074')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'收银', N'Role4640595258782358074', N'0', N'订单收款,其它消费,店面支出,日报查看', CAST(0x0000A52C00E967C7 AS DateTime), N'20141125111443713', CAST(0x0000A52C00EEAF5B AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role5326381932302887603')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'调度客服', N'Role5326381932302887603', N'1', N'摄控本安排,数码安排,客服中心(流程把控,沟通助手,回访调查),短信发送(不含群发以及设置短信模板设置权限)', CAST(0x0000A52C00EEA555 AS DateTime), N'20141125111443713', CAST(0x0000A52C00FA1140 AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role5639526247055793367')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'摄影', N'Role5639526247055793367', N'1', N'查看摄控,导入原片(不含原片删除,如果要删除照片请设置专属)', CAST(0x0000A52C00F0F837 AS DateTime), N'20141125111443713', CAST(0x0000A52C00F8E011 AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role5693425949144247100')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'调色初修', N'Role5693425949144247100', N'0', N'导入初修片,查看摄控本,查看拍摄状态以及照片,查看自己工作(不含数码安排,如果需要添加专属权限)', CAST(0x0000A52C00F203B4 AS DateTime), N'20141125111443713', CAST(0x0000A52C00F8DAD9 AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role4627023413454812990')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'选片', N'Role4627023413454812990', N'0', N'选片,看设计,查看安排客户选片时间,以及查看客户拍摄状态,修片状态,', CAST(0x0000A52C00F54859 AS DateTime), N'20141125111443713', CAST(0x0000A52C00F8D653 AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role5040501071734281934')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'精修设计', N'Role5040501071734281934', N'0', N'选片导出,精修导入,精修导出,设计导入。查看数码工作安排不含安排权限,需要请设置专属权限', CAST(0x0000A52C00F5FB4D AS DateTime), N'20141125111443713', CAST(0x0000A52C00F8CB8A AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role5752237472295880333')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'刻盘/照片导出', N'Role5752237472295880333', N'1', N'光盘刻录/导出(默认包含所以刻录权限,不同请修改角色)', CAST(0x0000A52C00F798D0 AS DateTime), N'20141125111443713', CAST(0x0000A52C00F89369 AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role4832522906297557074')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'发片取件', N'Role4832522906297557074', N'0', N'件发出登记,成品回来登记,件取走登记(不含本月发片,本月冲印,需要请设置专属权限)', CAST(0x0000A52C00F87020 AS DateTime), N'20141125111443713', CAST(0x0000A52C0106FE3C AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role5397848181199747317')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'会员管理', N'Role5397848181199747317', N'1', N'默认只含会员基础操作,(不含会员设置,删除,导入导出,充值套系修改等)(需要会员全部功能请设置专属权限)', CAST(0x0000A52C00FB608B AS DateTime), N'20141125111443713', CAST(0x0000A52C0106F983 AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role5723079338361453538')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'礼服管理', N'Role5723079338361453538', N'1', N'礼服录入,礼服信息查看,礼服出租出售收款(不含删除需要请设置专属权限),摄控查看,原片,修片,设计班查看', CAST(0x0000A52C01024340 AS DateTime), N'20141125111443713', CAST(0x0000A52C0106F470 AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role5219495439957547767')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'库存管理', N'Role5219495439957547767', N'1', N'库存录入盘点,采购入库,(不含删除记录功能 需要设置专属权限)', CAST(0x0000A52C010378D6 AS DateTime), N'20141125111443713', CAST(0x0000A52C01085679 AS DateTime), N'20141125111443713')
if not EXISTS (select Rp_RoleMark from [dbo].[tb_ErpRolePermission] where Rp_RoleMark='Role5358053950841599807')
INSERT [dbo].[tb_ErpRolePermission] ( [Rp_Type], [Rp_RoleName], [Rp_RoleMark], [Rp_PermissionValue], [Rp_Description], [Rp_CreateDatetime], [Rp_CreateName], [Rp_UpdateDatetime], [Rp_UpdateName]) VALUES ( 1, N'财务', N'Role5358053950841599807', N'0', N'日,月,年财务报表查看,财务支出,员工工资业绩查看,考勤查看', CAST(0x0000A52C0106CA36 AS DateTime), N'20141125111443713', CAST(0x0000A52C0108D629 AS DateTime), N'20141125111443713')