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.
377 lines
8.3 KiB
Markdown
377 lines
8.3 KiB
Markdown
2 years ago
|
queryCondition
|
||
|
===
|
||
|
|
||
|
* 查询条件
|
||
|
|
||
|
@if(!isEmpty(id)){
|
||
|
and t.id =#id#
|
||
|
@}
|
||
|
@if(!isEmpty(examinationId)){
|
||
|
and t.examination_id =#examinationId#
|
||
|
@}
|
||
|
@if(!isEmpty(flowId)){
|
||
|
and t.flow_id =#flowId#
|
||
|
@}
|
||
|
@if(!isEmpty(instanceId)){
|
||
|
and t.instance_id =#instanceId#
|
||
|
@}
|
||
|
@if(!isEmpty(applyNo)){
|
||
|
and t.apply_no =#applyNo#
|
||
|
@}
|
||
|
@if(!isEmpty(applyStatus)){
|
||
|
and t.apply_status =#applyStatus#
|
||
|
@}
|
||
|
@if(!isEmpty(financingNo)){
|
||
|
and t.financing_no =#financingNo#
|
||
|
@}
|
||
|
@if(!isEmpty(financingStatus)){
|
||
|
and t.financing_status =#financingStatus#
|
||
|
@}
|
||
|
@if(!isEmpty(levyStatus)){
|
||
|
and t.levy_status =#levyStatus#
|
||
|
@}
|
||
|
@if(!isEmpty(buyerName)){
|
||
|
and t2.buyer_name like #'%'+buyerName+'%'#
|
||
|
@}
|
||
|
@if(!isEmpty(sellerName)){
|
||
|
and t2.seller_name like #'%'+sellerName+'%'#
|
||
|
@}
|
||
|
@if(!isEmpty(applyStatus)){
|
||
|
and t.apply_status like #'%'+applyStatus+'%'#
|
||
|
@}
|
||
|
|
||
|
|
||
|
queryByCondition
|
||
|
===
|
||
|
|
||
|
* 根据不为空的参数进行查询 不分页
|
||
|
|
||
|
select
|
||
|
t.*
|
||
|
from financings t
|
||
|
where 1=1
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
|
||
|
pageQueryByCondition
|
||
|
===
|
||
|
|
||
|
* 根据不为空的参数进行分页查询 正向保理
|
||
|
|
||
|
select
|
||
|
@pageTag(){
|
||
|
t.*, t2.buyer_name, t2.seller_name
|
||
|
@}
|
||
|
from financings t
|
||
|
join contracts_purchase_sales t2 on t2.id = t.contract_id
|
||
|
where 1=1
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
|
||
|
yszkPageQueryByCondition
|
||
|
===
|
||
|
|
||
|
* 根据不为空的参数进行分页查询 应收账款质押融资
|
||
|
|
||
|
select
|
||
|
@pageTag(){
|
||
|
t.*,
|
||
|
t2.buyer_name, t2.seller_name,
|
||
|
t3.send_no,
|
||
|
t4.credit_level seller_credit_level, t4.corporation seller_corporation, t4.telephone seller_telephone,
|
||
|
t5.zy_contract_no
|
||
|
@}
|
||
|
from financings t
|
||
|
join contracts_purchase_sales t2 on t2.id = t.contract_id
|
||
|
join send_products t3 on t3.contract_id = t2.id
|
||
|
join materials t4 on t4.id = t.seller_id
|
||
|
left join contracts_pledge t5 on t5.financing_id = t.id
|
||
|
where 1=1
|
||
|
#use("queryCondition")#
|
||
|
@if(!isEmpty(step) && step == 12){
|
||
|
and t.apply_status = 2
|
||
|
@}
|
||
|
@if(!isEmpty(step) && step == 14){
|
||
|
and t.apply_status = 2
|
||
|
and t.financing_status > 0
|
||
|
@}
|
||
|
|
||
|
|
||
|
|
||
|
bdcPageQueryByCondition
|
||
|
===
|
||
|
|
||
|
* 根据不为空的参数进行分页查询 保兑仓
|
||
|
|
||
|
select
|
||
|
@pageTag(){
|
||
|
t.*, t2.buyer_name, t2.seller_name,
|
||
|
t3.express_name, t3.assure_amount,
|
||
|
t4.credit_level buyer_credit_level,
|
||
|
t4.corporation buyer_corporation, t4.telephone buyer_telephone
|
||
|
@}
|
||
|
from financings t
|
||
|
join contracts_purchase_sales t2 on t2.id = t.contract_id
|
||
|
left join assure t3 on t3.financing_id = t.id
|
||
|
join materials t4 on t4.id = t.buyer_id
|
||
|
where 1=1
|
||
|
#use("queryCondition")#
|
||
|
@if(!isEmpty(step) && (step == 9 || step == 12)){
|
||
|
and t.apply_status != 0
|
||
|
@}
|
||
|
@if(!isEmpty(financingStatusGreater)){
|
||
|
and t.financing_status > #financingStatusGreater#
|
||
|
@}
|
||
|
|
||
|
|
||
|
|
||
|
chzyPageQueryByCondition
|
||
|
===
|
||
|
|
||
|
* 根据不为空的参数进行分页查询 存货质押
|
||
|
|
||
|
select
|
||
|
@pageTag(){
|
||
|
t.*, (t.fk_amount + t.interest_amount - t.repayment_amount) financing_amount,
|
||
|
t2.express_id, t2.express_name,
|
||
|
t3.send_no,
|
||
|
t4.telephone seller_telephone, t4.corporation seller_corporation
|
||
|
@}
|
||
|
from financings t
|
||
|
join protocols t2 on t2.id = t.protocol_id
|
||
|
join send_products t3 on t3.protocol_id = t2.id
|
||
|
join materials t4 on t4.id = t.seller_id
|
||
|
where 1=1
|
||
|
@if(!isEmpty(examinationId)){
|
||
|
and t.examination_id =#examinationId#
|
||
|
@}
|
||
|
@if(!isEmpty(flowId)){
|
||
|
and t.flow_id =#flowId#
|
||
|
@}
|
||
|
@if(!isEmpty(instanceId)){
|
||
|
and t.instance_id =#instanceId#
|
||
|
@}
|
||
|
@if(!isEmpty(sellerName)){
|
||
|
and t.seller_name like #'%'+sellerName+'%'#
|
||
|
@}
|
||
|
@if(!isEmpty(step) && step == 9){
|
||
|
and t.apply_status = 2
|
||
|
@}
|
||
|
@if(!isEmpty(step) && step == 16){
|
||
|
and t.apply_status = 2
|
||
|
and t.financing_status > 0
|
||
|
@}
|
||
|
|
||
|
|
||
|
zxblPageQueryByCondition
|
||
|
===
|
||
|
|
||
|
* 根据不为空的参数进行分页查询 正向保理申请
|
||
|
|
||
|
select
|
||
|
@pageTag(){
|
||
|
t.*, t2.send_no, t2.buyer_id, t2.buyer_name
|
||
|
@}
|
||
|
from financings t
|
||
|
join send_products t2 on t2.contract_id = t.contract_id
|
||
|
where 1=1
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
|
||
|
zxblFinancingLoans
|
||
|
===
|
||
|
|
||
|
* 正向保理融资放款分页查询
|
||
|
|
||
|
select
|
||
|
@pageTag(){
|
||
|
t.*, t4.telephone seller_telephone, t4.corporation seller_corporation,
|
||
|
t2.bl_contract_no
|
||
|
@}
|
||
|
from financings t
|
||
|
join contracts_factoring t2 on t2.accept_no = t.accept_no
|
||
|
join yszk_transfer t3 on t3.bl_contract_no = t2.bl_contract_no
|
||
|
join materials t4 on t4.id = t.seller_id
|
||
|
where t3.transfer_status > 2
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
fxblPageQueryByCondition
|
||
|
===
|
||
|
|
||
|
* 根据不为空的参数进行分页查询 反向保理
|
||
|
|
||
|
select
|
||
|
@pageTag(){
|
||
|
t.*,
|
||
|
t2.buyer_name, t2.seller_name,
|
||
|
t3.yfzk_amount
|
||
|
@}
|
||
|
from financings t
|
||
|
join contracts_purchase_sales t2 on t2.id = t.contract_id
|
||
|
join recommend_supplier t3 on t3.contract_id = t.contract_id
|
||
|
where 1=1
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
zxblApplyList
|
||
|
===
|
||
|
|
||
|
* 正向保理 可以签订保理合同的融资申请
|
||
|
|
||
|
select
|
||
|
t.*
|
||
|
from financings t
|
||
|
left join contracts_factoring t2 on t2.accept_no = t.accept_no
|
||
|
where t2.accept_no is null
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
repaymentFinancingNoList
|
||
|
===
|
||
|
|
||
|
* 需要还款的融资列表
|
||
|
|
||
|
select
|
||
|
t.financing_no
|
||
|
from financings t
|
||
|
where t.financing_status != 9
|
||
|
and apply_status = 2
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
|
||
|
getDetailByBlContranctNo
|
||
|
===
|
||
|
|
||
|
* 根据保理合同编号获取融资信息
|
||
|
|
||
|
select
|
||
|
t.*, t3.buyer_id, t3.buyer_name, t3.contract_time,
|
||
|
t4.telephone seller_telephone, t4.corporation seller_corporation,
|
||
|
t5.telephone buyer_telephone, t5.corporation buyer_corporation,
|
||
|
t5.address buyer_address
|
||
|
from financings t
|
||
|
join contracts_factoring t2 on t2.accept_no = t.accept_no
|
||
|
join contracts_purchase_sales t3 on t.contract_id = t3.id
|
||
|
join materials t4 on t4.id = t.seller_id
|
||
|
join materials t5 on t5.id = t3.buyer_id
|
||
|
where t2.bl_contract_no =#blContractNo#
|
||
|
|
||
|
|
||
|
getDetailByFinancingNo
|
||
|
===
|
||
|
|
||
|
* 根据贷款编号获取融资信息
|
||
|
|
||
|
select
|
||
|
t.*, t3.buyer_id, t3.buyer_name, t3.contract_time,
|
||
|
t4.telephone buyer_telephone, t4.corporation buyer_corporation
|
||
|
from financings t
|
||
|
join contracts_purchase_sales t3 on t.contract_id = t3.id
|
||
|
join materials t4 on t4.id = t3.buyer_id
|
||
|
where t.financing_no =#financingNo#
|
||
|
|
||
|
|
||
|
getChzyDetailByFinancingNo
|
||
|
===
|
||
|
|
||
|
* 根据贷款编号获取融资信息
|
||
|
|
||
|
select
|
||
|
t.*,
|
||
|
t3.in_warehouse_end_time,
|
||
|
t4.telephone seller_telephone, t4.corporation seller_corporation
|
||
|
from financings t
|
||
|
join warehouse_receipt t3 on t3.protocol_id = t.protocol_id
|
||
|
join materials t4 on t4.id = t.seller_id
|
||
|
where t.financing_no =#financingNo#
|
||
|
|
||
|
|
||
|
getFxblDetailByFinancingNo
|
||
|
===
|
||
|
|
||
|
* 根据贷款编号获取融资信息 反向保理
|
||
|
|
||
|
select
|
||
|
t.*,
|
||
|
t2.bl_contract_time,
|
||
|
t3.buyer_id, t3.buyer_name, t3.contract_time,
|
||
|
t4.telephone buyer_telephone, t4.corporation buyer_corporation,
|
||
|
t5.yfzk_amount
|
||
|
from financings t
|
||
|
join contracts_factoring t2 on t2.contract_id = t.contract_id
|
||
|
join contracts_purchase_sales t3 on t.contract_id = t3.id
|
||
|
join materials t4 on t4.id = t3.buyer_id
|
||
|
left join recommend_supplier t5 on t5.contract_id = t.contract_id
|
||
|
where t.financing_no =#financingNo#
|
||
|
|
||
|
|
||
|
|
||
|
getNewBankAcceptanceBillFinancingList
|
||
|
===
|
||
|
|
||
|
* 可以新增银行承兑汇票的融资数据列表
|
||
|
|
||
|
select
|
||
|
t.id, t.financing_no, t.apply_amount, t.accept_no,
|
||
|
t.bank_id, t.bank_name,
|
||
|
t3.contract_amount, t3.contract_no,
|
||
|
t3.buyer_id, t3.buyer_name,
|
||
|
t3.seller_id, t3.seller_name
|
||
|
from financings t
|
||
|
left join bank_acceptance_bill t2 on t.id = t2.financing_id
|
||
|
join contracts_purchase_sales t3 on t3.id = t.contract_id
|
||
|
where t2.financing_id is null and t.apply_status = 2
|
||
|
#use("queryCondition")#
|
||
|
|
||
|
|
||
|
|
||
|
getNewBankAcceptanceBillFinancingDetail
|
||
|
===
|
||
|
|
||
|
* 可以新增银行承兑汇票的融资数据详情
|
||
|
|
||
|
select
|
||
|
t.id, t.financing_no, t.apply_amount, t.accept_no,
|
||
|
t.financing_start_time, t.financing_end_time,
|
||
|
t.bank_id, t.bank_name,
|
||
|
t3.contract_amount, t3.contract_no, t3.id contract_id,
|
||
|
t3.buyer_id, t3.buyer_name,
|
||
|
t3.seller_id, t3.seller_name,
|
||
|
t4.corporation buyer_corporation, t4.account buyer_account,
|
||
|
t5.address bank_address,
|
||
|
t6.account seller_account,
|
||
|
TRIM(both '"' from JSON_EXTRACT(t6.data, '$.bank.name')) seller_bank_name
|
||
|
from financings t
|
||
|
join contracts_purchase_sales t3 on t3.id = t.contract_id
|
||
|
join materials t4 on t4.id = t3.buyer_id
|
||
|
join materials t5 on t5.id = t.bank_id
|
||
|
join materials t6 on t6.id = t3.seller_id
|
||
|
where t.id = #financingId#
|
||
|
|
||
|
|
||
|
|
||
|
updateRepaymentAmount
|
||
|
===
|
||
|
|
||
|
* 修改已还金额
|
||
|
|
||
|
update financings set
|
||
|
repayment_amount = #repaymentAmount# ,
|
||
|
financing_status = #financingStatus#
|
||
|
where financing_no = #financingNo#
|
||
|
|
||
|
|
||
|
deleteFinancingsByIds
|
||
|
===
|
||
|
|
||
|
* 批量删除
|
||
|
|
||
|
delete from financings where find_in_set(id,#ids#)
|
||
|
|
||
|
|