190 lines
3.9 KiB
Markdown
190 lines
3.9 KiB
Markdown
2 years ago
|
queryCondition
|
||
|
===
|
||
|
|
||
|
* 查询条件
|
||
|
|
||
|
@if(!isEmpty(examinationId)){
|
||
|
and t.examination_id =#examinationId#
|
||
|
@}
|
||
|
@if(!isEmpty(flowId)){
|
||
|
and t.flow_id =#flowId#
|
||
|
@}
|
||
|
@ if(!isEmpty(protocolNo)){
|
||
|
and t.protocol_no = #protocolNo#
|
||
|
@}
|
||
|
@ if(!isEmpty(sellerName)){
|
||
|
and t.seller_name like #'%'+sellerName+'%'#
|
||
|
@}
|
||
|
@ if(!isEmpty(buyerName)){
|
||
|
and t.buyer_name like #'%'+buyerName+'%'#
|
||
|
@}
|
||
|
@ if(!isEmpty(sellerId)){
|
||
|
and t.seller_id = #sellerId#
|
||
|
@}
|
||
|
@ if(!isEmpty(buyerId)){
|
||
|
and t.buyer_id = #buyerId#
|
||
|
@}
|
||
|
@ if(!isEmpty(protocolStatus)){
|
||
|
and t.protocol_status = #protocolStatus#
|
||
|
@}
|
||
|
@ if(!isEmpty(searchStartTime)){
|
||
|
and t.protocol_time >= #searchStartTime#
|
||
|
@}
|
||
|
@ if(!isEmpty(searchEndTime)){
|
||
|
and t.protocol_time <= #searchEndTime#
|
||
|
@}
|
||
|
|
||
|
|
||
|
pageQueryByCondition
|
||
|
===
|
||
|
|
||
|
* 分页查询
|
||
|
|
||
|
select
|
||
|
@pageTag(){
|
||
|
t.*,
|
||
|
t4.telephone buyer_telephone, t4.corporation buyer_corporation
|
||
|
@}
|
||
|
from protocols t
|
||
|
left join materials t4 on t4.id = t.buyer_id
|
||
|
where 1 = 1
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
queryByCondition
|
||
|
===
|
||
|
|
||
|
* 不分页查询
|
||
|
|
||
|
select
|
||
|
t.*
|
||
|
from protocols t
|
||
|
where 1 = 1
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
getBuyerList
|
||
|
===
|
||
|
|
||
|
* 查询可以新增反向保理协议的数据
|
||
|
|
||
|
select
|
||
|
t.accept_time,
|
||
|
t3.buyer_id, t3.buyer_name, t3.contract_time, t3.contract_amount, t3.pay_time,
|
||
|
t3.id contract_id, t3.contract_no,
|
||
|
t4.telephone buyer_telephone, t4.corporation buyer_corporation
|
||
|
from send_products t
|
||
|
left join protocols t2 on t.contract_id = t2.contract_id
|
||
|
join contracts_purchase_sales t3 on t.contract_id = t3.id
|
||
|
join materials t4 on t4.id = t3.buyer_id
|
||
|
where t.send_status = 2
|
||
|
and t2.contract_id is null
|
||
|
@if(!isEmpty(examinationId)){
|
||
|
and t.examination_id =#examinationId#
|
||
|
@}
|
||
|
@if(!isEmpty(flowId)){
|
||
|
and t.flow_id =#flowId#
|
||
|
@}
|
||
|
|
||
|
|
||
|
|
||
|
getSupplyList
|
||
|
===
|
||
|
|
||
|
* 查询可以新增反向保理合同的数据
|
||
|
|
||
|
select
|
||
|
t.bank_id, t.bank_name, t.protocol_time,
|
||
|
t3.buyer_id, t3.buyer_name, t3.seller_name, t3.seller_id,
|
||
|
t3.id contract_id, t3.contract_no, t3.pay_time,
|
||
|
t4.telephone seller_telephone, t4.corporation seller_corporation, t4.address seller_address,
|
||
|
t5.yfzk_amount, t5.supply_rate
|
||
|
from protocols t
|
||
|
left join contracts_factoring t2 on t.contract_id = t2.contract_id
|
||
|
join contracts_purchase_sales t3 on t.contract_id = t3.id
|
||
|
join materials t4 on t4.id = t3.seller_id
|
||
|
join recommend_supplier t5 on t5.contract_id = t.contract_id
|
||
|
|
||
|
where t.protocol_status = 2
|
||
|
and t5.supply_status = 1
|
||
|
and t2.contract_id is null
|
||
|
|
||
|
@if(!isEmpty(examinationId)){
|
||
|
and t.examination_id =#examinationId#
|
||
|
@}
|
||
|
@if(!isEmpty(flowId)){
|
||
|
and t.flow_id =#flowId#
|
||
|
@}
|
||
|
|
||
|
|
||
|
getProtocolsSendList
|
||
|
===
|
||
|
|
||
|
* 查询可以新增存货质押发货的数据
|
||
|
|
||
|
select
|
||
|
t.seller_id, t.seller_name, t.express_id, t.express_name,
|
||
|
t.id, t.protocol_no
|
||
|
from protocols t
|
||
|
left join send_products t2 on t.id = t2.protocol_id
|
||
|
|
||
|
where t.protocol_status = 3
|
||
|
and t2.protocol_id is null
|
||
|
|
||
|
@if(!isEmpty(examinationId)){
|
||
|
and t.examination_id =#examinationId#
|
||
|
@}
|
||
|
@if(!isEmpty(flowId)){
|
||
|
and t.flow_id =#flowId#
|
||
|
@}
|
||
|
|
||
|
|
||
|
|
||
|
getProtocolsContractList
|
||
|
===
|
||
|
|
||
|
* 查询可以新增保兑仓协议的购销合同
|
||
|
|
||
|
select
|
||
|
t.seller_id, t.seller_name, t.buyer_id, t.buyer_name,
|
||
|
t.id contract_id, t.contract_amount, t.contract_time, t.pay_time,
|
||
|
t.contract_no
|
||
|
from contracts_purchase_sales t
|
||
|
left join protocols t2 on t.id = t2.contract_id
|
||
|
|
||
|
where t.contract_status = 2
|
||
|
and t2.contract_id is null
|
||
|
|
||
|
@if(!isEmpty(examinationId)){
|
||
|
and t.examination_id =#examinationId#
|
||
|
@}
|
||
|
@if(!isEmpty(flowId)){
|
||
|
and t.flow_id =#flowId#
|
||
|
@}
|
||
|
|
||
|
|
||
|
getNewBdcProtocolList
|
||
|
===
|
||
|
|
||
|
* 查询可以新增保兑仓融资申请的协议
|
||
|
|
||
|
select
|
||
|
t.id, t.protocol_no, t.seller_id, t.seller_name, t.buyer_id, t.buyer_name, t.bank_id, t.bank_name,
|
||
|
t3.contract_amount, t3.contract_time, t3.pay_time,
|
||
|
t3.contract_no, t3.id contract_id
|
||
|
from protocols t
|
||
|
left join financings t2 on t.id = t2.protocol_id
|
||
|
join contracts_purchase_sales t3 on t3.id = t.contract_id
|
||
|
|
||
|
where t.protocol_status = 4
|
||
|
and t2.protocol_id is null
|
||
|
|
||
|
@if(!isEmpty(examinationId)){
|
||
|
and t.examination_id =#examinationId#
|
||
|
@}
|
||
|
@if(!isEmpty(flowId)){
|
||
|
and t.flow_id =#flowId#
|
||
|
@}
|