日期:2014-05-16 浏览次数:20779 次
DECLARE @iscontr2 float
SELECT @iscontr2=POWER(( a.ori_value - b.min_2014 ) / ( b.max_2014- b.min_2014 ),
1.4) * 40 + 60
FROM court_stat a
INNER JOIN range_rule b ON a.index_id = b.index_id
UPDATE a
SET a.eva_score = CASE WHEN b.variation_char = 1
AND a.eva_score > b.min_2014 THEN 60
WHEN b.variation_char = 2
AND a.eva_score < b.min_2014 THEN 60
ELSE ( CASE WHEN @iscontr2 < 60 THEN 60
WHEN @iscontr2 > 100 THEN 100
ELSE @iscontr2
END )
END
FROM court_stat a
INNER JOIN range_rule b ON a.index_id = b.index_id
GO
UPDATE dbo.court_stat
SET ded_score = CASE WHEN eva_score < 80 THEN ( 80 - eva_score ) * 0.01
ELSE 0
END
FROM court_stat a
INNER JOIN range_rule b ON a.index_id = b.i