JPA Query for using single column for 2 columns in dersired output


TID TStatus TDate
3 1 2020-02-20
3 2 2020-03-15


TID amount
3 9874

Desired Output :

Start End Amount
2020-02-20 2020-03-15 9874

Start(transaction.tdate where tstatus=1),End(transaction.tdate where tstatus=2)

How to write the jpa query for that: Something similar to JPA Repo

@Query(select new t.TDate,t.TDate from Transaction t)
List <Report> fetchReport();


select t1.Tdate as Start, t2.Tdate as End, a.amount as Amount
from Transaction t1
         inner join Transaction t2 on t1.TID = t2.TID
         inner join Amount a on t1.TID = a.TID
where t1.TDate < t2.TDate
      and t1.status = 1
      and t2.status = 2