首页 > 数据库 >oracle 之存储过程 begin ...... ; ...... end

oracle 之存储过程 begin ...... ; ...... end

时间:2023-06-09 11:24:19浏览次数:47  
标签:begin end byjg xjxx ...... YJS XS ID prz

点击查看代码
begin

        merge into ly_yjs_hxsj.T_XSGL_XSXX_CZRZ rz
        using ( select a.XS_ID xsid, xh, xm, '02' as bglx,'修改学生:'||xm||':学位操作撤销学位证书号,原学位证书号:'|| BJYZSBH || '改为:'|| a.JYZSH as bgnr, #{editor} as czrzh,
        #{editor} as czrxm ,'' as czip from (
        <foreach collection="data" item="item" separator="union">
            select #{item.studentId} XS_ID, #{item.studentCompletionNumber,jdbcType=VARCHAR} JYZSH from dual
        </foreach>
        ) a join LY_YJS_HXSJ.T_BYGL_XSBYJG byjg on byjg.XS_ID = a.XS_ID and byjg.BYLXM = '08' and byjg.GDMC is null
        join LY_YJS_HXSJ.T_XSGL_XSXX_XJXX xjxx on xjxx.XS_ID = byjg.XS_ID
        <where>
            <if test=" studentIdOrName != null and studentIdOrName != ''">and (instr(xjxx.XM, #{studentIdOrName}) > 0 or instr(xjxx.XS_ID, #{studentIdOrName}) > 0)</if>
            <if test="studentCultureLevelCode != null and studentCultureLevelCode != ''">and xjxx.PYCCM = #{studentCultureLevelCode}</if>
            <if test="degreeClassify != null and degreeClassify != ''">and xjxx.XWLXM = #{degreeClassify}</if>
            <if test="educationCategory != null and educationCategory != ''">and xjxx.JYLXM = #{educationCategory}</if>
            <if test="studyModeCode != null and studyModeCode != ''">and xjxx.XXFSM = #{studyModeCode}</if>
        </where>
         ) prz on (prz.xsid = 'T_BYGL_XSBYJG')

        when not matched then
        insert  (czrzid, xsid, xh, xm,bglx, bgnr, bgsj, czrzh, czrxm,czip) values(
        sys_guid(),prz.xsid,prz.xh, prz.xm,prz.bglx,prz.bgnr,sysdate,prz.czrzh,prz.czrxm,prz.czip
        );
        merge into LY_YJS_HXSJ.T_XSGL_XSXX_XJXX xjxx using (
            select a.XS_ID, a.JYZSH from (
                <foreach collection="data" item="item" separator="union">
                    select #{item.studentId} XS_ID, #{item.studentCompletionNumber,jdbcType=VARCHAR} JYZSH from dual
                </foreach>
            ) a join LY_YJS_HXSJ.T_BYGL_XSBYJG byjg on byjg.XS_ID = a.XS_ID and byjg.BYLXM = '08' and byjg.GDMC is null
            join LY_YJS_HXSJ.T_XSGL_XSXX_XJXX xjxx on xjxx.XS_ID = byjg.XS_ID
            <where>
                <if test=" studentIdOrName != null and studentIdOrName != ''">and (instr(xjxx.XM, #{studentIdOrName}) > 0 or instr(xjxx.XS_ID, #{studentIdOrName}) > 0)</if>
                <if test="studentCultureLevelCode != null and studentCultureLevelCode != ''">and xjxx.PYCCM = #{studentCultureLevelCode}</if>
                <if test="degreeClassify != null and degreeClassify != ''">and xjxx.XWLXM = #{degreeClassify}</if>
                <if test="educationCategory != null and educationCategory != ''">and xjxx.JYLXM = #{educationCategory}</if>
                <if test="studyModeCode != null and studyModeCode != ''">and xjxx.XXFSM = #{studyModeCode}</if>
            </where>
        ) t on (t.XS_ID = xjxx.XS_ID)
        when matched then update set xjxx.BJYZSBH = t.JYZSH
        ;
        end;

标签:begin,end,byjg,xjxx,......,YJS,XS,ID,prz
From: https://www.cnblogs.com/heavenTang/p/17468647.html

相关文章

  • CF547E Mike and Friends题解
    题目链接温馨提示:做本题之前可以先尝试这个:洛谷P2414阿狸的打字机(是简单版的uwu)。首先,这个题涉及多模式串匹配,首先想AC自动机。但是有个问题:我们如何去计算一个串出现的次数呢?我们先考虑查询一个串\(a\)在串\(b\)中出现的次数。首先,在AC自动机上有一个性质,就是如果......
  • 【转载】CXF spring jaxws:endpoint jaxws:server 区别 与 关系
    通过spring配置实现webservice的配置有两种,一种是jaxws:endpoint ,另外一种是jaxws:server。百度上没查到相关区别,又由于本人没有跟代码,所以又google了一下,才找到:First,theyareallfortheserversideconfiguration.Second,jaxws:endpointiscomingfromJAXWSAPI,a......
  • AtCoder Beginner Contest 240 D
    D-StrangeBallstag:栈模拟发现自己隔了快半年再做此题看错相同数字的球消失的条件,不是\(k\geq2\)而是\(k=a_i\)电子竞技不需要视力题意:当球\(a_i(1\leqi\leqN)\)有\(a_i\)个一起出现时,这\(a_i\)个球就会消失,问每次放一个球进去,放进去后还剩多少个球?用个......
  • 报错:[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined
    1.错误详情2.错误分析百度此错误发现,很多人可能忘记在main.js中引入store.js并挂载在vue实例上,或者state单词写错了我审查了很多遍代码,依然报错,读取不到state中的数据,后来想到可能是版本的问题此项目是vue2,要使用vuex3才能正常运行,我安装的时候没有指定版本,直接装的是最新的v......
  • Nginx conf for fastapi backend project with variables
    带变量的nginx后端项目配置不同的api项目,挂载不同的域名,只需在配置夹里,修改文件名(建议文件名和域名保持一致)、修改端口号、修改第5行第22行backend_api后面的编号、修改第11行的项目名、可能还需要修改第12行的文件夹名、修改第14行的域名$cat/etc/nginx/sites-avaliable/myap......
  • EndNote参考文献格式Output Styles界面介绍
      本文对EndNote软件修改论文参考文献引用格式的界面与各选项参数加以详细介绍。  利用EndNote软件进行论文参考文献的插入可以说是非常方便;但其亦具有一个问题,就是对中文文献的支持不太友好;之前也用过NoteExpress,这一国产软件对于中文参考文献的支持性很好,但是由于论文较多,......
  • blender svg优化
    1.图片转svghttps://www.visioncortex.org/vtracer/(推荐参数:CUTOUT/130,0100)adobeillustrator(照片高保真度为模板):2.导入blender删除背景多选物体,右键→转换到网格3.布线优化X键→有限融并0.5°(感谢maylog的教程:https://www.bilibili.com/video/BV1......
  • 1.1OpenDaylight的安装
    OpenDaylight的安装任务目的1、了解OpenDaylight的诞生背景和基本架构,能够对OpenDaylight整体架构有一个大体认识,从而更好的理解SDN架构。2、掌握安装、部署OpenDaylight的方法,能够独立解决实验过程中遇到的问题。通过安装OpenDaylight组件,对OpenDaylight组成有一个更具象的认......
  • 1.3OpenDaylight SFC项目基础
    OpenDaylightSFC项目基础任务目的1、了解OpenDaylightSFC项目。2、掌握手动配置SFC的基本操作。任务环境设备名称软件环境(镜像)硬件环境主机Ubuntu14.04桌面版OpenDaylightCarbonCPU:2核内存:4G磁盘:20G注:系统默认的账户为:管理员权限用户名:root,密码:root@......
  • 1.2使用OpenDaylight界面下发流表
    使用OpenDaylight界面下发流表任务目的1、掌握YANGUI下发流表的方式,了解YANGUI的功能特点,以及其在OpenDaylight架构中所起的作用。2、通过下发流表的过程,梳理出数据包处理的简单流程。并且进一步了解单级流表和多级流表的处理过程。任务环境设备名称软件环境(镜像)硬件......