|
@ -1,10 +1,12 @@
|
|
|
package com.yihu.ehr.basic.org.dao;
|
|
|
|
|
|
import com.yihu.ehr.basic.org.model.Organization;
|
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
import org.springframework.data.repository.PagingAndSortingRepository;
|
|
|
import org.springframework.data.repository.query.Param;
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@ -21,7 +23,7 @@ public interface OrganizationRepository extends PagingAndSortingRepository<Organ
|
|
|
List<String> fingIdsByFullnameOrShortName(@Param("name") String name);
|
|
|
|
|
|
@Query("select org from Organization org where org.admin = :adminLoginCode and org.orgCode = :orgCode")
|
|
|
List<Organization>findByOrgAdmin(@Param("orgCode") String orgCode,@Param("adminLoginCode") String adminLoginCode);
|
|
|
List<Organization> findByOrgAdmin(@Param("orgCode") String orgCode, @Param("adminLoginCode") String adminLoginCode);
|
|
|
|
|
|
@Query("select org from Organization org where org.orgCode in (:orgCodes)")
|
|
|
List<Organization> findByOrgCodes(@Param("orgCodes") List<String> orgCodes);
|
|
@ -39,7 +41,7 @@ public interface OrganizationRepository extends PagingAndSortingRepository<Organ
|
|
|
List<Organization> findOrgByCode(@Param("orgCode") String orgCode);
|
|
|
|
|
|
@Query("select org from Organization org where org.id=:orgId and org.parentHosId=:orgPId")
|
|
|
List<Organization> checkSunOrg(@Param("orgPId") int orgPId,@Param("orgId") long orgId);
|
|
|
List<Organization> checkSunOrg(@Param("orgPId") int orgPId, @Param("orgId") long orgId);
|
|
|
|
|
|
@Query("select org from Organization org where org.fullName like %:name% or org.shortName like %:name%")
|
|
|
List<Organization> fingorgByFullnameOrShortName(@Param("name") String name);
|
|
@ -65,7 +67,7 @@ public interface OrganizationRepository extends PagingAndSortingRepository<Organ
|
|
|
@Query("select org.id from Organization org where org.orgCode in(:orgCode)")
|
|
|
List<String> getIdByOrgCode(@Param("orgCode") List<String> orgCode);
|
|
|
|
|
|
@Query("select org from Organization org where org.orgType='Hospital' and org.ing !='' and org.ing is not null and org.lat!='' and org.lat is not null" )
|
|
|
@Query("select org from Organization org where org.orgType='Hospital' and org.ing !='' and org.ing is not null and org.lat!='' and org.lat is not null")
|
|
|
List<Organization> getHospital();
|
|
|
|
|
|
@Query(value = "SELECT org.* from Organizations org WHERE org.administrative_division in(SELECT id from address_dict where pid = :pid)", nativeQuery = true)
|
|
@ -79,4 +81,19 @@ public interface OrganizationRepository extends PagingAndSortingRepository<Organ
|
|
|
|
|
|
@Query(value = "SELECT org.* from Organizations org WHERE org.administrative_division = :administrativeDivision and org.full_name like %:fullName% ", nativeQuery = true)
|
|
|
List<Organization> getOrgListByAreaidAndParam(@Param("administrativeDivision") Integer administrativeDivision, @Param("fullName") String fullName);
|
|
|
|
|
|
List<Organization> findByBaseOrgCodeIsNull();
|
|
|
|
|
|
List<Organization> findByBaseOrgCodeIsNullAndFullNameLike(String fullName);
|
|
|
|
|
|
List<Organization> findByBaseOrgCode(String baseOrgCode);
|
|
|
|
|
|
List<Organization> findByBaseOrgCodeAndFullNameLike(String baseOrgCode, String fullName);
|
|
|
|
|
|
Organization findFirstByOrgCode(String orgCode);
|
|
|
|
|
|
@Modifying
|
|
|
@Transactional
|
|
|
@Query(value = "update Organization p set p.baseOrgCode=:baseOrgCode where p.orgCode in (:orgCodes)")
|
|
|
void updateByOrgCodes(@Param("baseOrgCode") String baseOrgCode, @Param("orgCodes") List<String> orgCodes);
|
|
|
}
|