Commit 6068329e by 王军业

[更新ContractMapper.xml文件]

1 parent b680583d
......@@ -282,85 +282,92 @@
amount_state_unid, start_guarantee_date, end_guarantee_date,
mainten_start_point, contract_note, is_delete, project_unid,
customer_unid,
(sum(total_reback_view.actual_reback_amount) where total_reback_view.contract_unid=tb_contract.contract_unid) as total_reback_amount,
(contract_amount-total_reback_amount-deduct_amount-stop_amount-exemptions_amount-bad_amount) ascontract_remain,
from tb_contract where
(select total_reback_view.sum from total_reback_view where total_reback_view.contract_unid=tb_contract.contract_unid) as total_reback_amount,
(contract_amount-(select total_reback_view.sum from total_reback_view where total_reback_view.contract_unid=tb_contract.contract_unid)-deduct_amount-stop_amount-exemptions_amount-bad_amount) as contract_remain,
(select total_recv_amount_view.total_recv_amount from total_recv_amount_view where tb_contract.contract_unid=total_recv_amount_view.contract_unid) as total_receive_amount ,
((select total_recv_amount_view.total_recv_amount from total_recv_amount_view where tb_contract.contract_unid=total_recv_amount_view.contract_unid)-(select total_reback_view.sum from total_reback_view where total_reback_view.contract_unid=tb_contract.contract_unid)-deduct_amount-stop_amount-exemptions_amount-bad_amount) as total_amount_remain ,
(select over_days_view.over_days from over_days_view where over_days_view.contract_unid=tb_contract.contract_unid) as over_days
from tb_contract where 1=1
<if test="salesperson_name__like !=null and salesperson_name__like !=''">
salesperson_unid like #{salesperson_name__like}
and
salesperson_unid like #{salesperson_name__like}
</if>
<if test="project_name__like !=null and project_name__like !=''">
and
project_unid like #{project_name__like}
and
</if>
<if test="customer_name__like !=null and customer_name__like !=''">
and
customer_unid like #{customer_name__like}
and
</if>
<if test="province !=null and province !=''">
and
province=#{province}
and
</if>
<if test="city !=null and city !=''">
city=#{city}
and
city=#{city}
</if>
<if test="county !=null and county !=''">
county=#{county}
and
county=#{county}
</if>
<if test="guarantee_period !=null">
and
guarantee_period=#{guarantee_period}
and
</if>
<if test="year !=null and year !=''">
to_char(sign_date,"yyyy")=#{year}
and
to_char(sign_date,"yyyy")=#{year}
</if>
<if test="month !=null and month!=''">
and
to_char(sign_date,"MM")=#{month}
and
</if>
<if test="product_line_type !=null and product_line_type !=''">
product_line_type=#{product_line_type}
and
product_line_type=#{product_line_type}
</if>
<if test="contract_state !=null and contract_state!=''">
and
contract_state=#{contract_state}
and
</if>
<if test="contract_type !=null and contract_type !=''">
contract_type=#{contract_type}
and
contract_type=#{contract_type}
</if>
<if test="is_archive !=null">
is_archive=#{is_archive}
and
is_archive=#{is_archive}
</if>
<if test="acceptanc_type !=null and acceptanc_type !=''">
contract_unid in (select tb_project_acceptanc.contract_unid from tb_project_acceptanc where tb_project_acceptanc.acceptanc_type=#{acceptanc_type})
and
contract_unid in (select tb_project_acceptanc.contract_unid from tb_project_acceptanc where tb_project_acceptanc.acceptanc_type=#{acceptanc_type})
</if>
<if test="confirm_income_amount !=null">
confirm_income_amount=#{confirm_income_amount}
and
confirm_income_amount=#{confirm_income_amount}
</if>
<if test="amount_state_unid !=null">
amount_state_unid=#{amount_state_unid}
and
amount_state_unid=#{amount_state_unid}
</if>
<if test="start_date != null and end_date !=null">
#{start_date} <![CDATA[<=]]> sign_date and sign_date <![CDATA[<=]]> #{end_date}
and
#{start_date} <![CDATA[<=]]> sign_date and sign_date <![CDATA[<=]]> #{end_date}
</if>
<if test="amount_point !=null">
and
contract_amount <![CDATA[>=]]> #{amount_point}
and
</if>
<if test="overdays_point !=null">
and
<!--逾期天数-->contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[>=]]> #{overdays_point})
</if>
<!--应收款余额-->
<if test="leave_amount_point !=null">
<!--应收款余额-->and
contract_unid in (select receive_amount_view.contract_unid from receive_amount_view where receive_amount_view.leave_amount_point <![CDATA[>=]]> #{leave_amount_point})
</if>
<if test="limit !=null and offset !=null">
limit #{limit} offset #{offset}
</if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!