@Repository public interface WorkOrderEstimateRepository extends org.springframework.data.jpa.repository.JpaRepository<WorkOrderEstimate,Long>
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAll, flush, getOne, save, saveAndFlushfindAllWorkOrderEstimate findByWorkOrder_IdAndEstimate_IdAndWorkOrder_EgwStatus_Code(Long workOrderId, Long estimateId, String status)
WorkOrderEstimate findByEstimate_IdAndWorkOrder_EgwStatus_Code(Long estimateId, String status)
WorkOrderEstimate findByWorkOrder_Id(Long workOrderId)
@Query(value="select distinct(woe.workOrder.workOrderNumber) from WorkOrderEstimate as woe where woe.workOrder.parent.id is null and upper(woe.workOrder.workOrderNumber) like upper(:workOrderNumber) and woe.workOrder.egwStatus.code =:workOrderStatus and not exists (select distinct(cbr.workOrderEstimate.workOrder) from ContractorBillRegister as cbr where woe.id = cbr.workOrderEstimate.id and upper(cbr.billstatus) != :billStatus and cbr.billtype = :billtype)") List<String> findWorkOrderNumbersToCreateMB(@Param(value="workOrderNumber") String workOrderNumber, @Param(value="workOrderStatus") String workOrderStatus, @Param(value="billStatus") String billStatus, @Param(value="billtype") String billtype)
@Query(value="select distinct(cbr.workOrderEstimate.workOrder.workOrderNumber) from ContractorBillRegister as cbr where upper(cbr.billstatus) != :status and cbr.billtype = :billtype") List<String> getCancelledWorkOrderNumbersByBillType(@Param(value="status") String billstatus, @Param(value="billtype") String finalBill)
@Query(value="select distinct(woe.workOrder.workOrderNumber) from WorkOrderEstimate as woe where woe.workOrder.parent.id is null and upper(woe.workOrder.workOrderNumber) like upper(:workOrderNumber) and woe.workOrder.egwStatus.code in(:workOrderStatus) and woe.workOrder.id = (select distinct(os.objectId) from OfflineStatus as os where os.id = (select max(status.id) from OfflineStatus status where status.objectType = :objectType and status.objectId = woe.workOrder.id) and os.objectId = woe.workOrder.id and lower(os.egwStatus.code) = :offlineStatus and os.objectType = :objectType )") List<String> findWordOrderByStatus(@Param(value="workOrderNumber") String workOrderNumber, @Param(value="workOrderStatus") String workOrderStatus, @Param(value="offlineStatus") String offlineStatus, @Param(value="objectType") String objectType)
@Query(value="select distinct(woe.estimate.estimateNumber) from WorkOrderEstimate as woe where woe.estimate.parent.id is null and upper(woe.estimate.estimateNumber) like upper(:estimateNumber) and woe.workOrder.egwStatus.code in(:workOrderStatus) and woe.workOrder.id = (select distinct(os.objectId) from OfflineStatus as os where os.id = (select max(status.id) from OfflineStatus status where status.objectType = :objectType and status.objectId = woe.workOrder.id) and os.objectId = woe.workOrder.id and lower(os.egwStatus.code) = :offlineStatus and os.objectType = :objectType )") List<String> findEstimatesByWorkOrderStatus(@Param(value="estimateNumber") String estimateNumber, @Param(value="workOrderStatus") String workOrderStatus, @Param(value="offlineStatus") String offlineStatus, @Param(value="objectType") String objectType)
List<WorkOrderEstimate> findByEstimate_EstimateNumberContainingIgnoreCaseAndWorkOrder_EgwStatus_codeEquals(String estimateNumber, String statusCode)
@Query(value="select distinct(woe.workOrder.contractor) as contractor from WorkOrderEstimate as woe where upper(woe.workOrder.contractor.name) like upper(:contractorname) or upper(woe.workOrder.contractor.code) like upper(:contractorname) and woe.workOrder.egwStatus.code in (:workOrderStatus) and woe.workOrder.id = (select distinct(os.objectId) from OfflineStatus as os where os.id = (select max(status.id) from OfflineStatus status where status.objectType = :objectType and status.objectId = woe.workOrder.id) and os.objectId = woe.workOrder.id and lower(os.egwStatus.code) = :offlineStatus and os.objectType = :objectType )") List<Contractor> findContractorByWorkOrderStatus(@Param(value="contractorname") String contractorname, @Param(value="workOrderStatus") String workOrderStatus, @Param(value="offlineStatus") String offlineStatus, @Param(value="objectType") String objectType)
List<WorkOrderEstimate> findByEstimate_EstimateNumberContainingIgnoreCaseAndWorkOrder_EgwStatus_codeNotLike(String estimateNumber, String statusCode)
@Query(value="select distinct(woe.workOrder.workOrderNumber) from WorkOrderEstimate as woe where woe.estimate.parent.id is null and upper(woe.workOrder.workOrderNumber) like upper(:workOrderNumber) and woe.workOrder.egwStatus.code =:workOrderStatus and not exists (select distinct(cbr.workOrderEstimate.workOrder) from ContractorBillRegister as cbr where woe.id = cbr.workOrderEstimate.id and upper(cbr.billstatus) != :billStatus and cbr.billtype = :billtype)") List<String> findWorkOrderNumbersToCreateRE(@Param(value="workOrderNumber") String workOrderNumber, @Param(value="workOrderStatus") String workOrderStatus, @Param(value="billStatus") String billStatus, @Param(value="billtype") String billtype)
@Query(value="select distinct(woe.workOrder.contractor) as contractor from WorkOrderEstimate as woe where upper(woe.workOrder.contractor.name) like upper(:contractorname) or upper(woe.workOrder.contractor.code) like upper(:contractorname) and woe.workOrder.egwStatus.code =:workOrderStatus ") List<Contractor> findContractorsByWorkOrderStatus(@Param(value="contractorname") String contractorname, @Param(value="workOrderStatus") String workOrderStatus)
@Query(value="select distinct(woe) from WorkOrderEstimate as woe where upper(woe.estimate.estimateNumber) = :estimateNumber and woe.workOrder.egwStatus.code = :workOrderStatus and woe.workOrder.parent is null") WorkOrderEstimate findWorkOrderEstimateByEstimateNumber(@Param(value="estimateNumber") String estimateNumber, @Param(value="workOrderStatus") String workOrderStatus)
Copyright © 2015–2016 eGovernments Foundation. All rights reserved.