代码如下:
CREATE proc gedeshui
AS
begin
declare @js numeric
update gzk
--js=yfgz_js+yj_lr-bj_js-ybjf_kk-grjf_kk-njgrjf_kk-gz_jt-fg_jt
set @js=yfgz_js+yj_lr-bj_js-ybjf_kk-grjf_kk-njgrjf_kk-gz_jt-fg_jt,
gds_js=(@js-
case when @js<=2000 then
@js
when @js>2000 then
2000
end
)*
case when @js<=2000 then
0
when @js>2000 and @js<=2500 then
0.05
when @js>2500 and @js<=4000 then
0.1
when @js>4000 and @js<=7000 then
0.15
when @js>7000 then
0.2
end
-
case when @js<=2000 then
0
when @js>2000 and @js<=2500 then
0
when @js>2500 and @js<=4000 then
25
when @js>4000 and @js<=7000 then
125
when @js>7000 then
375