You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
1.6 KiB
Markdown
97 lines
1.6 KiB
Markdown
2 years ago
|
queryCondition
|
||
|
===
|
||
|
|
||
|
* 查询条件
|
||
|
|
||
|
@if(!isEmpty(examinationId)){
|
||
|
and t.examination_id =#examinationId#
|
||
|
@}
|
||
|
@if(!isEmpty(flowId)){
|
||
|
and t.flow_id =#flowId#
|
||
|
@}
|
||
|
@ 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 like #'%'+sellerId+'%'#
|
||
|
@}
|
||
|
@ if(!isEmpty(buyerId)){
|
||
|
and t.buyer_id like #'%'+buyerId+'%'#
|
||
|
@}
|
||
|
@ if(!isEmpty(contractStartTime)){
|
||
|
and t.contract_time >= #contractStartTime#
|
||
|
@}
|
||
|
@ if(!isEmpty(contractEndTime)){
|
||
|
and t.contract_time <= #contractEndTime#
|
||
|
@}
|
||
|
@ if(!isEmpty(contractStatus)){
|
||
|
and t.contract_status = #contractStatus#
|
||
|
@}
|
||
|
|
||
|
|
||
|
|
||
|
pageQueryByCondition
|
||
|
===
|
||
|
|
||
|
* 分页查询
|
||
|
|
||
|
select
|
||
|
@pageTag(){
|
||
|
t.*
|
||
|
@}
|
||
|
from contracts_purchase_sales t
|
||
|
where 1 = 1
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
queryByCondition
|
||
|
===
|
||
|
|
||
|
* 不分页查询
|
||
|
|
||
|
select
|
||
|
t.*
|
||
|
from contracts_purchase_sales t
|
||
|
where 1 = 1
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
getNotShipped
|
||
|
===
|
||
|
|
||
|
* 获取未新建发货的购销合同
|
||
|
|
||
|
select
|
||
|
t1.*
|
||
|
from contracts_purchase_sales t1
|
||
|
left join send_products t2 on t2.contract_id = t1.id
|
||
|
where t1.contract_status = 2 and t2.contract_id is null
|
||
|
@if(!isEmpty(examinationId)){
|
||
|
and t1.examination_id =#examinationId#
|
||
|
@}
|
||
|
@if(!isEmpty(flowId)){
|
||
|
and t1.flow_id =#flowId#
|
||
|
@}
|
||
|
|
||
|
|
||
|
queryDetailById
|
||
|
===
|
||
|
|
||
|
select
|
||
|
t1.*, t2.accept_time
|
||
|
from contracts_purchase_sales t1
|
||
|
left join send_products t2 on t2.contract_id = t1.id
|
||
|
where t1.id = #id#
|
||
|
|
||
|
queryDetailBySendId
|
||
|
===
|
||
|
|
||
|
select
|
||
|
t1.*
|
||
|
from contracts_purchase_sales t1
|
||
|
join send_products t2 on t2.contract_id = t1.id
|
||
|
where t2.id = #sendId#
|