MaintainBillDao_findMatchContract.sql 542 B

12345678910111213141516
  1. select plan.dep_name,plan.name as planName,contract.name as contractName,plan.servicetype
  2. from t_b_contract contract
  3. ,t_b_maintain_plan plan
  4. where
  5. contract.signdate between :contractStartTime and :contractEndTime
  6. and contract.bpm_status='3'
  7. and plan.bpm_status='3'
  8. and plan.contract_id is null
  9. and plan.depart_id = contract.projectid
  10. and exists(select 1 from
  11. t_b_contract_item item
  12. ,t_b_project_service service
  13. where contract.id=item.contractid
  14. and item.serviceid=service.id
  15. and plan.servicetype = service.servicetypedetail
  16. )