在线巡查、组织机构等接口类
This commit is contained in:
parent
f7bf2df07c
commit
dddb1c51ef
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.NoticeReceivingUnit;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface NoticeReceivingUnitRepository extends BaseRepo<NoticeReceivingUnit, String> {
|
||||||
|
List<NoticeReceivingUnit> findByNoticeId(String noticeId);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("update NoticeReceivingUnit t set t.msgflag = '1' , t.collectionTime=:collectionTime where t.noticeId=:noticeId and t.receivingUnitId=:receivingUnitId and t.msgflag='0'")
|
||||||
|
void modifyByNoticeIdAndReceivingUnitId(@Param("collectionTime") LocalDateTime collectionTime, @Param("noticeId") String noticeId, @Param("receivingUnitId") String receivingUnitId);
|
||||||
|
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("delete from NoticeReceivingUnit t where t.noticeId = :noticeId")
|
||||||
|
void deleteBynoticeId(@Param("noticeId") String noticeId);
|
||||||
|
|
||||||
|
Optional<NoticeReceivingUnit> findByNoticeIdAndReceivingUnitId(String noticeId, String receivingUnitId);
|
||||||
|
|
||||||
|
long countByReceivingUnitIdAndMsgflag(String receivingUnitId,String msgflag);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.Notice;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface NoticeRepository extends BaseRepo<Notice, String> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.Officer;
|
||||||
|
import com.aisino.iles.lawenforcement.model.dto.OfficerDto;
|
||||||
|
import org.springframework.data.jpa.repository.EntityGraph;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执法人员仓库接口
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface OfficerRepository extends BaseRepo<Officer, String> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据执法证号查询执法人员
|
||||||
|
*
|
||||||
|
* @param certificateNo 执法证号
|
||||||
|
* @return 执法人员信息
|
||||||
|
*/
|
||||||
|
Optional<Officer> findByCertificateNo(String certificateNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 带机构实体图的唯一查询(按系统用户ID)
|
||||||
|
*/
|
||||||
|
@EntityGraph(value = "officer-with-agency", type = org.springframework.data.jpa.repository.EntityGraph.EntityGraphType.FETCH)
|
||||||
|
Optional<Officer> findWithAgencyByCertificateNo(String certificateNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据执法号查询执法人员
|
||||||
|
* @param lawNo 执法号
|
||||||
|
* @return 执法人员
|
||||||
|
*/
|
||||||
|
Optional<Officer> findByLawNo(String lawNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据所属执法机构ID查询执法人员列表
|
||||||
|
*
|
||||||
|
* @param agencyId 执法机构ID
|
||||||
|
* @return 执法人员列表
|
||||||
|
*/
|
||||||
|
List<Officer> findByAgencyId(String agencyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据执法人员姓名模糊查询执法人员列表
|
||||||
|
*
|
||||||
|
* @param officerName 执法人员姓名
|
||||||
|
* @return 执法人员列表
|
||||||
|
*/
|
||||||
|
List<Officer> findByOfficerNameContaining(String officerName);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据管辖单位编码查询执法人员列表
|
||||||
|
* @param gxdwbm
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Query(value = "select a.officer_id ,a.officer_name ,a.certificate_no,b.agency_id,b.agency_code,b.agency_name,b.agency_level from zf_officer a left join zf_agency b on a.agency_id = b.agency_id and b.agency_code like :gxdwbm " , nativeQuery = true)
|
||||||
|
List<OfficerDto> findByAgencyCode(String gxdwbm);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据执法证号查询执法人员及机构关联信息
|
||||||
|
* @param certificateNo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Query(value = "select a.officer_id as officerId ,a.officer_name as officerName ," +
|
||||||
|
" a.certificate_no as certificateNo, a.law_no as lawNo, a.contact_phone as contactPhone, b.agency_id as agencyId," +
|
||||||
|
" b.agency_code as agencyCode,b.agency_name as agencyName,b.agency_level as agencyLevel from zf_officer a, zf_agency b where a.agency_id = b.agency_id and a.certificate_no = :certificateNo ", nativeQuery = true)
|
||||||
|
Optional<OfficerDto> findByAgencyCertificateNo(String certificateNo);
|
||||||
|
|
||||||
|
@Query("select new com.aisino.iles.lawenforcement.model.dto.OfficerDto(a.officerId ,a.officerName ,a.certificateNo, a.lawNo, a.contactPhone, " +
|
||||||
|
"b.agencyId,b.agencyCode,b.agencyName,b.agencyLevel) from Officer a left join Agency b on a.agency = b and b.agencyCode like :gxdwbm ")
|
||||||
|
List<OfficerDto> findByAgencyCodeLike(String gxdwbm);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.OnlinePatrol;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface OnlinePatrolRepository extends BaseRepo<OnlinePatrol, String> {
|
||||||
|
@Query(name = "getfxczfByMonth")
|
||||||
|
List<Map<String, Object>> getfxczfByMonth(LocalDateTime startTime, LocalDateTime endTime);
|
||||||
|
|
||||||
|
@Query(name = "getfxczfByYear")
|
||||||
|
List<Map<String, Object>> getfxczfByYear(LocalDateTime startTime, LocalDateTime endTime);
|
||||||
|
|
||||||
|
@Query("select count(a) from OnlinePatrol a")
|
||||||
|
Long getSumNum();
|
||||||
|
|
||||||
|
@Query("select count(a) from OnlinePatrol a where a.createTime >= ?1 and a.createTime <= ?2")
|
||||||
|
Long getNumByCreatTime(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.zs, 0) zs from d left join " +
|
||||||
|
"(select zf_on.agency_id agency_id, count(0) zs from zf_online_patrol_info zf_on group by zf_on.agency_id ) b " +
|
||||||
|
"on d.agency_id = b.agency_id ", nativeQuery = true)
|
||||||
|
List<Map<String, Object>> getFxczftjByAgency();
|
||||||
|
|
||||||
|
@Query(name = "getfxczftjByMonth")
|
||||||
|
List<Map<String, Object>> getfxczftjByMonth(LocalDateTime startTime, LocalDateTime endTime);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.aisino.iles.lawenforcement.repository;
|
||||||
|
|
||||||
|
import com.aisino.iles.core.repository.BaseRepo;
|
||||||
|
import com.aisino.iles.lawenforcement.model.RecipientInfo;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface RecipientInfoRepository extends BaseRepo<RecipientInfo, String> {
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue