执法一张图、案件信息、现场检查等接口
This commit is contained in:
parent
146938b77f
commit
550a8de07d
|
|
@ -0,0 +1,127 @@
|
|||
package com.aisino.iles.lawenforcement.repository;
|
||||
|
||||
import com.aisino.iles.core.repository.BaseRepo;
|
||||
import com.aisino.iles.lawenforcement.model.EnforcementInfo;
|
||||
import com.aisino.iles.lawenforcement.model.dto.BigScreenDto;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 大屏统计接口
|
||||
*/
|
||||
@Repository
|
||||
public interface BigScreenRepository extends BaseRepo<EnforcementInfo, String> {
|
||||
|
||||
@Query(value = "select count(0) from zf_enterprise a left join zf_agency b on a.agency_id = b.agency_id where a.del_flag = '0' and b.agency_code like :agencyCode", nativeQuery = true)
|
||||
Long getqys(String agencyCode);
|
||||
|
||||
@Query(value = "select business_category business_category, count(0) num from zf_enterprise a left join zf_agency b on a.agency_id = b.agency_id " +
|
||||
"where a.del_flag = '0' and b.agency_code like :agencyCode group by business_category ", nativeQuery = true)
|
||||
List<Map<String, Object>> getqyfjfl(String agencyCode);
|
||||
|
||||
@Query(value = "select industry_type industry_type, count(0) num from zf_enterprise a left join zf_agency b on a.agency_id = b.agency_id " +
|
||||
"where a.del_flag = '0' and b.agency_code like :agencyCode group by industry_type ", nativeQuery = true)
|
||||
List<Map<String, Object>> getqyfjfl2(String agencyCode);
|
||||
|
||||
@Query(value = "select count(0) num from zf_case_info where file_path is not null", nativeQuery = true)
|
||||
Long getajs();
|
||||
|
||||
@Query(value = "with d as (select * from zf_agency where agency_level = 3) " +
|
||||
"select substring(d.agency_name, 1, 3) agency_name,ifnull(a.num, 0) num from d left join " +
|
||||
"(select c.agency_code agency_code, count(a.enforce_check_id) num from zf_enforce_check a " +
|
||||
"left join zf_enforcement_info b on a.enforcement_id = b.enforcement_id " +
|
||||
"left join zf_agency c on b.agency_id = c.agency_id where a.create_time >= :startTime " +
|
||||
"and a.create_time <= :endTime and c.agency_code is not null " +
|
||||
"group by c.agency_code) a on d.agency_code = a. agency_code ", nativeQuery = true)
|
||||
List<Map<String, Object>> getzfjcs(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
@Query(value = "select count(0) num from zf_case_info", nativeQuery = true)
|
||||
Long getajzs();
|
||||
|
||||
@Query(value = "select count(0) from zf_case_info where is_punishment = '1'", nativeQuery = true)
|
||||
Long getajcfs();
|
||||
|
||||
@Query(value = "select check_type check_type, count(0) num from zf_enforce_check group by check_type", nativeQuery = true)
|
||||
List<Map<String, Object>> getzfxs();
|
||||
|
||||
@Query(value = "select kind check_type, count(0) num from zf_auto_enforcement_plan group by kind", nativeQuery = true)
|
||||
List<Map<String, Object>> getzdzfs();
|
||||
|
||||
@Query(value = "select count(0) sum from zf_supervision_check", nativeQuery = true)
|
||||
Long getzxjcs();
|
||||
|
||||
@Query(value = "select count(0) sum from zf_report_check", nativeQuery = true)
|
||||
Long gettsjbs();
|
||||
|
||||
@Query(value = "select a.case_source_code case_source_code,count(0) num from zf_case_info a " +
|
||||
"left join zf_agency b on a.agency_id = b.agency_id where b.agency_code like :agencyCode group by case_source_code ", nativeQuery = true)
|
||||
List<Map<String, Object>> getajly(String agencyCode);
|
||||
@Query("""
|
||||
select new com.aisino.iles.lawenforcement.model.dto.BigScreenDto(a.caseSourceCode, count(a)) from Case a
|
||||
where a.createdTime >= :startTime and a.createdTime <= :endTime group by a.caseSourceCode""")
|
||||
List<BigScreenDto> getajly(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
@Query(name = "getjfjcByMonth")
|
||||
List<Map<String, Object>> getjfjcByMonth(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
@Query(name = "getjfjcByYear")
|
||||
List<Map<String, Object>> getjfjcByYear(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
@Query(name = "getsaslByMonth")
|
||||
List<Map<String, Object>> getsaslByMonth(LocalDate startTime, LocalDate endTime);
|
||||
|
||||
@Query(name = "getsaslByYear")
|
||||
List<Map<String, Object>> getsaslByYear(LocalDate startTime, LocalDate endTime);
|
||||
|
||||
@Query(value = "with d as (select * from zf_agency where agency_level = 3) " +
|
||||
"select substring(d.agency_name, 1, 3) agency_name,coalesce(b.num, 0) num from d left join " +
|
||||
"(select b.agency_id agency_id, count(0) num from zf_enforce_check a left join zf_enforcement_info b " +
|
||||
"on a.enforcement_id = b.enforcement_id where b.agency_id is not null group by b.agency_id) b on d.agency_id = b.agency_id ", nativeQuery = true)
|
||||
List<Map<String, Object>> getjctj(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
@Query(value = "with d as (select * from zf_agency where agency_level = 3) " +
|
||||
"select substring(d.agency_name, 1, 3) agency_name,coalesce(b.num, 0) num from d left join " +
|
||||
"(select agency_id agency_id, count(0) num from zf_case_info where agency_id is not null group by agency_id) " +
|
||||
"b on d.agency_id = b.agency_id ", nativeQuery = true)
|
||||
List<Map<String, Object>> getajtj(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
@Query(value = "with d as (select * from zf_agency where agency_level = 3) " +
|
||||
"select substring(d.agency_name, 1, 3) agency_name,coalesce(b.num, 0) num from d left join " +
|
||||
"(select agency_id agency_id, sum(coalesce(cast(decide_payment as numeric(10,2)), 0)) num from " +
|
||||
"zf_case_info where agency_id is not null group by agency_id) b on d.agency_id = b.agency_id ", nativeQuery = true)
|
||||
List<Map<String, Object>> getcfjetj(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
@Query(value = "with d as (select * from zf_agency where agency_level = 3) " +
|
||||
"select substring(d.agency_name, 1, 3) agency_name,coalesce(b.num, 0) num from d left join " +
|
||||
"(select agency_id agency_id, count(0) num from zf_enforcement_info where current_node_code = 'done' " +
|
||||
"and agency_id is not null group by agency_id) b on d.agency_id = b.agency_id ", nativeQuery = true)
|
||||
List<Map<String, Object>> getrwwj(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
@Query(value = "with d as (select * from zf_agency where agency_level = 3) " +
|
||||
"select substring(d.agency_name, 1, 3) agency_name,coalesce(b.sum_num, 0) zs,coalesce(b.wjs, 0) wjs " +
|
||||
"from d left join (select zf_en.agency_id agency_id, count(0) sum_num, sum(case when zf_en.current_node_code = 'done' then 1 else 0 end) wjs " +
|
||||
"from zf_enforcement_info zf_en where zf_en.data_from = '4' and zf_en.agency_id is not null group by zf_en.agency_id " +
|
||||
") b on d.agency_id = b.agency_id ", nativeQuery = true)
|
||||
List<Map<String, Object>> getjdjcjh();
|
||||
|
||||
@Query(value = "select count(0) from zf_enforcement_info where create_time >= :startTime and create_time <= :endTime ", nativeQuery = true)
|
||||
Long getZfdxsl(LocalDateTime startTime, LocalDateTime endTime);
|
||||
|
||||
@Query(value = "select check_type checktype, plan_id planid, count(0) num, " +
|
||||
"sum(case when check_type = '5' then 1 else 0 end) as zxjcs, " +
|
||||
"sum(case when check_type = '5' and check_status = '2' then 1 else 0 end) as zxjcwcs, " +
|
||||
"sum(case when check_type = '6' then 1 else 0 end) as jbtss, " +
|
||||
"sum(case when check_type = '6' and check_status = '2' then 1 else 0 end) as jbtswcs, " +
|
||||
"sum(case when check_type = '7' then 1 else 0 end) as zdqyjcs, " +
|
||||
"sum(case when check_type = '7' and check_status = '2' then 1 else 0 end) as zdqyjcwcs, " +
|
||||
"sum(case when check_type = '8' then 1 else 0 end) as ssjjcs, " +
|
||||
"sum(case when check_type = '8' and check_status = '2' then 1 else 0 end) as ssjjcwcs " +
|
||||
"from zf_enforce_check where check_type is not null and plan_id is not null group by check_type, plan_id ", nativeQuery = true)
|
||||
List<Map<String, Object>> rwwctj();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.aisino.iles.lawenforcement.repository;
|
||||
|
||||
import com.aisino.iles.core.repository.BaseRepo;
|
||||
import com.aisino.iles.lawenforcement.model.Case;
|
||||
import com.aisino.iles.lawenforcement.model.dto.EnforceCheckDto;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface CaseRepository extends BaseRepo<Case, String> {
|
||||
Optional<Case> findByEnforcementInfoEnforcementId(String enforcementId);
|
||||
|
||||
@Query("select new com.aisino.iles.lawenforcement.model.dto.EnforceCheckDto(concat(year(e.fillingDate),'-',month(e.fillingDate)), cast(count(1) as long))" +
|
||||
" from Case e where e.fillingDate >= :start and e.fillingDate <= :end group by concat(year(e.fillingDate),'-',month(e.fillingDate))")
|
||||
List<EnforceCheckDto> caseGroupByMonth(LocalDate start, LocalDate end);
|
||||
|
||||
/**
|
||||
* 判断是否存在隶属于某机构的案件
|
||||
* @param agencyId 机构ID
|
||||
* @return 是否存在
|
||||
*/
|
||||
boolean existsByAgencyId(String agencyId);
|
||||
|
||||
@Query(value = " select count(1) as zs, sum(case when a.status in ('filed', 'investigating', 'investigation_done', 'analyze_judge') then 1 else 0 end) as wbjs, " +
|
||||
"sum(case when a.status in ('closing', 'archived') then 1 else 0 end) as ybjs, sum(coalesce(cast(a.decide_payment as numeric(10,2)), 0)) cfje from " +
|
||||
"zf_case_info a left join zf_agency b on a.agency_id = b.agency_id where b.agency_code like :agencyCode", nativeQuery = true)
|
||||
Map<String, Long> ajtj(String agencyCode);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.aisino.iles.lawenforcement.repository;
|
||||
|
||||
import com.aisino.iles.core.repository.BaseRepo;
|
||||
import com.aisino.iles.lawenforcement.model.CheckItem;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface CheckItemRepository extends BaseRepo<CheckItem, String> {
|
||||
|
||||
List<CheckItem> findByItemIdIn(String[] ids);
|
||||
|
||||
List<CheckItem> findByEnabled(Boolean enable);
|
||||
|
||||
List<CheckItem> findByItemTableAndEnabled(String itemTable, Boolean enabled);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.aisino.iles.lawenforcement.repository;
|
||||
|
||||
import com.aisino.iles.core.repository.BaseRepo;
|
||||
import com.aisino.iles.lawenforcement.model.Checklist;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface ChecklistRepository extends BaseRepo<Checklist, String> {
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.aisino.iles.lawenforcement.repository;
|
||||
|
||||
import com.aisino.iles.core.repository.BaseRepo;
|
||||
import com.aisino.iles.lawenforcement.model.DangerInfo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface DangerInfoRepository extends BaseRepo<DangerInfo, String> {
|
||||
}
|
||||
Loading…
Reference in New Issue