这玩意写得脑壳痛
with test_A as (
select '202232' test,
'202230' test1,
'测试数据' txt
)
select * from test_A
where test1>=(
select
case when SUBSTRING(CONVERT(char(10),CONVERT(int,test) + ${p_numberEditor0}), 5, 2) < 52 then CONVERT(int,test) + ${p_numberEditor0}
when SUBSTRING(CONVERT(char(10),CONVERT(int,test) + ${p_numberEditor0}), 5, 2)-52 < 10 then CONVERT(char(4),CONVERT(int,SUBSTRING(test,1,4)) + 1) + '0' +CONVERT(char(2),(SUBSTRING(CONVERT(char(10),CONVERT(int,test) + ${p_numberEditor0}), 5, 2)-52))
when SUBSTRING(CONVERT(char(10),CONVERT(int,test) + ${p_numberEditor0}), 5, 2)-52 > 9 then CONVERT(char(4),CONVERT(int,SUBSTRING(test,1,4)) + 1)+CONVERT(char(2),SUBSTRING(CONVERT(char(10),CONVERT(int,test) + ${p_numberEditor0}), 5, 2)-52)
end
from test_A)