以下是甲方旧报表的sql,他们是头部将finereport参数传给它,尾部直接调用数据库的参数,我要在sqlserver弄T+1再用KETTLE抽到MySQL中间库,最终是在帆软上调用这个mysql的中间库,难的是他们要求的时间维度有很多种,我应该怎么去改这个参数好呢?declare @startTime datetime ,@endTime datetime select @startTime='${startTime}' ,@endTime='${endTime}'--select @startTime = '2021-06-01', @endTime = '2021-06-10'SELECT f.FarmID, f.FarmName as '猪场', f.FarmName+line.LineName as '生产线', '' as '计划配种数', (select count(*) from (. as mating LEFT JOIN V_PigsArchives AS arc ON mating.PigsArchivesID = arc.PigsArchivesID LEFT JOIN Farm.T_Houses AS house ON house.HouseID = arc.HouseID) where mating.FirstMatingDate between @startTime and @endTime and house.ProductionLineID = line.ProductionLineID ) as '实际配种数', (select count(*) from (. as pre LEFT JOIN V_PigsArchives AS arc ON pre.PigsArchivesID = arc.PigsArchivesID LEFT JOIN Farm.T_Houses AS house ON house.HouseID = arc.HouseID) where pre.PregnancyTestDate between @startTime and @endTime and house.ProductionLineID = line.ProductionLineID and (pre.PregnancyTestResult = 2 or pre.PregnancyTestResult = 3) ) as '返情空怀', isnull((select count(*) from (. as pre LEFT JOIN V_PigsArchives AS arc ON pre.PigsArchivesID = arc.PigsArchivesID LEFT JOIN Farm.T_Houses AS house ON house.HouseID = arc.HouseID right join . death on arc.PigsArchivesID = death.PigsArchivesID) where pre.PregnancyTestDate between @startTime and @endTime and house.ProductionLineID = line.ProductionLineID and (pre.PregnancyTestResult = 2 or pre.PregnancyTestResult = 3) and (death.DeathDate between @startTime and @endTime or arc.EliminatedDate between @startTime and @endTime)),0) as '妊娠期淘汰数', (select count(*) from (. as pre LEFT JOIN V_PigsArchives AS arc ON pre.PigsArchivesID = arc.PigsArchivesID LEFT JOIN Farm.T_Houses AS house ON house.HouseID = arc.HouseID) where pre.PregnancyTestDate between @startTime and @endTime and house.ProductionLineID = line.ProductionLineID and (pre.PregnancyTestResult = 4) ) as '流产'(select count(*) from (. as change LEFT JOIN V_PigsArchives AS arc ON change.PigsArchivesID = arc.PigsArchivesID LEFT JOIN Farm.T_Houses AS house ON house.HouseID = arc.HouseID) where change.ChangeHouseDate between @startTime and @endTime and house.ProductionLineID = line.ProductionLineID ) as '场内调动'FROM . f right join . line on f.FarmID = line.FarmIDwhere f.OrganID = 1 and f.IsDeleted=0 and f.FarmName!='虚拟公猪站'${if(len(FarmID) == 0,""," and f.FarmID = '" + FarmID + "'")}${if(len(ProductionLineID) == 0,""," and line.ProductionLineID = '" + ProductionLineID + "'")}group by f.FarmID,f.FarmName, line.LineName, line.ProductionLineIDorder by f.FarmID