动态数据管理相关接口
This commit is contained in:
parent
b42961ebda
commit
e2e57d64a2
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.DeliveryRecord;
|
||||||
|
import com.aisino.iles.lawenforcement.model.dto.DeliveryRecordStatisticsDto;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface DeliveryRecordRepository extends BaseRepo<DeliveryRecord, String> {
|
||||||
|
|
||||||
|
@Query("select new com.aisino.iles.lawenforcement.model.dto.DeliveryRecordStatisticsDto(j.agencySimpleCode," +
|
||||||
|
" a.deliveryMethodId, cast(count(a) as long))" +
|
||||||
|
" from DeliveryRecord a join Case b on a.caseInfo = b join EnforcementInfo e on b.enforcementInfo = e join Agency j on e.agency = j" +
|
||||||
|
" where j.agencyCode like :agencyCode" +
|
||||||
|
" group by j.agencySimpleCode, a.deliveryMethodId")
|
||||||
|
List<DeliveryRecordStatisticsDto> statistics(String agencyCode);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.EnterpriseAudit;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface EnterpriseAuditRepository extends BaseRepo<EnterpriseAudit, String> {
|
||||||
|
boolean existsByUnifiedSocialCodeAndDelFlag(String unifiedSocialCode, Short delFlag);
|
||||||
|
|
||||||
|
boolean existsByUnifiedSocialCodeAndDelFlagAndEnterpriseIdNot(String unifiedSocialCode, Short delFlag, String enterpriseId);
|
||||||
|
|
||||||
|
boolean existsByLegalPhoneAndDelFlag(String legalphone, Short delFlag);
|
||||||
|
|
||||||
|
boolean existsByLegalPhoneAndDelFlagAndEnterpriseIdNot(String legalphone, Short delFlag, String enterpriseId);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.EnterpriseCamera;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface EnterpriseCameraRepository extends BaseRepo<EnterpriseCamera, String> {
|
||||||
|
|
||||||
|
@Query(value = "select a.unifiedSocialCode as unified_social_code, count(a) as num from EnterpriseCamera a " +
|
||||||
|
"where a.unifiedSocialCode in :codes group by a.unifiedSocialCode ", nativeQuery = true)
|
||||||
|
List<Map<String, Object>> countGroupByUnifiedSocialCode(@Param("codes") List<String> codes);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.EnterpriseHistory;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业历史记录仓库接口
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface EnterpriseHistoryRepository extends BaseRepo<EnterpriseHistory, String> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,137 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.Enterprise;
|
||||||
|
import com.aisino.iles.lawenforcement.model.dto.EnterpriseStatisticsDto;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业信息仓库接口
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface EnterpriseRepository extends BaseRepo<Enterprise, String> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据社会统一信用代码查询企业
|
||||||
|
*
|
||||||
|
* @param unifiedSocialCode 社会统一信用代码
|
||||||
|
* @return 企业信息
|
||||||
|
*/
|
||||||
|
Optional<Enterprise> findByUnifiedSocialCode(String unifiedSocialCode);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据单位名称模糊查询企业列表
|
||||||
|
*
|
||||||
|
* @param unitName 单位名称
|
||||||
|
* @return 企业列表
|
||||||
|
*/
|
||||||
|
List<Enterprise> findByUnitNameContaining(String unitName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据所属管辖机构ID查询企业列表
|
||||||
|
*
|
||||||
|
* @param jurisdictionId 管辖机构ID
|
||||||
|
* @return 企业列表
|
||||||
|
*/
|
||||||
|
// List<Enterprise> findByJurisdictionId(String jurisdictionId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据行业类型查询企业列表
|
||||||
|
*
|
||||||
|
* @param industryType 行业类型
|
||||||
|
* @return 企业列表
|
||||||
|
*/
|
||||||
|
List<Enterprise> findByIndustryType(String industryType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据风险类别查询企业列表
|
||||||
|
*
|
||||||
|
* @param riskCategory 风险类别
|
||||||
|
* @return 企业列表
|
||||||
|
*/
|
||||||
|
List<Enterprise> findByRiskCategory(String riskCategory);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据行业类型查询企业列表
|
||||||
|
*
|
||||||
|
* @param orgCode 机构代码
|
||||||
|
* @return 企业列表 Enterprise
|
||||||
|
*/
|
||||||
|
List<Enterprise> findByAgencyAgencyCodeLike(String orgCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据行业类型查询企业列表
|
||||||
|
*
|
||||||
|
* @param agencyId 机构id
|
||||||
|
* @return 企业列表 Enterprise
|
||||||
|
*/
|
||||||
|
List<Enterprise> findByAgencyAgencyId(String agencyId);
|
||||||
|
|
||||||
|
@Query("select new com.aisino.iles.lawenforcement.model.dto.EnterpriseStatisticsDto(b.agencySimpleCode," +
|
||||||
|
" a.industryType, cast(count(a) as long))" +
|
||||||
|
" from Enterprise a join Agency b on a.agency = b" +
|
||||||
|
" where a.delFlag = 0 and b.agencyCode like :agencyCode" +
|
||||||
|
" group by b.agencySimpleCode, a.industryType")
|
||||||
|
List<EnterpriseStatisticsDto> ledgerStatistics(String agencyCode);
|
||||||
|
|
||||||
|
@Query("select new com.aisino.iles.lawenforcement.model.dto.EnterpriseStatisticsDto(b.agencySimpleCode," +
|
||||||
|
" a.industryType, cast(count(a) as long))" +
|
||||||
|
" from Enterprise a join Agency b on a.agency = b" +
|
||||||
|
" where a.delFlag = 0 and b.agencyCode like :agencyCode and a.entryTime >= :start and a.entryTime <= :end" +
|
||||||
|
" group by b.agencySimpleCode, a.industryType")
|
||||||
|
List<EnterpriseStatisticsDto> ledgerStatisticsByEntryTime(String agencyCode, LocalDateTime start, LocalDateTime end);
|
||||||
|
|
||||||
|
boolean existsByUnifiedSocialCodeAndDelFlag(String unifiedSocialCode, Short delFlag);
|
||||||
|
|
||||||
|
boolean existsByUnifiedSocialCodeAndDelFlagAndEnterpriseIdNot(String unifiedSocialCode, Short delFlag, String enterpriseId);
|
||||||
|
|
||||||
|
boolean existsByLegalPhoneAndDelFlag(String legalphone, Short delFlag);
|
||||||
|
|
||||||
|
boolean existsByLegalPhoneAndDelFlagAndEnterpriseIdNot(String legalphone, Short delFlag, String enterpriseId);
|
||||||
|
|
||||||
|
List<Enterprise> findByUnifiedSocialCodeIn(Collection<String> unifiedSocialCodes);
|
||||||
|
List<Enterprise> findByUnitNameInAndDelFlag(Collection<String> unitNames, Short delFlag);
|
||||||
|
|
||||||
|
@Query("select new com.aisino.iles.lawenforcement.model.dto.EnterpriseStatisticsDto(a.industryType, cast(count(a) as long))" +
|
||||||
|
" from Enterprise a join Agency b on a.agency = b" +
|
||||||
|
" where a.delFlag = 0 and b.agencyCode like :agencyCode" +
|
||||||
|
" group by a.industryType")
|
||||||
|
List<EnterpriseStatisticsDto> visualizeStatistics(String agencyCode);
|
||||||
|
|
||||||
|
List<Enterprise> findByAgency_AgencyCodeLikeAndDelFlag(String agencyCode, short delFlag);
|
||||||
|
|
||||||
|
@Query("select count(a) from Enterprise a where a.delFlag = 0 and (a.videoAccess = '1' or a.perceptionAccess = '1' or a.infoAccess = '1' or a.permitAccess = '1')")
|
||||||
|
Long findQyjrtj();
|
||||||
|
|
||||||
|
@Query("select a.industryType as industry_type, count(a) as num from Enterprise a where a.delFlag = 0 and (a.videoAccess = '1' or a.perceptionAccess = '1' or a.infoAccess = '1' or a.permitAccess = '1') group by a.industryType")
|
||||||
|
List<Map<String, Object>> findQyjrlxtj();
|
||||||
|
|
||||||
|
@Query("select count(a) from Enterprise a where a.delFlag = 0 and a.econCategory = 'E' and (a.videoAccess = '1' or a.perceptionAccess = '1' or a.infoAccess = '1' or a.permitAccess = '1')")
|
||||||
|
Long findQyjzsgtj();
|
||||||
|
|
||||||
|
@Query("select count(a) from Enterprise a where a.delFlag = 0 and a.econCategoryTypeb = '851' and (a.videoAccess = '1' or a.perceptionAccess = '1' or a.infoAccess = '1' or a.permitAccess = '1')")
|
||||||
|
Long findQyyytj();
|
||||||
|
|
||||||
|
@Query("select count(a) from Enterprise a join Agency b on a.agency = b where a.delFlag = 0 and a.econCategory = 'E' and b.agencyCode like :agencyCode")
|
||||||
|
Long buildingConstruction(String agencyCode);
|
||||||
|
|
||||||
|
@Query("select count(a) from Enterprise a join Agency b on a.agency = b where a.delFlag = 0 and a.econCategoryTypeb = '851' and b.agencyCode like :agencyCode")
|
||||||
|
Long hospital(String agencyCode);
|
||||||
|
|
||||||
|
@Query("select count(a) from Enterprise a join Agency b on a.agency = b where a.delFlag = 0" +
|
||||||
|
" and (a.econCategory <> 'E' or a.econCategory is null)" +
|
||||||
|
" and (a.econCategoryTypeb <> '851' or a.econCategoryTypeb is null)" +
|
||||||
|
" and b.agencyCode like :agencyCode")
|
||||||
|
Long ohter(String agencyCode);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.EnterpriseWarn;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业预警信息仓库接口
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface EnterpriseWarnRepository extends BaseRepo<EnterpriseWarn, String> {
|
||||||
|
|
||||||
|
@Query("select a.eventDesc as eventDesc, count(a) as num from EnterpriseWarn a group by a.eventDesc")
|
||||||
|
List<Map<String, Object>> getNumGroupByEventDesc();
|
||||||
|
|
||||||
|
@Query(value = "select a.unifiedSocialCode as unified_social_code, count(a) as num from EnterpriseWarn a " +
|
||||||
|
"where a.unifiedSocialCode in :codes group by a.unifiedSocialCode ", nativeQuery = true)
|
||||||
|
List<Map<String, Object>> countGroupByUnifiedSocialCode(@Param("codes") List<String> codes);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.EquipmentHistoryVideo;
|
||||||
|
import org.springframework.data.jpa.domain.Specification;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface EquipmentHistoryVideoRepository extends BaseRepo<EquipmentHistoryVideo, String> {
|
||||||
|
boolean existsByLssjid(String lssjid);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按装备代码查询 装备信息
|
||||||
|
* @param zbdm
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EquipmentHistoryVideo> findByZbdm(String zbdm);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue