<!-- (select d21_view.d21 from d21_view where d21_view.contract_unid=tb_contract.contract_unid) as mainten_pay_deliver_date,
<!-- (select d21_view.d21 from d21_view where d21_view.contract_unid=tb_contract.contract_unid) as mainten_pay_deliver_date,
(select d22_view.d21 from d22_view where d22_view.contract_unid=tb_contract.contract_unid) as mainten_pay_acceptanc_date, -->
(select d22_view.d21 from d22_view where d22_view.contract_unid=tb_contract.contract_unid) as mainten_pay_acceptanc_date, -->
to_char((select max(tb_deliver_goods.deliver_goods_date) from tb_deliver_goods where tb_deliver_goods.contract_unid=tb_contract.contract_unid ), 'yyyy-MM-dd') as deliver_date,
to_char((select max(tb_deliver_goods.deliver_goods_date) from tb_deliver_goods where tb_deliver_goods.contract_unid=tb_contract.contract_unid ), 'yyyy-MM-dd') as deliver_date,
to_char((select tb_deliver_goods.goods_acceptanc_date from tb_deliver_goods where tb_deliver_goods.contract_unid=tb_contract.contract_unid and tb_deliver_goods.deliver_unid = max(tb_deliver_goods.deliver_unid) ), 'yyyy-MM-dd') as goods_acceptanc_date,
to_char((select max(tb_deliver_goods.goods_acceptanc_date) from tb_deliver_goods where tb_deliver_goods.contract_unid=tb_contract.contract_unid ), 'yyyy-MM-dd') as goods_acceptanc_date,
to_char((select max(tb_project_acceptanc.acceptanc_date) from tb_project_acceptanc where tb_project_acceptanc.contract_unid=tb_contract.contract_unid ), 'yyyy-MM-dd') as acceptanc_date
to_char((select max(tb_project_acceptanc.acceptanc_date) from tb_project_acceptanc where tb_project_acceptanc.contract_unid=tb_contract.contract_unid ), 'yyyy-MM-dd') as acceptanc_date
from tb_contract where 1=1
from tb_contract where 1=1
<iftest="contract_unid !=null and contract_unid !=''">
<iftest="contract_unid !=null and contract_unid !=''">