帆软应该不支持 with 这种写法
select
TM1.编号,
TM1.操作人,
TM1.操作时间,
TM1.rn
FROM (
SELECT
id 编号,
reply_person 操作人,
reply_day 操作时间,
row_number() over (partition by id order by reply_day desc) rn
FROM test
where 1=1
${if(len(id号)=0 ,"","and id in ('"+id号+"')")}
) TM1
where TM1.rn<=1