xzzx

创建包:

CREATE OR REPLACE PACKAGE WYL_TEST_PKG_GGYW_XZZX IS

  -- Purpose : 公共业务-参保险种注销

  --注销选择的险种,并将参保缴费信息,转入信息备份到险种注销备份表

  --备份数据
  PROCEDURE XZZX_BFSJ(PI_YWBM  IN VARCHAR2, --业务表名
                      PI_BFBM  IN VARCHAR2, --备份表名
                      PI_BFTJ  IN VARCHAR2, --备份条件(字符串)
                      PI_BCXXC IN VARCHAR2, --补充信息串(CAE837=?***BFE229=?)
                      PO_FHZ   OUT VARCHAR2, --返回值
                      PO_MSG   OUT VARCHAR2 --返回信息
                      );

  --备份判断
  PROCEDURE XZZX_HBPD(PI_OWNER1 IN VARCHAR2,
                      PI_BM1    IN VARCHAR2,
                      PI_OWNER2 IN VARCHAR2,
                      PI_BM2    IN VARCHAR2,
                      PO_ZDXXC1 OUT VARCHAR2, --insert的列字段串
                      PO_ZDXXC2 OUT VARCHAR2, --select的列字段串
                      PO_FHZ    OUT VARCHAR2,
                      PO_MSG    OUT VARCHAR2);

  --注销信息登记
  PROCEDURE XZZX_START(PI_BAE001 IN VARCHAR2,
                       PI_BAE007 IN VARCHAR2,
                       PI_AAC001 IN NUMBER,
                       PI_AAB001 IN NUMBER,
                       PI_AAE140 IN VARCHAR2,
                       PI_AAZ159 IN NUMBER,
                       PI_AAE002 IN NUMBER,
                       PI_CAE440 IN VARCHAR2,
                       PI_AAE011 IN VARCHAR2,
                       PI_AAE013 IN VARCHAR2,
                       PO_FHZ    OUT VARCHAR2,
                       PO_MSG    OUT VARCHAR2);

  --险种注销-回退
  PROCEDURE XZZX_HT(PI_BAE007 IN VARCHAR2,
                    PI_AAE012 IN VARCHAR2,
                    PO_FHZ    OUT VARCHAR2,
                    PO_MSG    OUT VARCHAR2);

  --险种注销-复核通过
  PROCEDURE XZZX_FH(PI_BAE007 IN VARCHAR2,
                    PI_AAE012 IN VARCHAR2,
                    PI_CAE441 IN VARCHAR2,
                    PO_FHZ    OUT VARCHAR2,
                    PO_MSG    OUT VARCHAR2);
END WYL_TEST_PKG_GGYW_XZZX;

  创建包体:

  1 CREATE OR REPLACE PACKAGE BODY WYL_TEST_PKG_GGYW_XZZX IS
  2
  3   --常量定义
  4   C_PKG_NAME CONSTANT VARCHAR2(20) := ‘Pkg_Ggyw_Xzzx.‘;
  5
  6   C_AAC008_ZZCB CONSTANT VARCHAR2(6) := PKG_FUN.F_GET_DICT(‘AAC008‘, ‘ZZCB‘); --个人参保状态-终止参保
  7   C_CAE009_ZR   CONSTANT VARCHAR2(6) := PKG_FUN.F_GET_DICT(‘CAE009‘, ‘ZR‘); --转移方向-转入
  8   C_CAE441_YHT  CONSTANT VARCHAR2(6) := PKG_FUN.F_GET_DICT(‘CAE441‘, ‘YHT‘); --险种注销标志-已回退
  9   C_CAE441_YZX  CONSTANT VARCHAR2(6) := PKG_FUN.F_GET_DICT(‘CAE441‘, ‘YZX‘); --险种注销标志-已注销
 10   C_CAE441_WZX  CONSTANT VARCHAR2(6) := PKG_FUN.F_GET_DICT(‘CAE441‘, ‘WZX‘); --险种注销标志-未注销
 11   --险种注销信息
 12   TYPE REC_XZZX_INFO IS RECORD(
 13     AAC001 AC01.AAC001%TYPE, --人员ID
 14     AAB001 AC01.AAB001%TYPE, --单位ID
 15     AAE140 AC02.AAE140%TYPE, --险种编号
 16     AAZ159 AC02.AAZ159%TYPE, --参保关系ID
 17     BAE007 SAE52.BAE007%TYPE,
 18     BAE001 SAE52.BAE001%TYPE,
 19     AAE002 SAE52.AAE002%TYPE,
 20     CAE440 SAE52.CAE440%TYPE,
 21     CAE441 SAE52.CAE441%TYPE);
 22
 23   --备份数据
 24   PROCEDURE XZZX_BFSJ(PI_YWBM  IN VARCHAR2, --业务表名
 25                       PI_BFBM  IN VARCHAR2, --备份表名
 26                       PI_BFTJ  IN VARCHAR2, --备份条件(字符串)
 27                       PI_BCXXC IN VARCHAR2, --补充信息串(CAE837=?***BFE229=?)
 28                       PO_FHZ   OUT VARCHAR2, --返回值
 29                       PO_MSG   OUT VARCHAR2 --返回信息
 30                       ) IS
 31
 32     V_PARAMS       VARCHAR2(2000); --传入参数串
 33     V_PROCNAME     VARCHAR2(50) := C_PKG_NAME || ‘ryhb_bfsj‘; -- 过程名
 34     V_OBJECT_NAME1 USER_OBJECTS.OBJECT_NAME%TYPE;
 35     V_OBJECT_TYPE1 USER_OBJECTS.OBJECT_TYPE%TYPE;
 36     V_TABLE_OWNER1 USER_SYNONYMS.TABLE_OWNER%TYPE;
 37     V_TABLE_NAME1  USER_SYNONYMS.TABLE_NAME%TYPE;
 38
 39     V_OBJECT_NAME2 USER_OBJECTS.OBJECT_NAME%TYPE;
 40     V_OBJECT_TYPE2 USER_OBJECTS.OBJECT_TYPE%TYPE;
 41     V_TABLE_OWNER2 USER_SYNONYMS.TABLE_OWNER%TYPE;
 42     V_TABLE_NAME2  USER_SYNONYMS.TABLE_NAME%TYPE;
 43     V_ZDXXC1       VARCHAR2(4000); --业务表字段信息串1
 44     V_ZDXXC2       VARCHAR2(4000); --业务表字段信息串2
 45     V_INSERTSQL    VARCHAR2(4000);
 46     V_SELECTSQL    VARCHAR2(4000);
 47     V_CAE442       VARCHAR2(20); --险种注销业务流水号
 48     V_NAMEVALUE    PKG_UTILITY.VC2000_TABLE;
 49
 50   BEGIN
 51     --数据初始化
 52     PO_FHZ   := ‘1‘;
 53     PO_MSG   := ‘成功‘;
 54     V_PARAMS := ‘,传入参数为:pi_ywbm=‘ || PI_YWBM || ‘;pi_bfbm=‘ || PI_BFBM ||
 55                 ‘;pi_bftj=‘ || PI_BFTJ || ‘;pi_bcxxc=‘ || PI_BCXXC;
 56     --判断业务表是否存在对象-----------------
 57     BEGIN
 58       SELECT OBJECT_NAME, OBJECT_TYPE
 59         INTO V_OBJECT_NAME1, V_OBJECT_TYPE1
 60         FROM USER_OBJECTS A
 61        WHERE A.OBJECT_TYPE IN (‘SYNONYM‘, ‘TABLE‘)
 62          AND A.OBJECT_NAME = UPPER(PI_YWBM);
 63
 64     EXCEPTION
 65       WHEN OTHERS THEN
 66         PO_FHZ := V_PROCNAME || ‘_001‘;
 67         PO_MSG := ‘需备份的业务表对象不存在或非表对象,请检查,pi_ywbm=‘ || PI_YWBM;
 68     END;
 69
 70     IF V_OBJECT_TYPE1 = ‘SYNONYM‘ THEN
 71       BEGIN
 72         SELECT B.TABLE_OWNER, B.TABLE_NAME
 73           INTO V_TABLE_OWNER1, V_TABLE_NAME1
 74           FROM USER_SYNONYMS B
 75          WHERE B.SYNONYM_NAME = V_OBJECT_NAME1;
 76
 77         SELECT OBJECT_NAME, OBJECT_TYPE
 78           INTO V_OBJECT_NAME1, V_OBJECT_TYPE1
 79           FROM ALL_OBJECTS A
 80          WHERE A.OBJECT_TYPE IN (‘TABLE‘)
 81            AND A.OWNER = UPPER(V_TABLE_OWNER1)
 82            AND A.OBJECT_NAME = UPPER(V_TABLE_NAME1);
 83       EXCEPTION
 84         WHEN OTHERS THEN
 85           PO_FHZ := V_PROCNAME || ‘_002‘;
 86           PO_MSG := ‘需备份的业务表对象不存在或非表对象,请检查用户是‘ || V_TABLE_OWNER1 || ‘的表‘ ||
 87                     V_TABLE_NAME1;
 88       END;
 89     ELSE
 90       SELECT USER INTO V_TABLE_OWNER1 FROM DUAL;
 91     END IF;
 92
 93     --判断备份表是否存在对象-----------------
 94     BEGIN
 95       SELECT OBJECT_NAME, OBJECT_TYPE
 96         INTO V_OBJECT_NAME2, V_OBJECT_TYPE2
 97         FROM USER_OBJECTS A
 98        WHERE A.OBJECT_TYPE IN (‘SYNONYM‘, ‘TABLE‘)
 99          AND A.OBJECT_NAME = UPPER(PI_BFBM);
100
101     EXCEPTION
102       WHEN OTHERS THEN
103         PO_FHZ := V_PROCNAME || ‘_003‘;
104         PO_MSG := ‘需备份的业务表对象不存在或非表对象,请检查,pi_bfbm=‘ || PI_BFBM;
105     END;
106
107     IF V_OBJECT_TYPE2 = ‘SYNONYM‘ THEN
108       BEGIN
109         SELECT B.TABLE_OWNER, B.TABLE_NAME
110           INTO V_TABLE_OWNER2, V_TABLE_NAME2
111           FROM USER_SYNONYMS B
112          WHERE B.SYNONYM_NAME = V_OBJECT_NAME2;
113
114         SELECT OBJECT_NAME, OBJECT_TYPE
115           INTO V_OBJECT_NAME2, V_OBJECT_TYPE2
116           FROM ALL_OBJECTS A
117          WHERE A.OBJECT_TYPE IN (‘TABLE‘)
118            AND A.OWNER = UPPER(V_TABLE_OWNER2)
119            AND A.OBJECT_NAME = UPPER(V_TABLE_NAME2);
120       EXCEPTION
121         WHEN OTHERS THEN
122           PO_FHZ := V_PROCNAME || ‘_004‘;
123           PO_MSG := ‘需备份的业务表对象不存在或非表对象,请检查用户是‘ || V_TABLE_OWNER2 || ‘的表‘ ||
124                     V_TABLE_NAME2;
125       END;
126     ELSE
127       SELECT USER INTO V_TABLE_OWNER2 FROM DUAL;
128     END IF;
129
130     --判断业务表与备份表除去备份字段其它字段是否一致,并生成列串
131     XZZX_HBPD(V_TABLE_OWNER1,
132               V_OBJECT_NAME1,
133               V_TABLE_OWNER2,
134               V_OBJECT_NAME2,
135               V_ZDXXC1,
136               V_ZDXXC2,
137               PO_FHZ,
138               PO_MSG);
139
140     IF PO_FHZ <> ‘1‘ THEN
141       RETURN;
142     END IF;
143
144     --拆分补充信息串
145     IF PI_BCXXC IS NOT NULL AND LENGTH(PI_BCXXC) > 0 THEN
146       -- 拆分where串
147       PKG_UTILITY.STR_TO_NAMEVALUE(PI_BCXXC,
148                                    ‘CAE442‘,
149                                    V_NAMEVALUE,
150                                    ‘***‘,
151                                    ‘=‘);
152     END IF;
153
154     --取值
155     V_CAE442 := V_NAMEVALUE(‘CAE442‘); --注销业务流水号‘
156     IF V_CAE442 IS NULL THEN
157       PO_FHZ := V_PROCNAME || ‘_005‘;
158       PO_MSG := ‘险种注销业务流水号不能为空,CAE442=‘ || NVL(V_CAE442, ‘空‘);
159
160       RETURN;
161     END IF;
162     --备份数据
163     V_INSERTSQL := ‘insert into ‘ || PI_BFBM || ‘ (‘ || V_ZDXXC1 ||
164                    ‘,CAE442) ‘;
165     V_SELECTSQL := ‘ select  ‘ || V_ZDXXC2 || ‘, ‘‘‘ || V_CAE442 ||
166                    ‘‘‘ CAE442‘ || ‘ from ‘ || PI_YWBM || ‘ a ‘;
167
168     EXECUTE IMMEDIATE V_INSERTSQL || V_SELECTSQL || PI_BFTJ;
169
170   EXCEPTION
171     WHEN OTHERS THEN
172       PO_FHZ := V_PROCNAME || ‘_999‘;
173       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
174       RETURN;
175   END XZZX_BFSJ;
176
177   --备份判断
178   PROCEDURE XZZX_HBPD(PI_OWNER1 IN VARCHAR2,
179                       PI_BM1    IN VARCHAR2,
180                       PI_OWNER2 IN VARCHAR2,
181                       PI_BM2    IN VARCHAR2,
182                       PO_ZDXXC1 OUT VARCHAR2, --insert的列字段串
183                       PO_ZDXXC2 OUT VARCHAR2, --select的列字段串
184                       PO_FHZ    OUT VARCHAR2,
185                       PO_MSG    OUT VARCHAR2) IS
186     --表判断
187     V_PARAMS VARCHAR2(2000); --传入参数串
188     --v_procname       VARCHAR2(50) :=C_PKG_NAME||‘grbgjl_zzztxsx‘; -- 过程名
189     V_PROCNAME VARCHAR2(50) := ‘‘ || ‘ryhb_hbpd‘; -- 过程名
190     V_COUNT    NUMBER;
191
192     CURSOR CUR_TAB_COL1 IS
193       SELECT *
194         FROM ALL_TAB_COLUMNS A
195        WHERE A.OWNER = PI_OWNER1
196          AND A.TABLE_NAME = PI_BM1
197        ORDER BY A.COLUMN_ID;
198
199   BEGIN
200     --数据初始化
201     PO_FHZ   := ‘1‘;
202     PO_MSG   := ‘成功‘;
203     V_PARAMS := ‘,传入参数为:pi_owner1=‘ || PI_OWNER1 || ‘;pi_bm1=‘ || PI_BM1 ||
204                 ‘;pi_owner2=‘ || PI_OWNER2 || ‘;pi_bm2=‘ || PI_BM2;
205     SELECT COUNT(1)
206       INTO V_COUNT
207       FROM ALL_TAB_COLUMNS A
208      WHERE A.OWNER = PI_OWNER1
209        AND A.TABLE_NAME = PI_BM1
210        AND NOT EXISTS (SELECT 1
211               FROM ALL_TAB_COLUMNS B
212              WHERE B.COLUMN_NAME != ‘CAE442‘
213                AND B.OWNER = PI_OWNER2
214                AND B.TABLE_NAME = PI_BM2
215                AND A.COLUMN_NAME = B.COLUMN_NAME);
216     IF V_COUNT > 0 THEN
217       PO_FHZ := V_PROCNAME || ‘_001‘;
218       PO_MSG := ‘需备份的业务表:‘ || PI_BM1 || ‘的字段比备份表:‘ || PI_BM2 || ‘字段多,请检查‘;
219       RETURN;
220     END IF;
221
222     SELECT COUNT(1)
223       INTO V_COUNT
224       FROM ALL_TAB_COLUMNS A
225      WHERE A.COLUMN_NAME != ‘CAE442‘
226        AND A.OWNER = PI_OWNER2
227        AND A.TABLE_NAME = PI_BM2
228        AND NOT EXISTS (SELECT 1
229               FROM ALL_TAB_COLUMNS B
230              WHERE B.OWNER = PI_OWNER1
231                AND B.TABLE_NAME = PI_BM1
232                AND A.COLUMN_NAME = B.COLUMN_NAME);
233     IF V_COUNT > 0 THEN
234       PO_FHZ := V_PROCNAME || ‘_002‘;
235       PO_MSG := ‘需备份的业务表:‘ || PI_BM1 || ‘的字段比备份表:‘ || PI_BM2 || ‘字段少,请检查‘;
236       RETURN;
237       RETURN;
238     END IF;
239
240     --判断备份表是否有备份用的两个字段
241     SELECT COUNT(1)
242       INTO V_COUNT
243       FROM ALL_TAB_COLUMNS A
244      WHERE A.COLUMN_NAME = ‘CAE442‘
245        AND A.OWNER = PI_OWNER2
246        AND A.TABLE_NAME = PI_BM2;
247     IF V_COUNT <> 2 THEN
248       PO_FHZ := V_PROCNAME || ‘_003‘;
249       PO_MSG := ‘备份表中没有CAE442这个字段,请检查‘ || PI_BM2;
250       RETURN;
251     END IF;
252
253     --生成业务表的字段串
254     FOR V_TAB_COL1 IN CUR_TAB_COL1 LOOP
255       IF V_TAB_COL1.COLUMN_ID = 1 THEN
256         PO_ZDXXC1 := V_TAB_COL1.COLUMN_NAME;
257       ELSE
258         PO_ZDXXC1 := PO_ZDXXC1 || ‘,‘ || V_TAB_COL1.COLUMN_NAME;
259
260       END IF;
261       IF V_TAB_COL1.COLUMN_ID = 1 THEN
262         PO_ZDXXC2 := V_TAB_COL1.COLUMN_NAME || ‘ ‘ ||
263                      V_TAB_COL1.COLUMN_NAME;
264       ELSE
265         PO_ZDXXC2 := PO_ZDXXC2 || ‘,‘ || V_TAB_COL1.COLUMN_NAME || ‘ ‘ ||
266                      V_TAB_COL1.COLUMN_NAME;
267
268       END IF;
269
270     END LOOP;
271     PO_FHZ := ‘1‘;
272   EXCEPTION
273     WHEN OTHERS THEN
274       PO_FHZ := V_PROCNAME || ‘_999‘;
275       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
276       RETURN;
277   END XZZX_HBPD;
278
279   --参保资料备份
280   PROCEDURE XZZX_CBZL_BF(PI_ZXXX IN REC_XZZX_INFO,
281                          PO_FHZ  OUT VARCHAR2,
282                          PO_MSG  OUT VARCHAR2) IS
283     V_PARAMS   VARCHAR2(32767); --传入参数串
284     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Cbzl_Bf‘; --过程名称
285
286     V_BFTJ  VARCHAR2(100); --备份条件
287     V_BCXXC VARCHAR2(100); --补充信息串
288   BEGIN
289     --初始化返回值
290     PO_FHZ := ‘1‘;
291     --初始化返回信息入参串
292     V_PARAMS := ‘,传入参数为:Pi_Zxxx.Bae007=‘ || PI_ZXXX.BAE007;
293     --设置备份条件和备份业务流水号
294     V_BFTJ  := ‘WHERE AAC001 =‘ || PI_ZXXX.AAC001 || ‘ AND AAE140 = ‘‘‘ ||
295                PI_ZXXX.AAE140 || ‘‘‘ AND AAZ159 = ‘ || PI_ZXXX.AAZ159;
296     V_BCXXC := ‘CAE442=‘ || PI_ZXXX.BAE007;
297     --将注销险种的参保资料都备份到SAE53中
298     XZZX_BFSJ(‘AC02‘, ‘SAE53‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
299     IF PO_FHZ != ‘1‘ THEN
300       RETURN;
301     END IF;
302     --删除参保资料
303     DELETE FROM AC02
304      WHERE AAC001 = PI_ZXXX.AAC001
305        AND AAE140 = PI_ZXXX.AAE140
306        AND AAZ159 = PI_ZXXX.AAZ159;
307     RETURN;
308   EXCEPTION
309     WHEN OTHERS THEN
310       PO_FHZ := V_PROCNAME || ‘_999‘;
311       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
312       RETURN;
313   END XZZX_CBZL_BF;
314
315   --参保历史备份
316   PROCEDURE XZZX_CBLS_BF(PI_ZXXX IN REC_XZZX_INFO,
317                          PO_FHZ  OUT VARCHAR2,
318                          PO_MSG  OUT VARCHAR2) IS
319     V_PARAMS   VARCHAR2(32767); --传入参数串
320     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Cbls_Bf‘; --过程名称
321
322     V_BFTJ  VARCHAR2(100); --备份条件
323     V_BCXXC VARCHAR2(100); --补充信息串
324   BEGIN
325     --初始化返回值
326     PO_FHZ := ‘1‘;
327     --初始化返回信息入参串
328     V_PARAMS := ‘,传入参数为:Pi_Zxxx.Bae007=‘ || PI_ZXXX.BAE007;
329     --设置备份条件和备份业务流水号
330     V_BFTJ  := ‘WHERE AAC001 =‘ || PI_ZXXX.AAC001 || ‘ AND AAE140 = ‘‘‘ ||
331                PI_ZXXX.AAE140 || ‘‘‘ AND AAZ159 = ‘ || PI_ZXXX.AAZ159;
332     V_BCXXC := ‘CAE442=‘ || PI_ZXXX.BAE007;
333     --将注销险种的参保历史都备份到SAE54中
334     XZZX_BFSJ(‘AC20‘, ‘SAE54‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
335     IF PO_FHZ != ‘1‘ THEN
336       RETURN;
337     END IF;
338     --删除参保历史
339     DELETE FROM AC20
340      WHERE AAC001 = PI_ZXXX.AAC001
341        AND AAE140 = PI_ZXXX.AAE140
342        AND AAZ159 = PI_ZXXX.AAZ159;
343     RETURN;
344   EXCEPTION
345     WHEN OTHERS THEN
346       PO_FHZ := V_PROCNAME || ‘_999‘;
347       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
348       RETURN;
349   END XZZX_CBLS_BF;
350
351   --个人养老账户备份
352   PROCEDURE XZZX_YLZH_BF(PI_ZXXX IN REC_XZZX_INFO,
353                          PO_FHZ  OUT VARCHAR2,
354                          PO_MSG  OUT VARCHAR2) IS
355     V_PARAMS   VARCHAR2(32767); --传入参数串
356     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Ylzh_Bf‘; --过程名称
357
358     V_BFTJ  VARCHAR2(100); --备份条件
359     V_BCXXC VARCHAR2(100); --补充信息串
360   BEGIN
361     --初始化返回值
362     PO_FHZ := ‘1‘;
363     --初始化返回信息入参串
364     V_PARAMS := ‘,传入参数为:Pi_Zxxx.Bae007=‘ || PI_ZXXX.BAE007;
365     --设置备份条件和备份业务流水号
366     V_BFTJ  := ‘WHERE AAC001 =‘ || PI_ZXXX.AAC001 || ‘ AND AAE140 = ‘‘‘ ||
367                PI_ZXXX.AAE140 || ‘‘‘‘;
368     V_BCXXC := ‘CAE442=‘ || PI_ZXXX.BAE007;
369     --将注销养老险种的个人账户都备份到SAE55中
370     XZZX_BFSJ(‘SIC81‘, ‘SAE55‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
371     IF PO_FHZ != ‘1‘ THEN
372       RETURN;
373     END IF;
374     --将注销养老险种的个人年度账户都备份到SAE56中
375     XZZX_BFSJ(‘SIC86‘, ‘SAE56‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
376     IF PO_FHZ != ‘1‘ THEN
377       RETURN;
378     END IF;
379     --删除养老险种的个人账户信息
380     DELETE FROM SIC81
381      WHERE AAC001 = PI_ZXXX.AAC001
382        AND AAE140 = PI_ZXXX.AAE140;
383     DELETE FROM SIC86
384      WHERE AAC001 = PI_ZXXX.AAC001
385        AND AAE140 = PI_ZXXX.AAE140;
386     RETURN;
387   EXCEPTION
388     WHEN OTHERS THEN
389       PO_FHZ := V_PROCNAME || ‘_999‘;
390       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
391       RETURN;
392   END XZZX_YLZH_BF;
393
394   --个人医保账户备份
395   PROCEDURE XZZX_YILZH_BF(PI_ZXXX IN REC_XZZX_INFO,
396                           PO_FHZ  OUT VARCHAR2,
397                           PO_MSG  OUT VARCHAR2) IS
398     V_PARAMS   VARCHAR2(32767); --传入参数串
399     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Yilzh_Bf‘; --过程名称
400
401     V_BFTJ  VARCHAR2(100); --备份条件
402     V_BCXXC VARCHAR2(100); --补充信息串
403   BEGIN
404     --初始化返回值
405     PO_FHZ := ‘1‘;
406     --初始化返回信息入参串
407     V_PARAMS := ‘,传入参数为:Pi_Zxxx.Bae007=‘ || PI_ZXXX.BAE007;
408     --设置备份条件和备份业务流水号
409     V_BFTJ  := ‘WHERE AAC001 =‘ || PI_ZXXX.AAC001;
410     V_BCXXC := ‘CAE442=‘ || PI_ZXXX.BAE007;
411     --将注销医疗险种的个人账户都备份到SAE57中
412     XZZX_BFSJ(‘SKC81‘, ‘SAE57‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
413     IF PO_FHZ != ‘1‘ THEN
414       RETURN;
415     END IF;
416     --将注销医疗险种的个人年度账户都备份到SAE58中
417     XZZX_BFSJ(‘SKC86‘, ‘SAE58‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
418     IF PO_FHZ != ‘1‘ THEN
419       RETURN;
420     END IF;
421     --删除医疗险种的个人账户信息
422     DELETE FROM SKC81 WHERE AAC001 = PI_ZXXX.AAC001;
423     DELETE FROM SKC86 WHERE AAC001 = PI_ZXXX.AAC001;
424     RETURN;
425   EXCEPTION
426     WHEN OTHERS THEN
427       PO_FHZ := V_PROCNAME || ‘_999‘;
428       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
429       RETURN;
430   END XZZX_YILZH_BF;
431
432   --个人征缴明细注销备份
433   PROCEDURE XZZX_GRYJ_BF(PI_ZXXX IN REC_XZZX_INFO,
434                          PO_FHZ  OUT VARCHAR2,
435                          PO_MSG  OUT VARCHAR2) IS
436     V_PARAMS   VARCHAR2(32767); --传入参数串
437     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Gryj_Bf‘; --过程名称
438
439     V_BFTJ  VARCHAR2(100); --备份条件
440     V_BCXXC VARCHAR2(100); --补充信息串
441   BEGIN
442     --初始化返回值
443     PO_FHZ := ‘1‘;
444     --初始化返回信息入参串
445     V_PARAMS := ‘,传入参数为:Pi_Zxxx.Bae007=‘ || PI_ZXXX.BAE007;
446     --设置备份条件和备份业务流水号
447     V_BFTJ  := ‘WHERE AAC001 =‘ || PI_ZXXX.AAC001 || ‘ AND AAE140 = ‘‘‘ ||
448                PI_ZXXX.AAE140 || ‘‘‘‘;
449     V_BCXXC := ‘CAE442=‘ || PI_ZXXX.BAE007;
450     --将注销险种的个人应缴都备份到SAE59中
451     XZZX_BFSJ(‘AC43‘, ‘SAE59‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
452     IF PO_FHZ != ‘1‘ THEN
453       RETURN;
454     END IF;
455     --将注销养老险种的个人应缴都备份到SAE59中
456     XZZX_BFSJ(‘SIC84‘, ‘SAE59‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
457     IF PO_FHZ != ‘1‘ THEN
458       RETURN;
459     END IF;
460     --将注销医疗险种的个人应缴都备份到SAE59中
461     XZZX_BFSJ(‘SKC84‘, ‘SAE59‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
462     IF PO_FHZ != ‘1‘ THEN
463       RETURN;
464     END IF;
465     --将注销失业险种的个人应缴都备份到SAE59中
466     XZZX_BFSJ(‘SJC84‘, ‘SAE59‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
467     IF PO_FHZ != ‘1‘ THEN
468       RETURN;
469     END IF;
470     --将注销工伤险种的个人应缴都备份到SAE59中
471     XZZX_BFSJ(‘SLC84‘, ‘SAE59‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
472     IF PO_FHZ != ‘1‘ THEN
473       RETURN;
474     END IF;
475     --将注销生育险种的个人应缴都备份到SAE59中
476     XZZX_BFSJ(‘SMC84‘, ‘SAE59‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
477     IF PO_FHZ != ‘1‘ THEN
478       RETURN;
479     END IF;
480     --删除医疗险种的个人账户信息
481     DELETE FROM AC43
482      WHERE AAC001 = PI_ZXXX.AAC001
483        AND AAE140 = PI_ZXXX.AAC001;
484     DELETE FROM SIC84
485      WHERE AAC001 = PI_ZXXX.AAC001
486        AND AAE140 = PI_ZXXX.AAC001;
487     DELETE FROM SKC84
488      WHERE AAC001 = PI_ZXXX.AAC001
489        AND AAE140 = PI_ZXXX.AAC001;
490     DELETE FROM SJC84
491      WHERE AAC001 = PI_ZXXX.AAC001
492        AND AAE140 = PI_ZXXX.AAC001;
493     DELETE FROM SLC84
494      WHERE AAC001 = PI_ZXXX.AAC001
495        AND AAE140 = PI_ZXXX.AAC001;
496     DELETE FROM SMC84
497      WHERE AAC001 = PI_ZXXX.AAC001
498        AND AAE140 = PI_ZXXX.AAC001;
499     RETURN;
500   EXCEPTION
501     WHEN OTHERS THEN
502       PO_FHZ := V_PROCNAME || ‘_999‘;
503       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
504       RETURN;
505   END XZZX_GRYJ_BF;
506
507   --个人转移(只备份转入)信息注销备份
508   PROCEDURE XZZX_ZYZL_BF(PI_ZXXX IN REC_XZZX_INFO,
509                          PO_FHZ  OUT VARCHAR2,
510                          PO_MSG  OUT VARCHAR2) IS
511     V_PARAMS   VARCHAR2(32767); --传入参数串
512     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Zyzl_Bf‘; --过程名称
513
514     V_BFTJ  VARCHAR2(100); --备份条件
515     V_BCXXC VARCHAR2(100); --补充信息串
516   BEGIN
517     --初始化返回值
518     PO_FHZ := ‘1‘;
519     --初始化返回信息入参串
520     V_PARAMS := ‘,传入参数为:Pi_Zxxx.Bae007=‘ || PI_ZXXX.BAE007;
521     --设置备份条件和备份业务流水号
522     V_BFTJ  := ‘WHERE AAC001 =‘ || PI_ZXXX.AAC001 || ‘ AND AAE140 = ‘‘‘ ||
523                PI_ZXXX.AAE140 ||
524                ‘‘‘ AND CAE009 = ‘‘1‘‘ AND SUBSTR(AAE036,1,6) <= ‘ ||
525                NVL(PI_ZXXX.AAE002, ‘999999‘);
526     V_BCXXC := ‘CAE442=‘ || PI_ZXXX.BAE007;
527     --将注销险种的转入资料都备份到SAE60中
528     XZZX_BFSJ(‘SAC12‘, ‘SAE60‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
529     IF PO_FHZ != ‘1‘ THEN
530       RETURN;
531     END IF;
532     --设置备份条件和备份业务流水号
533     V_BFTJ  := ‘WHERE AAC001 =‘ || PI_ZXXX.AAC001 || ‘ AND AAE140 = ‘‘‘ ||
534                PI_ZXXX.AAE140 || ‘‘‘ AND CAE009 = ‘‘1‘‘ ‘;
535     V_BCXXC := ‘CAE442=‘ || PI_ZXXX.BAE007;
536     --将注销险种的转入资料都备份到SAE60中
537     XZZX_BFSJ(‘SAC13‘, ‘SAE61‘, V_BFTJ, V_BCXXC, PO_FHZ, PO_MSG);
538     IF PO_FHZ != ‘1‘ THEN
539       RETURN;
540     END IF;
541     --删除转入资料
542     DELETE FROM SAC12
543      WHERE AAC001 = PI_ZXXX.AAC001
544        AND AAE140 = PI_ZXXX.AAE140
545        AND CAE009 = C_CAE009_ZR
546        AND SUBSTR(AAE036, 1, 6) <= NVL(PI_ZXXX.AAE002, ‘999999‘);
547     DELETE FROM SAC13
548      WHERE AAC001 = PI_ZXXX.AAC001
549        AND AAE140 = PI_ZXXX.AAE140
550        AND CAE009 = C_CAE009_ZR;
551     RETURN;
552   EXCEPTION
553     WHEN OTHERS THEN
554       PO_FHZ := V_PROCNAME || ‘_999‘;
555       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
556       RETURN;
557   END XZZX_ZYZL_BF;
558
559   --验证注销条件
560   --个人转移(只备份转入)信息注销备份
561   PROCEDURE XZZX_YZBGTJ(PI_ZXXX IN REC_XZZX_INFO,
562                         PO_FHZ  OUT VARCHAR2,
563                         PO_MSG  OUT VARCHAR2) IS
564     V_PARAMS   VARCHAR2(32767); --传入参数串
565     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Yzbgtj‘; --过程名称
566
567     V_AAC008 VARCHAR2(6);
568   BEGIN
569     --初始化返回值
570     PO_FHZ := ‘1‘;
571     --初始化返回信息入参串
572     V_PARAMS := ‘,传入参数为:Pi_Zxxx.Bae007=‘ || PI_ZXXX.BAE007;
573
574     --获取参保状态
575     SELECT AAC008
576       INTO V_AAC008
577       FROM AC02
578      WHERE AAC001 = PI_ZXXX.AAC001
579        AND AAE140 = PI_ZXXX.AAE140
580        AND AAZ159 = PI_ZXXX.AAZ159;
581     IF V_AAC008 != C_AAC008_ZZCB THEN
582       PO_FHZ := V_PROCNAME || ‘_901‘;
583       PO_MSG := PKG_FUN.F_ERRMSG_PRC(V_PROCNAME,
584                                      ‘,注销险种的参保状态必须为终止参保‘,
585                                      V_PARAMS);
586       RETURN;
587     END IF;
588
589     RETURN;
590   EXCEPTION
591     WHEN OTHERS THEN
592       PO_FHZ := V_PROCNAME || ‘_999‘;
593       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
594       RETURN;
595   END XZZX_YZBGTJ;
596
597   --获取注销险种信息
598   PROCEDURE XZZX_HQZXXX(PI_BAE007 IN VARCHAR2,
599                         PO_ZXXX   OUT REC_XZZX_INFO,
600                         PO_FHZ    OUT VARCHAR2,
601                         PO_MSG    OUT VARCHAR2) IS
602     V_PARAMS   VARCHAR2(32767); --传入参数串
603     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Hqzxxx‘; --过程名称
604
605     V_ZXXX REC_XZZX_INFO;
606   BEGIN
607     --初始化返回值
608     PO_FHZ := ‘1‘;
609     --初始化返回信息入参串
610     V_PARAMS := ‘,传入参数为:Pi_Bae007=‘ || PI_BAE007;
611     --获取注销信息
612     SELECT BAE001, BAE007, AAC001, AAB001, AAE140, AAZ159, AAE002, CAE441
613       INTO V_ZXXX.BAE001,
614            V_ZXXX.BAE007,
615            V_ZXXX.AAC001,
616            V_ZXXX.AAB001,
617            V_ZXXX.AAE140,
618            V_ZXXX.AAZ159,
619            V_ZXXX.AAE002,
620            V_ZXXX.CAE441
621       FROM SAE52
622      WHERE BAE007 = PI_BAE007;
623     PO_ZXXX := V_ZXXX;
624     RETURN;
625   EXCEPTION
626     WHEN OTHERS THEN
627       PO_FHZ := V_PROCNAME || ‘_999‘;
628       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
629       RETURN;
630   END XZZX_HQZXXX;
631
632   --注销信息登记
633   PROCEDURE XZZX_START(PI_BAE001 IN VARCHAR2,
634                        PI_BAE007 IN VARCHAR2,
635                        PI_AAC001 IN NUMBER,
636                        PI_AAB001 IN NUMBER,
637                        PI_AAE140 IN VARCHAR2,
638                        PI_AAZ159 IN NUMBER, --注销险种参保关系ID
639                        PI_AAE002 IN NUMBER,
640                        PI_CAE440 IN VARCHAR2,
641                        PI_AAE011 IN VARCHAR2,
642                        PI_AAE013 IN VARCHAR2,
643                        PO_FHZ    OUT VARCHAR2,
644                        PO_MSG    OUT VARCHAR2) IS
645     V_PARAMS   VARCHAR2(32767); --传入参数串
646     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Start‘; --过程名称
647
648     V_ZXXX REC_XZZX_INFO;
649   BEGIN
650     --初始化返回值
651     PO_FHZ := ‘1‘;
652     --初始化返回信息入参串
653     V_PARAMS      := ‘,传入参数为:Pi_Bae001=‘ || PI_BAE001 || ‘,Pi_Bae007:‘ ||
654                      PI_BAE007 || ‘,Pi_Aac001:‘ || PI_AAC001 ||
655                      ‘,Pi_Aab001:‘ || PI_AAB001 || ‘,Pi_Aae140:‘ ||
656                      PI_AAE140 || ‘,Pi_Aaz159:‘ || PI_AAZ159 ||
657                      ‘,Pi_Aae002:‘ || PI_AAE002 || ‘,Pi_Cae440:‘ ||
658                      PI_CAE440 || ‘,Pi_Aae011:‘ || PI_AAE011 ||
659                      ‘,Pi_Aae013:‘ || PI_AAE013;
660     V_ZXXX.BAE001 := PI_BAE001;
661     V_ZXXX.BAE007 := PI_BAE007;
662     V_ZXXX.AAC001 := PI_AAC001;
663     V_ZXXX.AAB001 := PI_AAB001;
664     V_ZXXX.AAE140 := PI_AAE140;
665     V_ZXXX.AAZ159 := PI_AAZ159;
666     V_ZXXX.AAE002 := PI_AAE002;
667     V_ZXXX.CAE440 := PI_CAE440;
668     V_ZXXX.CAE441 := C_CAE441_WZX;
669     --验证变更条件
670     XZZX_YZBGTJ(V_ZXXX, PO_FHZ, PO_MSG);
671     IF PO_FHZ != ‘1‘ THEN
672       RETURN;
673     END IF;
674     --插入注销业务信息
675     INSERT INTO SAE52 --公共业务险种注销主表
676       (BAE001, --系统机构编码
677        BAE007, --业务流水号
678        AAC001, --个人编号
679        AAB001, --单位编号
680        AAE140, --注销险种
681        AAZ159, --注销险种参保关系ID
682        AAE002, --注销截止时间
683        CAE440, --注销原因
684        AAE011, --经办人
685        AAE036, --经办日期
686        CAE441, --注销业务状态0未注销,1已注销,9已回退
687        AAE013) --备注
688     VALUES
689       (V_ZXXX.BAE001, --系统机构编码
690        V_ZXXX.BAE007, --业务流水号
691        V_ZXXX.AAC001, --个人编号
692        V_ZXXX.AAB001, --单位编号
693        V_ZXXX.AAE140, --注销险种
694        V_ZXXX.AAZ159, --注销险种参保关系ID
695        V_ZXXX.AAE002, --注销截止时间
696        V_ZXXX.CAE440, --注销原因
697        PI_AAE011, --经办人
698        PKG_FUN.F_GET_SYSDATE(14), --经办日期
699        V_ZXXX.CAE441, --注销业务状态0未注销,1已注销,9已回退
700        PI_AAE013); --备注
701     RETURN;
702   EXCEPTION
703     WHEN OTHERS THEN
704       PO_FHZ := V_PROCNAME || ‘_999‘;
705       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
706       RETURN;
707   END XZZX_START;
708
709   --险种注销-回退
710   PROCEDURE XZZX_HT(PI_BAE007 IN VARCHAR2,
711                     PI_AAE012 IN VARCHAR2,
712                     PO_FHZ    OUT VARCHAR2,
713                     PO_MSG    OUT VARCHAR2) IS
714     V_PARAMS   VARCHAR2(32767); --传入参数串
715     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Ht‘; --过程名称
716
717     V_ZXXX REC_XZZX_INFO;
718   BEGIN
719     --初始化返回值
720     PO_FHZ := ‘1‘;
721     --初始化返回信息入参串
722     V_PARAMS := ‘,传入参数为:Pi_BAE007=‘ || PI_BAE007;
723     --获取注销险种信息
724     XZZX_HQZXXX(PI_BAE007, V_ZXXX, PO_FHZ, PO_MSG);
725     IF PO_FHZ != ‘1‘ THEN
726       RETURN;
727     END IF;
728     IF V_ZXXX.CAE441 != ‘0‘ THEN
729       PO_FHZ := V_PROCNAME || ‘_901‘;
730       PO_MSG := PKG_FUN.F_ERRMSG_PRC(V_PROCNAME,
731                                      ‘,险种注销业务状态不正常,不能继续处理‘,
732                                      V_PARAMS);
733       RETURN;
734     END IF;
735     --复核未通过
736     UPDATE SAE52 --公共业务险种注销主表
737        SET CAE441 = C_CAE441_YHT, --注销业务状态0未注销,1已注销,9已回退
738            CAE030 = PI_AAE012, --取消人
739            CAE031 = PKG_FUN.F_GET_SYSDATE(14) --取消时间
740      WHERE BAE007 = PI_BAE007;
741     RETURN;
742   EXCEPTION
743     WHEN OTHERS THEN
744       PO_FHZ := V_PROCNAME || ‘_999‘;
745       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
746       RETURN;
747   END XZZX_HT;
748
749   --险种注销-处理
750   PROCEDURE XZZX_CL(PI_ZXXX IN REC_XZZX_INFO,
751                     PO_FHZ  OUT VARCHAR2,
752                     PO_MSG  OUT VARCHAR2) IS
753     V_PARAMS   VARCHAR2(32767); --传入参数串
754     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Cl‘; --过程名称
755   BEGIN
756     --初始化返回值
757     PO_FHZ := ‘1‘;
758     --初始化返回信息入参串
759     V_PARAMS := ‘,传入参数为:Pi_Zxxx.Bae007=‘ || PI_ZXXX.BAE007;
760     --处理参保资料
761     XZZX_CBZL_BF(PI_ZXXX, PO_FHZ, PO_MSG);
762     IF PO_FHZ != ‘1‘ THEN
763       RETURN;
764     END IF;
765     --处理参保历史资料
766     XZZX_CBLS_BF(PI_ZXXX, PO_FHZ, PO_MSG);
767     IF PO_FHZ != ‘1‘ THEN
768       RETURN;
769     END IF;
770     --处理养老账户
771     IF SUBSTR(PI_ZXXX.AAE140, 1, 1) = ‘1‘ THEN
772       XZZX_YLZH_BF(PI_ZXXX, PO_FHZ, PO_MSG);
773       IF PO_FHZ != ‘1‘ THEN
774         RETURN;
775       END IF;
776     END IF;
777     --处理医保账户
778     IF SUBSTR(PI_ZXXX.AAE140, 1, 1) = ‘3‘ THEN
779       XZZX_YILZH_BF(PI_ZXXX, PO_FHZ, PO_MSG);
780       IF PO_FHZ != ‘1‘ THEN
781         RETURN;
782       END IF;
783     END IF;
784     --处理个人应缴明细
785     XZZX_GRYJ_BF(PI_ZXXX, PO_FHZ, PO_MSG);
786     IF PO_FHZ != ‘1‘ THEN
787       RETURN;
788     END IF;
789     --处理转移资料
790     XZZX_ZYZL_BF(PI_ZXXX, PO_FHZ, PO_MSG);
791     IF PO_FHZ != ‘1‘ THEN
792       RETURN;
793     END IF;
794     RETURN;
795   EXCEPTION
796     WHEN OTHERS THEN
797       PO_FHZ := V_PROCNAME || ‘_999‘;
798       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
799       RETURN;
800   END XZZX_CL;
801
802   --险种注销-复核通过
803   PROCEDURE XZZX_FH(PI_BAE007 IN VARCHAR2,
804                     PI_AAE012 IN VARCHAR2,
805                     PI_CAE441 IN VARCHAR2,
806                     PO_FHZ    OUT VARCHAR2,
807                     PO_MSG    OUT VARCHAR2) IS
808     V_PARAMS   VARCHAR2(32767); --传入参数串
809     V_PROCNAME VARCHAR2(50) := C_PKG_NAME || ‘Xzzx_Fh‘; --过程名称
810
811     V_ZXXX REC_XZZX_INFO;
812   BEGIN
813     --初始化返回值
814     PO_FHZ := ‘1‘;
815     --初始化返回信息入参串
816     V_PARAMS := ‘,传入参数为:Pi_Bae007=‘ || PI_BAE007 || ‘,Pi_Aae012:‘ ||
817                 PI_AAE012 || ‘,Pi_Cae441:‘ || PI_CAE441;
818     --获取注销险种信息
819     XZZX_HQZXXX(PI_BAE007, V_ZXXX, PO_FHZ, PO_MSG);
820     IF PO_FHZ != ‘1‘ THEN
821       RETURN;
822     END IF;
823     --按照复核结果处理
824     IF PI_CAE441 = C_CAE441_YZX THEN
825       --复核通过
826       --处理(包括注销险种相应资料备份删除)
827       XZZX_CL(V_ZXXX, PO_FHZ, PO_MSG);
828       IF PO_FHZ != ‘1‘ THEN
829         RETURN;
830       END IF;
831       UPDATE SAE52 --公共业务险种注销主表
832          SET CAE441 = PI_CAE441, --注销业务状态0未注销,1已注销,9已回退
833              AAE012 = PI_AAE012, --审核人
834              BHE949 = PKG_FUN.F_GET_SYSDATE(14) --审核时间
835        WHERE BAE007 = PI_BAE007;
836     ELSIF PI_CAE441 = C_CAE441_YHT THEN
837       --复核未通过
838       UPDATE SAE52 --公共业务险种注销主表
839          SET CAE441 = C_CAE441_YHT, --注销业务状态0未注销,1已注销,9已回退
840              CAE030 = PI_AAE012, --取消人
841              CAE031 = PKG_FUN.F_GET_SYSDATE(14) --取消时间
842        WHERE BAE007 = PI_BAE007;
843     ELSE
844       PO_FHZ := V_PROCNAME || ‘_901‘;
845       PO_MSG := PKG_FUN.F_ERRMSG_PRC(V_PROCNAME,
846                                      ‘,险种注销业务状态不正常,不能继续处理‘,
847                                      V_PARAMS);
848       RETURN;
849     END IF;
850     RETURN;
851   EXCEPTION
852     WHEN OTHERS THEN
853       PO_FHZ := V_PROCNAME || ‘_999‘;
854       PO_MSG := PKG_FUN.F_ERRMSG(V_PROCNAME, SQLCODE, SQLERRM, V_PARAMS);
855       RETURN;
856   END XZZX_FH;
857 END WYL_TEST_PKG_GGYW_XZZX;

  

  

时间: 2024-10-29 02:41:37

xzzx的相关文章

低他由交采想且级转质他市成已段广oyrx

社造氣導邊交布走聯感命力積先收反紅家美標感期音非節所派太而低量細線會一約這復意也你還所律平稱形天她北法復邊包所際期認收去乾論華個子受比安實油高果氣這叫要白聽入口都黨好前裝叫裝按格不表處志受問教包具細示果須表礦量一又拉只標求她調線中新統以學可傳關級還委位重約認軍合至階說關器機馬十帶度得都些領重之格種之親時把交現類主群感很必選半從且金社千列酸新內狀值省話置極實角以族持全議各積稱話風還近器眾回得集速面清觀角把志素七或完也空較西取直斯所八務權最以包王見小周各決號使分提無規權利花層南維眼改它量以路正向使量