@Repository public interface LetterOfAcceptanceRepository extends org.springframework.data.jpa.repository.JpaRepository<WorkOrder,Long>
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAll, flush, getOne, save, saveAndFlushfindAll@Query(value="select distinct(wo.workOrderNumber) from WorkOrder as wo where wo.parent.id is null and upper(wo.workOrderNumber) like upper(:workOrderNumber)") List<String> findDistinctWorkOrderNumberContainingIgnoreCase(@Param(value="workOrderNumber") String workOrderNumber)
@Query(value="select distinct(wo.estimateNumber) from WorkOrder as wo where wo.parent.id is null and upper(wo.estimateNumber) like upper(:estimateNumber)") List<String> findDistinctEstimateNumberNumberContainingIgnoreCase(@Param(value="estimateNumber") String estimateNumber)
List<WorkOrder> findByEstimateNumberAndEgwStatus_codeEquals(String estimateNumber, String statusCode)
List<WorkOrder> findByWorkOrderNumberContainingIgnoreCaseAndEgwStatus_codeEqualsAndParent_idIsNull(String workOrderNumber, String statusCode)
List<WorkOrder> findByEstimateNumberContainingIgnoreCaseAndEgwStatus_codeEquals(String estimateNumber, String statusCode)
@Query(value="select distinct(wo.contractor.name) from WorkOrder as wo where wo.contractor.name like :name or wo.contractor.code like :name") List<String> findDistinctContractorByContractor_codeAndNameContainingIgnoreCase(@Param(value="name") String name)
WorkOrder findByWorkOrderNumberAndEgwStatus_codeNotLike(String workOrderNumber, String statusCode)
WorkOrder findByEstimateNumberAndEgwStatus_codeNotLike(String estimateNumber, String statusCode)
WorkOrder findByWorkOrderNumberAndEgwStatus_codeEquals(String workOrderNumber, String statusCode)
@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 = :approvedStatus and not exists (select distinct(cbr.workOrderEstimate) from ContractorBillRegister as cbr where woe.id = cbr.workOrderEstimate.id and upper(cbr.billstatus) != :status and cbr.billtype = :billtype) ") List<String> findWorkOrderNumberForContractorBill(@Param(value="workOrderNumber") String workOrderNumber, @Param(value="approvedStatus") String approvedStatus, @Param(value="status") String status, @Param(value="billtype") String billtype)
@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 = :approvedStatus and not exists (select distinct(cbr.workOrderEstimate) from ContractorBillRegister as cbr where woe.id = cbr.workOrderEstimate.id and upper(cbr.billstatus) != :status and cbr.billtype = :billtype) and exists (select distinct mh.workOrderEstimate from MBHeader mh where mh.egwStatus.code =:approvedStatus )") List<String> findWorkOrderNumberForContractorBillWithMB(@Param(value="workOrderNumber") String workOrderNumber, @Param(value="approvedStatus") String approvedStatus, @Param(value="status") String status, @Param(value="billtype") String billtype)
@Query(value="select distinct(woe.workOrder.estimateNumber) from WorkOrderEstimate as woe where woe.workOrder.parent.id is null and upper(woe.workOrder.estimateNumber) like upper(:estimateNumber) and woe.workOrder.egwStatus.code = :approvedStatus and not exists (select distinct(cbr.workOrderEstimate) from ContractorBillRegister as cbr where woe.id = cbr.workOrderEstimate.id and upper(cbr.billstatus) != :status and cbr.billtype = :billtype)") List<String> findEstimateNumberForContractorBill(@Param(value="estimateNumber") String estimateNumber, @Param(value="approvedStatus") String approvedStatus, @Param(value="status") String status, @Param(value="billtype") String billtype)
@Query(value="select distinct(woe.workOrder.estimateNumber) from WorkOrderEstimate as woe where woe.workOrder.parent.id is null and upper(woe.workOrder.estimateNumber) like upper(:estimateNumber) and woe.workOrder.egwStatus.code = :approvedStatus and not exists (select distinct(cbr.workOrderEstimate) from ContractorBillRegister as cbr where woe.id = cbr.workOrderEstimate.id and upper(cbr.billstatus) != :status and cbr.billtype = :billtype) and exists (select distinct mh.workOrderEstimate from MBHeader mh where mh.egwStatus.code =:approvedStatus )") List<String> findEstimateNumberForContractorBillWithMB(@Param(value="estimateNumber") String estimateNumber, @Param(value="approvedStatus") String approvedStatus, @Param(value="status") String status, @Param(value="billtype") String billtype)
@Query(value="select distinct(woe.workOrder.contractor.name) from WorkOrderEstimate as woe where upper(woe.workOrder.contractor.name) like upper(:contractorname) and woe.workOrder.egwStatus.code = :approvedStatus and not exists (select distinct(cbr.workOrderEstimate) from ContractorBillRegister as cbr where woe.id = cbr.workOrderEstimate.id and upper(cbr.billstatus) != :status and cbr.billtype = :billtype) ") List<String> findContractorForContractorBill(@Param(value="contractorname") String contractorname, @Param(value="approvedStatus") String approvedStatus, @Param(value="status") String status, @Param(value="billtype") String billtype)
@Query(value="select distinct(woe.workOrder.contractor.name) from WorkOrderEstimate as woe where upper(woe.workOrder.contractor.name) like upper(:contractorname) and woe.workOrder.egwStatus.code = :approvedStatus and not exists (select distinct(cbr.workOrderEstimate) from ContractorBillRegister as cbr where woe.id = cbr.workOrderEstimate.id and upper(cbr.billstatus) != :status and cbr.billtype = :billtype) and exists (select distinct mh.workOrderEstimate from MBHeader mh where mh.egwStatus.code =:approvedStatus )") List<String> findContractorForContractorBillWithMB(@Param(value="contractorname") String contractorname, @Param(value="approvedStatus") String approvedStatus, @Param(value="status") String status, @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> getDistinctNonCancelledWorkOrderNumbersByBillType(@Param(value="status") String billstatus, @Param(value="billtype") String finalBill)
@Query(value="select distinct(cbr.workOrderEstimate.workOrder.workOrderNumber) from ContractorBillRegister as cbr where cbr.workOrderEstimate.workOrder.id = :workOrderId and upper(cbr.billstatus) not in (:billstatus1,:billstatus2)") List<String> getContractorBillInWorkflowForWorkorder(@Param(value="workOrderId") Long workOrderId, @Param(value="billstatus1") String billstatus1, @Param(value="billstatus2") String billstatus2)
@Query(value="select distinct(led.projectCode.code) from LineEstimateDetails as led where upper(led.projectCode.code) like upper(:code) and exists (select distinct(wo.estimateNumber) from WorkOrder as wo where led.estimateNumber = wo.estimateNumber)") List<String> findWorkIdentificationNumberToCreateMilestone(@Param(value="code") String code)
@Query(value="select sum(br.billamount) from EgBillregister as br where br.workOrderEstimate.workOrder.id = (select id from WorkOrder as wo where wo.workOrderNumber = :workOrderNumber and wo.egwStatus.code = :status) and br.billstatus != :billStatus") Double getGrossBillAmountOfBillsCreated(@Param(value="workOrderNumber") String workOrderNumber, @Param(value="status") String status, @Param(value="billStatus") String billstatus)
@Query(value="select distinct(wo.workOrderNumber) from WorkOrder as wo where wo.egwStatus.code = :workOrderStatus and not exists (select distinct(cbr.workOrderEstimate.workOrder) from ContractorBillRegister as cbr where wo.id = cbr.workOrderEstimate.workOrder.id and upper(cbr.billstatus) != :status and cbr.billtype = :billtype)") List<String> findWorkOrderNumbersToModifyLoa(@Param(value="workOrderStatus") String workOrderStatus, @Param(value="status") String status, @Param(value="billtype") String billtype)
@Query(value="select distinct(led.projectCode.code) from LineEstimateDetails as led where upper(led.projectCode.code) like upper(:code) and exists (select distinct(wo.estimateNumber) from WorkOrder as wo where led.estimateNumber = wo.estimateNumber and egwStatus.code = :status)") List<String> findWorkIdentificationNumbersToSearchLOAToCancel(@Param(value="code") String code, @Param(value="status") String status)
@Query(value="select distinct(wo.contractor.name) from WorkOrder as wo where upper(wo.contractor.name) like upper(:code) and wo.egwStatus.code = :status") List<String> findContractorsToSearchLOAToCancel(@Param(value="code") String code, @Param(value="status") String status)
@Query(value="select distinct(woe.workOrder.estimateNumber) from WorkOrderEstimate as woe where woe.workOrder.egwStatus.code != :workorderstatus and not exists(select distinct(woa.workOrderEstimate.estimate.estimateNumber) from WorkOrderActivity woa where woa.workOrderEstimate = woe) and woe.estimate.lineEstimateDetails.lineEstimate.id =:lineestimateid") List<String> findEstimateNumbersToCancelLineEstimate(@Param(value="lineestimateid") Long linEstimateId, @Param(value="workorderstatus") String workOrderStatus)
@Query(value="select distinct(wo.id) from WorkOrder as wo where wo.id = (select distinct(os.objectId) from OfflineStatus as os where os.id = (select max(status.id) from OfflineStatus status where status.objectType = :objectType and os.objectId = wo.id) and os.objectId = wo.id and os.egwStatus.code = :offlineStatus and os.objectType = :objectType )") List<Long> findWorkOrderForLoaStatus(@Param(value="offlineStatus") String offlineStatus, @Param(value="objectType") String objectType)
@Query(value="select distinct(woe.estimate.estimateNumber) from WorkOrderEstimate as woe where woe.workOrder.parent.id is null and woe.workOrder.egwStatus.code = :workOrderStatus and upper(woe.estimate.estimateNumber) like upper(:estimateNumber) and not exists(select distinct(woa.workOrderEstimate.estimate.estimateNumber) from WorkOrderActivity woa where woa.workOrderEstimate = woe)") List<String> findEstimateNumbersToModifyLOA(@Param(value="estimateNumber") String estimateNumber, @Param(value="workOrderStatus") String workOrderStatus)
@Query(value="select distinct(woe.workOrder.workOrderNumber) from WorkOrderEstimate as woe where woe.workOrder.parent.id is null and woe.workOrder.egwStatus.code = :workOrderStatus and upper(woe.workOrder.workOrderNumber) like upper(:workOrderNumber) and not exists(select distinct(woa.workOrderEstimate.workOrder.workOrderNumber) from WorkOrderActivity woa where woa.workOrderEstimate = woe)") List<String> findWorkOrderNumbersToModifyLOA(@Param(value="workOrderNumber") String workOrderNumber, @Param(value="workOrderStatus") String workOrderStatus)
@Query(value="select distinct(woe.estimate.estimateNumber) from WorkOrderEstimate as woe where woe.workOrder.parent.id is null and woe.workOrder.egwStatus.code = :workOrderStatus and upper(woe.estimate.estimateNumber) like upper(:estimateNumber) and exists(select distinct(woa.workOrderEstimate.estimate.estimateNumber) from WorkOrderActivity woa where woa.workOrderEstimate = woe)") List<String> findEstimateNumbersToSetOfflineStatus(@Param(value="estimateNumber") String estimateNumber, @Param(value="workOrderStatus") String workOrderStatus)
@Query(value="select distinct(woe.workOrder.workOrderNumber) from WorkOrderEstimate as woe where woe.workOrder.parent.id is null and woe.workOrder.egwStatus.code = :workOrderStatus and upper(woe.workOrder.workOrderNumber) like upper(:workOrderNumber) and exists(select distinct(woa.workOrderEstimate.workOrder.workOrderNumber) from WorkOrderActivity woa where woa.workOrderEstimate = woe)") List<String> findWorkOrderNumbersToSetOfflineStatus(@Param(value="workOrderNumber") String workOrderNumber, @Param(value="workOrderStatus") String workOrderStatus)
@Query(value="select distinct(woe.workOrder.contractor.name) from WorkOrderEstimate as woe where woe.workOrder.egwStatus.code = :workOrderStatus and (upper(woe.workOrder.contractor.name) like upper(:contractorName) or upper(woe.workOrder.contractor.code) like upper(:contractorName)) and exists (select distinct(woa.workOrderEstimate) from WorkOrderActivity woa where woa.workOrderEstimate = woe.id)") List<String> findContractorToSetOfflineStatus(@Param(value="contractorName") String contractorName, @Param(value="workOrderStatus") String workOrderStatus)
@Query(value="select distinct(woe.workOrder.contractor.name) from WorkOrderEstimate as woe where woe.workOrder.egwStatus.code = :workOrderStatus and (upper(woe.workOrder.contractor.name) like upper(:contractorName) or upper(woe.workOrder.contractor.code) like upper(:contractorName)) and not exists (select distinct(woa.workOrderEstimate) from WorkOrderActivity woa where woa.workOrderEstimate = woe.id)") List<String> findContractorToModifyLOA(@Param(value="contractorName") String contractorName, @Param(value="workOrderStatus") String workOrderStatus)
@Query(value="select distinct(wo.engineerIncharge) from WorkOrder as wo where wo.egwStatus.code = :workOrderStatus") List<org.egov.infra.admin.master.entity.User> getWorkAssignedUsers(@Param(value="workOrderStatus") String workOrderStatus)
@Query(value="select distinct(woe.workOrder.contractor.name) from WorkOrderEstimate as woe where (upper(woe.workOrder.contractor.name) like upper(:code) or upper(woe.workOrder.contractor.code) like upper(:code)) and woe.workOrder.egwStatus.code = :status") List<String> findContractorsToSearchLOAToCreateRE(@Param(value="code") String code, @Param(value="status") String status)
@Query(value="select distinct(woe.estimate.estimateNumber) from WorkOrderEstimate as woe where upper(woe.estimate.estimateNumber) like upper(:estimateNumber) and woe.workOrder.egwStatus.code = :workOrderStatus and woe.workOrder.parent is null and not exists (select distinct(cbr.workOrderEstimate) from ContractorBillRegister as cbr where woe.id = cbr.workOrderEstimate.id and upper(cbr.billstatus) != :status and cbr.billtype = :billtype)") List<String> findDistinctEstimateNumberToModifyLOA(@Param(value="estimateNumber") String estimateNumber, @Param(value="workOrderStatus") String workOrderStatus, @Param(value="status") String status, @Param(value="billtype") String billtype)
@Query(value="select distinct(woe.workOrder.workOrderNumber) from WorkOrderEstimate as woe where upper(woe.workOrder.workOrderNumber) like upper(:workOrderNumber) and woe.workOrder.egwStatus.code = :workOrderStatus and woe.workOrder.parent is null and woe.estimate.lineEstimateDetails.id in (select ep.lineEstimateDetails.id from EstimatePhotographs as ep) ") List<String> findworkOrderNumbersToViewEstimatePhotograph(@Param(value="workOrderNumber") String workOrderNumber, @Param(value="workOrderStatus") String workOrderStatus)
@Query(value="select distinct(woe.workOrder.contractor.name) 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 and woe.workOrder.parent is null and woe.estimate.lineEstimateDetails.id in (select ep.lineEstimateDetails.id from EstimatePhotographs as ep) ") List<String> findContractorsToViewEstimatePhotograph(@Param(value="contractorName") String contractorName, @Param(value="workOrderStatus") String workOrderStatus)
Copyright © 2015–2016 eGovernments Foundation. All rights reserved.