package Ġcom . hub t work . k atar ina . statistics . matcher api . repository Ċ Ċ import Ġcom . hub t work . k atar ina . statistics . matcher api . domain . User With Match Ċ import Ġorg . springframework . data . jpa . repository . Jpa Repository Ċ import Ġorg . springframework . data . jpa . repository . Query Ċ import Ġorg . springframework . data . repository . query . Param Ċ import Ġorg . springframework . stereotype . Repository Ċ Ċ @ Repository Ċ interface ĠUser With Match Repository : ĠJ pa Repository < User With Match , ĠString > Ċ { ĊĠĠĠ Ġ@ Query (" select Ġ 1 Ġas Ġcnt Ġfrom Ġdual Ġ" Ġ+ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" where Ġexists Ġ( Ġselect Ġ 1 Ġfrom Ġsearch _ user match Ġwhere Ġmatch Id Ġ= Ġ: target Match Id )", Ġnative Query Ġ= Ġtrue ) ĊĠĠĠ Ġfun Ġcheck Is Match Already Sc anned (@ Param (" target Match Id ") match Id : ĠLong ): ĠInt ĊĊĠĠĠ Ġ@ Query (" select Ġ* Ġfrom Ġsearch _ user match Ġwhere ĠaccountId = Ġ: target Sum mon er Ġorder Ġby Ġmatch EndTime ", Ġnative Query Ġ= Ġtrue ) ĊĠĠĠ Ġfun Ġget Matches By AccountId (@ Param (" target Sum mon er ") accountId : ĠString ): ĠList < User With Match > ĊĊĊĠĠĠ Ġ@ Query (" select Ġ* Ġfrom Ġsearch _ user match Ġwhere ĠaccountId = Ġ: target Sum mon er Ġorder Ġby Ġmatch EndTime Ġlimit Ġ 1 ", Ġnative Query Ġ= Ġtrue ) ĊĠĠĠ Ġfun ĠgetLast Match By AccountId (@ Param (" target Sum mon er ") accountId : ĠString ): ĠUser With Match ĊĊĠĠĠ Ġ@ Query (" select Ġmatch Id Ġfrom Ġsearch _ user match Ġwhere ĠaccountId = Ġ: accountId Ġorder Ġby Ġmatch EndTime ", Ġnative Query Ġ= Ġtrue ) ĊĠĠĠ Ġfun Ġget Match By AccountId (@ Param (" accountId ") accountId : ĠString ): ĠLong ĊĊĠĠĠ Ġ@ Query (" select Ġqueue Type Ġfrom Ġsearch _ user match Ġwhere ĠaccountId = Ġ: accountId Ġorder Ġby Ġmatch EndTime ", Ġnative Query Ġ= Ġtrue ) ĊĠĠĠ Ġfun Ġget Queue Type By AccountId (@ Param (" accountId ") accountId : ĠString ): ĠInt ĊĊĠĠĠ Ġ@ Query (" select Ġmatch Id , queue Type Ġfrom Ġsearch _ user match Ġwhere ĠaccountId = Ġ: accountId Ġorder Ġby Ġmatch EndTime ", Ġnative Query Ġ= Ġtrue ) ĊĠĠĠ Ġfun Ġget Match And Queue Type By AccountId (@ Param (" accountId ") accountId : ĠString ): ĠList < Map < Long , Int >> ĊĊĠĠĠ Ġ@ Query (" drop Ġtable Ġsearch _ user match ", native Query Ġ= Ġtrue ) ĊĠĠĠ Ġfun Ġdrop User With Match () ĊĊ Ċ }