@Repository public interface AbstractEstimateRepository extends org.springframework.data.jpa.repository.JpaRepository<AbstractEstimate,Long>
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAll, flush, getOne, save, saveAndFlushfindAll@Query(value="select distinct(ae.estimateNumber) from AbstractEstimate as ae where ae.parent.id is null and upper(ae.estimateNumber) like upper(:estimateNumber)") List<String> findDistinctEstimateNumberContainingIgnoreCase(@Param(value="estimateNumber") String estimateNumber)
List<AbstractEstimate> findByEstimateNumberAndEgwStatus_codeEquals(String estimateNumber, String statusCode)
List<AbstractEstimate> findByParent_idAndEgwStatus_codeEquals(Long parentId, String statusCode)
AbstractEstimate findByEstimateNumberAndEgwStatus_codeNotLike(String estimateNumber, String statusCode)
AbstractEstimate findByLineEstimateDetails_EstimateNumberAndEgwStatus_codeEquals(String estimateNumber, String statusCode)
AbstractEstimate findByLineEstimateDetails_IdAndEgwStatus_codeEquals(Long id, String statusCode)
@Query(value="select distinct(ae.createdBy) from AbstractEstimate as ae") List<org.egov.infra.admin.master.entity.User> findAbstractEstimateCreatedByUsers()
@Query(value="select distinct(ae.createdBy) from AbstractEstimate as ae where ae.executingDepartment.id in (:departmentIds)") List<org.egov.infra.admin.master.entity.User> findAbstractEstimateCreatedByUsers(@Param(value="departmentIds") List<Long> departmentIds)
AbstractEstimate findByEstimateTechnicalSanctionsIgnoreCase_TechnicalSanctionNumberAndEgwStatus_CodeNot(String technicalSanctionNumber, String statusCode)
@Query(value="select distinct(ae.estimateNumber) from AbstractEstimate as ae where ae.egwStatus.code != :status and exists(select distinct(activity.abstractEstimate.estimateNumber) from Activity as activity where activity.abstractEstimate = ae) and ae.lineEstimateDetails.lineEstimate.id = :lineEstimateId") List<String> findAbstractEstimateNumbersToCancelLineEstimate(@Param(value="lineEstimateId") Long lineEstimateId, @Param(value="status") String status)
@Query(value="select distinct(ae.estimateNumber) from AbstractEstimate as ae where upper(ae.estimateNumber) like upper(:code) and ae.egwStatus.code = :aeStatus and exists (select distinct(activity.id) from Activity activity where activity.abstractEstimate.id = ae.id) and not exists (select distinct(woe) from WorkOrderEstimate as woe where woe.estimate.id = ae.id and woe.workOrder.egwStatus.code != :status) and ae.parent.id is null") List<String> findAbstractEstimateNumbersToCancelEstimate(@Param(value="code") String code, @Param(value="status") String status, @Param(value="aeStatus") String aeStatus)
@Query(value="select distinct(ae.estimateNumber) from AbstractEstimate as ae where ae.parent.id is null and upper(ae.estimateNumber) like upper(:code) and ae.egwStatus.code = :abstractEstimateStatus and not exists (select distinct(woe.estimate) from WorkOrderEstimate as woe where ae.id = woe.workOrder.id and woe.workOrder.egwStatus.code != upper(:workOrderStatus))") List<String> findAbstractEstimateNumbersToSetOfflineStatus(@Param(value="code") String code, @Param(value="abstractEstimateStatus") String abstractEstimateStatus, @Param(value="workOrderStatus") String workOrderStatus)
@Query(value="select distinct(estimate.estimateNumber) from AbstractEstimate estimate where estimate.parent.id is null and estimate.egwStatus.code = :abstractEstimateStatus and upper(estimate.estimateNumber) like upper(:estimateNumber) and not exists (select distinct(woe.estimate) from WorkOrderEstimate as woe where estimate.id = woe.estimate.id and upper(woe.workOrder.egwStatus.code) != upper(:workOrderStatus) and upper(estimate.egwStatus.code) = upper(:abstractEstimateStatus)) and exists (select act.abstractEstimate from Activity as act where estimate.id = act.abstractEstimate.id ) and exists (select off.id from OfflineStatus as off where off.objectId = estimate.id and off.objectType = :objectType and upper(off.egwStatus.code) = upper(:offlineStatus) )") List<String> findEstimateNumbersToCreateLOA(@Param(value="estimateNumber") String estimateNumber, @Param(value="abstractEstimateStatus") String abstractEstimateStatus, @Param(value="workOrderStatus") String workOrderStatus, @Param(value="objectType") String objectType, @Param(value="offlineStatus") String offlineStatus)
@Query(value="select distinct(estimate.projectCode.code) from AbstractEstimate estimate where estimate.egwStatus.code = :abstractEstimateStatus and upper(estimate.projectCode.code) like upper(:workIdentificationNumber) and not exists (select distinct(woe.estimate) from WorkOrderEstimate as woe where estimate.id = woe.estimate.id and upper(woe.workOrder.egwStatus.code) != upper(:workOrderStatus) and upper(estimate.egwStatus.code) = upper(:abstractEstimateStatus)) and exists (select act.abstractEstimate from Activity as act where estimate.id = act.abstractEstimate.id ) and exists (select off.id from OfflineStatus as off where off.objectId = estimate.id and off.objectType = :objectType and upper(off.egwStatus.code) = upper(:offlineStatus) )") List<String> findWorkIdentificationNumbersToCreateLOA(@Param(value="workIdentificationNumber") String workIdentificationNumber, @Param(value="abstractEstimateStatus") String abstractEstimateStatus, @Param(value="workOrderStatus") String workOrderStatus, @Param(value="objectType") String objectType, @Param(value="offlineStatus") String offlineStatus)
@Query(value="select distinct(estimate.lineEstimateDetails.lineEstimate.adminSanctionNumber) from AbstractEstimate estimate where estimate.egwStatus.code = :abstractEstimateStatus and upper(estimate.lineEstimateDetails.lineEstimate.adminSanctionNumber) like upper(:adminSanctionNumber) and not exists (select distinct(woe.estimate) from WorkOrderEstimate as woe where estimate.id = woe.estimate.id and upper(woe.workOrder.egwStatus.code) != upper(:workOrderStatus) and upper(estimate.egwStatus.code) = upper(:abstractEstimateStatus)) and exists (select act.abstractEstimate from Activity as act where estimate.id = act.abstractEstimate.id ) and exists (select off.id from OfflineStatus as off where off.objectId = estimate.id and off.objectType = :objectType and upper(off.egwStatus.code) = upper(:offlineStatus) )") List<String> findAdminSanctionNumbersToCreateLOA(@Param(value="adminSanctionNumber") String adminSanctionNumber, @Param(value="abstractEstimateStatus") String abstractEstimateStatus, @Param(value="workOrderStatus") String workOrderStatus, @Param(value="objectType") String objectType, @Param(value="offlineStatus") String offlineStatus)
@Query(value="select estimate from AbstractEstimate estimate where exists (select a.abstractEstimate from Activity a where a.abstractEstimate.id = estimate.id and a.schedule.id=:sorId) and estimate.estimateDate>=:estimateDate and estimate.egwStatus.code !=:abstractEstimateStatus ") List<AbstractEstimate> findBySorIdAndEstimateDate(@Param(value="sorId") Long sorId, @Param(value="estimateDate") Date estimateDate, @Param(value="abstractEstimateStatus") String abstractEstimateStatus)
@Query(value="select act from Activity act where act.parent.id =:activityId and act.abstractEstimate.egwStatus.code =:abstractEstimateStatus ") List<Activity> findActivitiesByParent(@Param(value="activityId") Long activityId, @Param(value="abstractEstimateStatus") String abstractEstimateStatus)
@Query(value="select woe from WorkOrderEstimate woe where exists (select a.abstractEstimate from Activity a where a.abstractEstimate.id = woe.estimate.id and a.schedule.id=:sorId) and woe.workOrder.workOrderDate>=:workOrderDate and woe.estimate.egwStatus.code !=:abstractEstimateStatus ") List<WorkOrderEstimate> findBySorIdAndWorkOrderDate(@Param(value="sorId") Long sorId, @Param(value="workOrderDate") Date workOrderDate, @Param(value="abstractEstimateStatus") String abstractEstimateStatus)
@Query(value="select distinct(ae.createdBy) from AbstractEstimate as ae where ae.egwStatus.code = :abstractEstimateStatus ") List<org.egov.infra.admin.master.entity.User> findCreatedByForEstimatePhotograph(@Param(value="abstractEstimateStatus") String abstractEstimateStatus)
Copyright © 2015–2016 eGovernments Foundation. All rights reserved.