当前位置: 首页 > 编程日记 > 正文

存储过程4-前台

ExpandedBlockStart.gif代码
ALTER proc [dbo].[P_CheckCode]
(
@ret int output,
@nId int,
@tag nvarchar(50),
@cCode nvarchar(50),
@nHotelId int
)
as
begin
    
if Upper(@tag)='B_AREA'
    
begin
        
if exists(select 1 from B_Area where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end
else if Upper(@tag)='B_Address'
    
begin
        
if exists(select 1 from B_Address where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_Authorizer'
    
begin
        
if exists(select 1 from B_Authorizer where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_Certificate'
    
begin
        
if exists(select 1 from B_Certificate where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

    
else if Upper(@tag)='B_City'
    
begin
        
if exists(select 1 from B_City where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

    
else if Upper(@tag)='B_Consume'
    
begin
        
if exists(select 1 from B_Consume where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


    
else if Upper(@tag)='B_ConsumeKind'
    
begin
        
if exists(select 1 from B_ConsumeKind where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


    
else if Upper(@tag)='B_Country'
    
begin
        
if exists(select 1 from B_Country where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

    
else if Upper(@tag)='B_Direction'
    
begin
        
if exists(select 1 from B_Direction where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_Floor'
    
begin
        
if exists(select 1 from B_Floor where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_GuestKind'
    
begin
        
if exists(select 1 from B_GuestKind where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_HabitKind'
    
begin
        
if exists(select 1 from B_HabitKind where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_JobKind'
    
begin
        
if exists(select 1 from B_JobKind where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_LimitNet'
    
begin
        
if exists(select 1 from B_LimitNet where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end
    

else if Upper(@tag)='B_LimitPhone'
    
begin
        
if exists(select 1 from B_LimitPhone where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_LimitVod'
    
begin
        
if exists(select 1 from B_LimitVod where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_MtRoom'
    
begin
        
if exists(select 1 from B_MtRoom where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_MtRoomKind'
    
begin
        
if exists(select 1 from B_MtRoomKind where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_Package'
    
begin
        
if exists(select 1 from B_Package where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_PayType'
    
begin
        
if exists(select 1 from B_PayType where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_Province'
    
begin
        
if exists(select 1 from B_Province where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_Property'
    
begin
        
if exists(select 1 from B_Property where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_Remark'
    
begin
        
if exists(select 1 from B_Remark where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_RentKind'
    
begin
        
if exists(select 1 from B_RentKind where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_ReserveSource'
    
begin
        
if exists(select 1 from B_ReserveSource where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_ReserveSourceType'
    
begin
        
if exists(select 1 from B_ReserveSourceType where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_Role'
    
begin
        
if exists(select 1 from B_Role where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_Room'
    
begin
        
if exists(select 1 from B_Room where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_RoomKind'
    
begin
        
if exists(select 1 from B_RoomKind where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_Salesman'
    
begin
        
if exists(select 1 from B_Salesman where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_SellPeriod'
    
begin
        
if exists(select 1 from B_SellPeriod where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_Service'
    
begin
        
if exists(select 1 from B_Service where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_ServiceKind'
    
begin
        
if exists(select 1 from B_ServiceKind where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_Town'
    
begin
        
if exists(select 1 from B_Town where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_Traffic'
    
begin
        
if exists(select 1 from B_Traffic where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_TransferCode'
    
begin
        
if exists(select 1 from B_TransferCode where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_Unit'
    
begin
        
if exists(select 1 from B_Unit where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='B_User'
    
begin
        
if exists(select 1 from B_User where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end


else if Upper(@tag)='B_WelcomeMsg'
    
begin
        
if exists(select 1 from B_WelcomeMsg where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end

else if Upper(@tag)='A_RoomState'
    
begin
        
if exists(select 1 from A_RoomState where cCode=@cCode and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end
else if Upper(@tag)='B_MarkCode'
    
begin
        
if exists(select 1 from B_MarkCode where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end
else if Upper(@tag)='C_VirtualGuest'
    
begin
        
if exists(select 1 from C_VirtualGuest where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end
else if Upper(@tag)='B_CompanyKind'
    
begin
        
if exists(select 1 from B_CompanyKind where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end
else if Upper(@tag)='B_FinanceKind'
    
begin
        
if exists(select 1 from B_FinanceKind where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end
else if Upper(@tag)='B_Department'
    
begin
        
if exists(select 1 from B_Department where cCode=@cCode and nHotelId=@nHotelId and nId<>@nId)
            
set @ret=1
        
else
            
set @ret=-1
    
end
end

ExpandedBlockStart.gif代码
ALTER proc [dbo].[P_GetAccountCtrlList]
/*********************************************
**FN:获取外部系统转账控制列表
**TIME:
*************************************************
*/
(
    
@ret int=-1 output,
    
@nHotelId int,
    
@nParentId int,
    
@tag int
)
as 
begin
    
if @tag=1    --bill
    begin
        
select A.nId,A.nConsumeKindId,nParentId=A.nBillId,bIsControl,cConsumeKindName = B.cName
        
from C_BillAccountControl A
        
left join B_ConsumeKind B on B.nId=A.nConsumeKindId
        
where A.nBillId=@nParentId and A.nHotelId =@nHotelId

        
set @ret=1
    
end
    
else if @tag=2  --guest
    begin
        
select A.nId,A.nConsumeKindId,nParentId=A.nGuestId,bIsControl,cConsumeKindName = B.cName
        
from C_GuestAccountControl A
        
left join B_ConsumeKind B on B.nId=A.nConsumeKindId
        
where A.nGuestId=@nParentId and A.nHotelId =@nHotelId

        
set @ret=1
    
end
end


转载于:https://www.cnblogs.com/callbin/archive/2009/12/29/1634933.html

相关文章:

安卓学习-其他-文件读写

在android中的文件放在不同位置&#xff0c;它们的读取方式也有一些不同。 本文对android中对资源文件的读取、数据区文件的读取、SD卡文件的读取及RandomAccessFile的方式和方法进行了整理。供参考。 一、资源文件的读取&#xff1a; 1) 从resource的raw中读取文件数据&#x…

X5同层播放器应用实践

移动端浏览器中的video元素是比较特别的&#xff0c;早期无论是在iOS还是Android的浏览器中&#xff0c;它都位于页面的最顶层&#xff0c;无法被遮挡。后来&#xff0c;这个问题在iOS下得到了解决。但是对Android的大部分浏览器来说&#xff0c;问题仍然存在。X5是腾讯基于Web…

1007 Maximum Subsequence Sum(两种思路)

1.解法1 思路 对于动态规划来说&#xff0c;最关键的就是找到状态转移方程&#xff0c;本题设置一个前向数组&#xff0c;元素predp[i]表示的是以元素i结尾的连续数列和的最大值&#xff0c;转移方程是predp[i] max(predp[i-1]a[i],a[i])。要做的事就是完成这个dp数组&#x…

C#学习-EF在三层中使用

1.搭建普通三层 DAL层&#xff0c;BLL层&#xff0c;Model层&#xff0c;Web层&#xff1b; DAL层引用Model层 BLL层引用DAL层和Model层 Web层引用BLL层和Model层 2.实现EF三层的搭建&#xff08;添加引用&#xff0c;修改配置信息&#xff09; 2.1添加EF对象 在Model中添加一个…

各大IT公司笔试真题汇总开发人员一定要加入收藏夹的网站(收藏)

巨人网络java笔试基础题分享 http://www.coderarea.net/bbs/read.php?tid834 百度笔试题 http://www.coderarea.net/bbs/read.php?tid811 百度2010校招运维部门笔试 http://www.coderarea.net/bbs/read.php?tid779 百度2010年校园招聘软件测试笔试题 http://www.coderarea.n…

Python编写Hive UDF

2019独角兽企业重金招聘Python工程师标准>>> 1. 目的 从string类型的字段中解析并汇总每种category类型的总amount 2. 素材 表名&#xff1a;test_table order_no hotel_seq discount_detail D8662EF4E 10212527 NULL 45C024849 …

1045 Favorite Color Stripe(LIS解法)

解题思路 本题属于Longest Increasing Sequence最长不下降子序列&#xff0c;但是要注意&#xff0c;LIS当中不会有无效的元素&#xff0c;而本题是有的&#xff0c;所以先要把无效元素过滤掉&#xff0c;才能转化成为LIS问题。 这里用到了hashTable(用map更慢)&#xff0c;初…

5.8fork父子进程

实验4-2&#xff1a;fork父子进程 实验目的&#xff1a; 理解fork创建子进程的本质 实验要求&#xff1a; 1、按如下要求编写程序: &#xff08;1&#xff09;、打开一个有内容的文件; &#xff08;2&#xff09;、调用fork创建子进程; &#xff08;3&#xff09;、读文件…

word表格自动编号

选中全部内容--右键--项目符号和编号--自定义--编号样式--选01,02样式.则生成所有编号选中第二批编号,--重新编号,就又从01开始了转载于:https://www.cnblogs.com/wzshhynk/archive/2009/12/30/1635805.html

Vue API(directives) 自定义指令

前言&#xff1a;除了vue的内置指令以外&#xff0c;我们可以定义自定义指令。内置指令表相见&#xff1a;https://www.cnblogs.com/ilovexiaoming/p/6840383.html 我们定义一个最简单的 <script> export default {name: App,data(){return{yanse:red}},// 所有自定义指令…

1045 Favorite Color Stripe(LCS解法) 需再理解

解题思路 使用LCS方法解这一题&#xff0c;首先要把现有的颜色和Eva的颜色看成即将取材的序列s和e。 而且注意2个序列都要从1开始读入&#xff0c;因为递归边界&#xff08;待后叙&#xff09;。 dp[i][j]代表的是e[1]-e[i]和s[1]-s[j]的范围内&#xff0c;公共子序列的长度…

C++ primer第五版随笔--2015年1月6日

记录自己看这本书时的一些内容。 一、引用&#xff08;reference&#xff09; 引用为对象起了另外一个名字。例如&#xff1a; int ival1024&#xff1b; int &relVal1ival;//对&#xff0c;注意尽量不要用这方式&#xff1a;int& relvalival&#xff1b; int &rel…

Python性能分析指南——中

程序使用了多少内存&#xff1f;现在我们对计时有了较好的理解&#xff0c;那么让我们继续弄清楚程序使用了多少内存。我们很幸运&#xff0c;Fabian Pedregosa模仿Robert Kern的line_profiler实现了一个不错的内存分析器。首先使用pip安装:这里建议安装psutil包&#xff0c;因…

1040 Longest Symmetric String 需再做

解题思路 本题属于最长回文子串专题下。与之前的LIS和LCS的动规有两个较大的不同 1. 虽然最后也是要求长度&#xff0c;但是长度信息不再蕴含在dp数组当中&#xff0c;dp[i][j]表示的仅仅是从s[i]起s[j]止这一段是否是回文&#xff0c;所以为了提醒自己&#xff0c;我设置成了…

回顾2009,展望2010。

回顾2009&#xff0c;展望2010。 2009即将过去&#xff0c;总结2009年&#xff0c;计划2010年。 2009年12月31日。转载于:https://www.cnblogs.com/finehappy/archive/2009/12/31/1654975.html

Linux Mint 19 安装Gnome Boxes 新建失败

之前在Ubuntu论坛提出&#xff0c;一直没有解决.http://forum.ubuntu.org.cn/viewtopic.php?f65&t488821 后参照&#xff1a; https://askubuntu.com/questions/836703/ ... sue/836715对方报错&#xff1a; (gnome-boxes:15984): Boxes-WARNING **: wizard.vala:463: Fai…

1057 Stack

目录 解题思路 AC代码 解题思路 虽然题目的名字是栈&#xff0c;但是这题和栈的关系很小&#xff0c;甚至我都没有用到stack这个数据结构&#xff0c;而是用vector<int>的pop_back()来模拟栈的弹出。 主要考察的是&#xff1a;在线查询&#xff0c;也就是查询过程中…

【译】使用自定义ViewHelper来简化Asp.net MVC view的开发------part1

从开发者的角度来看&#xff0c;创建Asp.net MVC的View是一件很爽的事&#xff0c;因为你可以精确控制最终生成的HTML。具有讽刺意味的是不得不写出每一行HTML代码同时也是Asp.net MVC的View中让人不爽的地方。让我用我的一个经历来告诉我创建ASP.Net MVC view Helpers背后灵感…

看书挑剔,只看经典

如何选择经典&#xff0c;可以到网上做做功课&#xff0c;看看评价&#xff0c;综合分析一下。书籍是我们知识的主要来源。在选择书籍的时候做足功课是对我们自己时间的负责&#xff1b;这和在超市里买东西时对比各个品牌是一个道理&#xff1b;只不过奇怪的是&#xff0c;我很…

0-1背包使用一维dp数组时为何v要从大到小枚举

样例数据 5 8 3 5 1 2 2 4 5 2 1 3 如若不然&#xff0c;也就是让v按照从小到大的顺序枚举&#xff0c;就会出现 注意高亮的那一行&#xff0c;第一件物品的重量只有3&#xff0c;怎么会得到6呢&#xff1f; 代码如下 #include<cstdio> #include<cmath> #inclu…

异步编程模型--使用 IAsyncResult 对象

先推荐阅读下面的资料&#xff1a;MSDN&#xff1a;异步编程设计模式IBM developerworks&#xff1a; 使用异步 I/O 大大提高应用程序的性能参考博文&#xff1a;1、正确使用异步操作 2、Lab&#xff1a;体会ASP.NET异步处理请求的效果 3、WCF中的异步调用 4、WCF从理论到实践(…

对XX证券报关于物联网操作系统的几个问题的答复

XX证券报提问了几个关于物联网和物联网操作系统的问题&#xff0c;个人表达了一些粗陋的观点&#xff0c;在这里发表出来&#xff0c;与行业朋友交流和探讨。物联网行业最需要解决的问题是什么&#xff1f;虽然物联网这个行业被炒得比较热&#xff0c;但是截至目前&#xff0c;…

Java基础 - 面向对象 - 构造方法

在类中除了成员方法之外&#xff0c;还存在一种特殊类型的方法&#xff0c;那就是构造方法。构造方法是一个与类同名的方法&#xff0c;对象的创建就是通过构造方法完成的。每当类实例化一个对象时&#xff0c;类都会自动调用构造方法。 构造方法的特点&#xff1a; 构造方法没…

1105 Spiral Matrix 给定数组向螺旋矩阵中填入数据

两个测试用例超时&#xff0c;可直接跳转到 目录 超时点1 超时点2 ​​​​​​​ 要做的事情是&#xff0c;将数组按照非升序/降序&#xff0c;顺时针从外围到内部一圈一圈地把数据填到矩阵中&#xff0c;并打印出来。也就是将数组排好序后&#xff0c;将矩阵的坐标和数组…

一晚上就能让你小腹变小的方法 - 健康程序员,至尚生活!

仅一晚上针对小腹的锻炼就会让它明显收紧&#xff0c;很不可思议吧&#xff1f;但它确实发生了。形体教练向我们推荐&#xff1a;做30次转身运动(双手抱在脑后站立&#xff0c;迅速分别向左右两侧依次扭转上肢&#xff0c;注意不要以膝盖为轴&#xff0c;使运动轴心保持在骨盆以…

Alpha 冲刺 (2/10)

前言 队名&#xff1a;拖鞋旅游队组长博客&#xff1a;https://www.cnblogs.com/Sulumer/p/9960487.html作业博客&#xff1a;https://edu.cnblogs.com/campus/fzu/Grade2016SE/homework/2365组内情况 燃尽图任务分布github签入记录苏路明&#xff08;组长&#xff09;过去两天…

互联网对erp行业到底有什么影响

1 财务管理的影响 总账、 应收应付、资金计划&#xff0c;支付管理。 生产计划的影响。 重大的疑惑。 转载于:https://www.cnblogs.com/sdgxbooy/p/8892655.html

PAT甲级排队问题合集 (持续更新中)

已加入的习题 A1014,A1017 问题1和2共性 1. 都是排队问题 2. 都有一条黄线 3. 都需要找到最先离开人的队伍 4. 都有着服务时间段限制(迟于某个时间点来不予受理) 问题1&#xff1a;1014 Waiting in Line 问题链接&#xff1a;1014 Waiting in Line 这一题&#xff0c;…

第三章:创建用户界面组件--可视化组件(一)

1.可视化组件 1.1关于可视化组件 可视化组件的特征包括&#xff1a;size(大小&#xff09;、事件、样式、皮肤、行为。 行为&#xff1a;当组件被触发时&#xff0c;视觉&#xff0c;音乐效果的变化。 1.1 .1Spark and Halo 组件 Spark是flex 4中新加的组件。halo仍旧继承了以…

Rust 1.30带来更多元编程支持,并改进了模块系统

Rust的最新版本1.30扩展了过程宏&#xff0c;允许它们定义新的属性和类似于函数的宏。此外&#xff0c;它简化了Rust模块系统&#xff0c;使其更加一致、直观。 Rust 1.30引入了两种新类型的过程宏&#xff0c;“类属性的过程宏”和“类函数的过程宏”。过程宏是Rust元编程的基…