public interface CompanyDao extends io.geewit.data.jpa.essential.repository.EntityGraphJpaRepository<Company,java.lang.Long>, io.geewit.data.jpa.essential.repository.EntityGraphJpaSpecificationExecutor<Company>, io.geewit.data.jpa.envers.repository.EnversRevisionRepository<Company,java.lang.Long,java.lang.String>, CompanyCustomizedDao
| 限定符和类型 | 方法和说明 |
|---|---|
long |
countAuditByTaxNumAndCompanyName(java.lang.String taxNum,
java.lang.String companyName) |
long |
countAuditByTaxNumAndCompanyNameAndEffectiveDate(java.lang.String taxNum,
java.lang.String companyName,
java.util.Date effectiveDate) |
void |
deleteById(java.lang.Long id) |
Company |
findByCompanyIdAndHostTenantId(long companyId,
long hostTenantId)
根据公司id和所属租户id获取公司信息
|
java.util.List<Company> |
findByIds(java.util.List<java.lang.Long> ids) |
java.util.List<Company> |
findByTaxNum(java.lang.String taxNum)
根据税号查询公司列表
|
Company |
findByTaxNumAndCompanyName(java.lang.String taxNum,
java.lang.String companyName)
根据公司税号和名称查找公司, 如果不一致返回null
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
findFixingCompanies()
查询
|
Tenant |
findHostTenantByCompanyId(long companyId) |
java.util.Optional<java.lang.Long> |
findIdByTaxNum(java.lang.String taxNum) |
java.util.List<ServicePackage> |
findPackagesByCompanyId(long companyId) |
int |
updateAuditEffective(long companyId,
long revision,
boolean effective)
公司审计表更新
|
long |
validateExistCompany(long companyId,
java.lang.String companyCode,
java.lang.String taxNum) |
long |
validateExistCompany(java.lang.String companyCode,
java.lang.String taxNum)
删除CompanyName校验
判断(公司代码,税号、名称)是否已存在
|
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlushcount, exists, findAll, findOnefindAll, findAllfindAll, findAllById, findByIdcount, delete, deleteAll, deleteAll, deleteAllById, existsById, findById, savefindAll, findAll, findAll, findOnecount, findAll, findAll, findAll, findOnefindComparedRevisions, findRevisionByLastUpdateTimefindLastChangeRevision, findRevision, findRevisions, findRevisionsfindCompanyHistoryByTaxNum, findCompanyMapByCompanyIds, findCompanyServicePackageByCompanyIds, findPackages, findTuples, pageHistoryByTaxNum@Transactional
@Modifying(clearAutomatically=true)
@Query(value="delete from Company c where c.companyId = :companyId")
void deleteById(@Param(value="companyId")
java.lang.Long id)
deleteById 在接口中 org.springframework.data.repository.CrudRepository<Company,java.lang.Long>@Transactional(readOnly=true) @Query(value="select new com.xforceplus.entity.ServicePackage(sp.servicePackageId, sp.servicePackageName, sp.appId) from com.xforceplus.entity.CompanyServiceRel csr left join com.xforceplus.entity.ServicePackage sp on sp.servicePackageId = csr.servicePackageId where csr.companyId = :companyId") java.util.List<ServicePackage> findPackagesByCompanyId(@Param(value="companyId") long companyId)
@Transactional(readOnly=true)
@Query(value="select count(c.companyId) from Company c where (c.companyCode = :companyCode or c.taxNum = :taxNum ) and c.companyId <> :companyId ")
long validateExistCompany(@Param(value="companyId")
long companyId,
@Param(value="companyCode")
java.lang.String companyCode,
@Param(value="taxNum")
java.lang.String taxNum)
companyId - companyCode - taxNum - @Transactional(readOnly=true) java.util.List<Company> findByTaxNum(@Param(value="taxNum") java.lang.String taxNum)
taxNum - 公司税号@Transactional(readOnly=true)
@Query(value="select count(c.companyId) from Company c where (c.companyCode = :companyCode or c.taxNum = :taxNum ) ")
long validateExistCompany(@Param(value="companyCode")
java.lang.String companyCode,
@Param(value="taxNum")
java.lang.String taxNum)
companyCode - 公司代码taxNum - 税号@Transactional(readOnly=true)
@Query(value="select o.tenant_id, o.company_id from sys_org_struct o LEFT JOIN (select rel.tenant_id, rel.company_id from bss_tenant_company_rel rel) as r ON o.tenant_id = r.tenant_id and o.company_id = r.company_id where r.tenant_id is null and r.company_id is null and o.tenant_id > 0 and o.company_id > 0 group by o.tenant_id, o.company_id",
nativeQuery=true)
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> findFixingCompanies()
@Transactional(readOnly=true)
@Query(value="select count(ca.revision) from bss_company_audit ca where ca.company_name = :companyName and ca.tax_num = :taxNum and ca.is_effective = 1",
nativeQuery=true)
long countAuditByTaxNumAndCompanyName(@Param(value="taxNum")
java.lang.String taxNum,
@Param(value="companyName")
java.lang.String companyName)
@Transactional(readOnly=true)
@Query(value="select count(ca.revision) from bss_company_audit ca where ca.company_name = :companyName and ca.tax_num = :taxNum and ca.effective_date <= :effectiveDate and ca.is_effective = 1",
nativeQuery=true)
long countAuditByTaxNumAndCompanyNameAndEffectiveDate(@Param(value="taxNum")
java.lang.String taxNum,
@Param(value="companyName")
java.lang.String companyName,
@Param(value="effectiveDate")
java.util.Date effectiveDate)
@Transactional
@Modifying(flushAutomatically=true)
@Query(value="update bss_company_audit ca set ca.is_effective = :effective where ca.company_id = :companyId and ca.revision = :revision",
nativeQuery=true)
int updateAuditEffective(@Param(value="companyId")
long companyId,
@Param(value="revision")
long revision,
@Param(value="effective")
boolean effective)
companyId - 公司idrevision - 版本号effective - 是否有效@Transactional(readOnly=true)
@Query(value="select c.company_id from bss_company c where c.tax_num = :taxNum",
nativeQuery=true)
java.util.Optional<java.lang.Long> findIdByTaxNum(@Param(value="taxNum")
java.lang.String taxNum)
@Transactional(readOnly=true) @Query(value="select c from Company c where c.companyId in (:ids)") java.util.List<Company> findByIds(@Param(value="ids") java.util.List<java.lang.Long> ids)
ids - 公司@Transactional(readOnly=true) @Query(value="select c from Company c where c.taxNum = :taxNum and c.companyName = :companyName") Company findByTaxNumAndCompanyName(@Param(value="taxNum") java.lang.String taxNum, @Param(value="companyName") java.lang.String companyName)
taxNum - 税号companyName - 公司名称@Transactional(readOnly=true) @Query(value="select c.hostTenant from Company c where c.companyId = :companyId") Tenant findHostTenantByCompanyId(@Param(value="companyId") long companyId)
@Transactional(readOnly=true) @Query(value="select c from Company c where c.companyId = :companyId and c.hostTenantId = :hostTenantId") Company findByCompanyIdAndHostTenantId(@Param(value="companyId") long companyId, @Param(value="hostTenantId") long hostTenantId)
companyId - 公司idhostTenantId - 所属租户id