packageuserio.repository;importorg.springframework.data.jpa.repository.JpaRepository;importorg.springframework.data.jpa.repository.Modifying;importorg.springframework.data.jpa.repository.Query;importorg.springframework.transaction.annotation.Transactional;importuserio.model.RoleAuth;importjava.math.BigInteger;importjava.util.Date;importjava.util.List;publicinterfaceIORoleAuthRepositoryextendsJpaRepository<RoleAuth,Long>{RoleAuthfindByRoleCategory(Longid);@Query(value="select * from role_auth where id in ?1 ",nativeQuery=true)List<RoleAuth>findCustomRoleList(List<Long>createAccounts);@Query(value="select * from role_auth where create_account in ?1 and del_flag is not true order by create_time desc ",nativeQuery=true)List<RoleAuth>findAllCustomRoleList(List<Long>createAccounts);@Query(value="select count(*) from role_auth where create_account in ?1 and role_name = ?2 and del_flag is not true",nativeQuery=true)BigIntegerfindByAccountAndName(List<Long>accountList,StringroleName);@Query(value="select count(*) from role_auth where create_account in ?1 and role_category = 4 and del_flag is not true",nativeQuery=true)BigIntegerfindCustomNumByAccount(List<Long>accountList);@Transactional@Modifying@Query(value="update role_auth set del_flag = true , modify_account = ?2, modify_time = ?3 where id = ?1 ",nativeQuery=true)intdeleteCustomRole(LongroleId,LongmodifyAccount,DatemodifyDate);}