@Query(value="select relation_id id from contract_relation where main_contract = ?1 union all select main_contract id from contract_relation where relation_id = ?1",nativeQuery=true)
List<Long>findRelationIds(StringcontractId);
@Query(value="select relation_id id from contract_relation where main_contract in ?1 union all select main_contract id from contract_relation where relation_id in ?1",nativeQuery=true)
List<BigInteger>findRelationIds(ListcontractId);
@Query(value="select * from contract_relation where main_contract = ?1 and relation_id = ?2 and platform = ?3",nativeQuery=true)
@Query(value="select * from contract where start_date >= ?1 and start_date <= ?2 and platform in ?3 and id in ?4 and status!='del' order by ds desc",nativeQuery=true)
@Query(value="select * from contract where start_date >= ?1 and start_date <= ?2 and platform in ?3 and create_account in ?4 and id in ?5 and status!='del' order by ds desc",nativeQuery=true)
@Query(value="select new map( c.id as id, c.contractCode as contractCode ) from Contract c where c.platform in ?1 and c.contractCode is not null and c.contractCode <> 'null' ")