|
|
|
|
getRepaymentInstanceRoleId
|
|
|
|
|
===
|
|
|
|
|
* 正向保理步骤13获取付款id
|
|
|
|
|
SELECT
|
|
|
|
|
`instance_role_id`
|
|
|
|
|
FROM
|
|
|
|
|
`instance_datas`
|
|
|
|
|
WHERE
|
|
|
|
|
`instance_id` = #examinationInstances.id#
|
|
|
|
|
AND json_extract(data,"$[*].financing_no") = #financingNo#
|
|
|
|
|
AND `prefix` = #prefix#
|
|
|
|
|
|
|
|
|
|
ORDER BY
|
|
|
|
|
`id` DESC
|
|
|
|
|
|
|
|
|
|
getContractInstanceRoleId
|
|
|
|
|
===
|
|
|
|
|
* 正向保理 7 8 9 10获取合约实例id
|
|
|
|
|
SELECT
|
|
|
|
|
`instance_role_id`
|
|
|
|
|
FROM
|
|
|
|
|
`instance_datas`
|
|
|
|
|
WHERE
|
|
|
|
|
`instance_id` = #examinationInstances.id#
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.contractNo) ){
|
|
|
|
|
AND `no` = #contractNo#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.acceptNo) ){
|
|
|
|
|
AND `no` = #acceptNo#
|
|
|
|
|
@}
|
|
|
|
|
AND `prefix` = #prefix#
|
|
|
|
|
|
|
|
|
|
ORDER BY
|
|
|
|
|
`id` DESC
|
|
|
|
|
|
|
|
|
|
zxblBlContractList
|
|
|
|
|
===
|
|
|
|
|
* 正向保理 7 8 9 10步骤获取列表
|
|
|
|
|
SELECT
|
|
|
|
|
@pageTag(){
|
|
|
|
|
ie.*
|
|
|
|
|
@}
|
|
|
|
|
FROM
|
|
|
|
|
`instance_datas` ie LEFT JOIN `instance_roles` ir ON ie.instance_role_id=ir.id
|
|
|
|
|
WHERE
|
|
|
|
|
ie.`instance_id` = #examinationInstances.id#
|
|
|
|
|
AND ie.`flow_id` = #userExaminations.flowId#
|
|
|
|
|
AND ie.`examination_id` = #userExaminations.examinationId#
|
|
|
|
|
AND ie.`prefix` = #prefix#
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.instanceRoleId) ){
|
|
|
|
|
AND `instance_role_id` = #instanceRoleId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.blContractNo) ){
|
|
|
|
|
AND `no` = #blContractNo#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.repaymentNo) ){
|
|
|
|
|
AND `no` = #repaymentNo#
|
|
|
|
|
@}
|
|
|
|
|
@if(zxblExaminationQuery.step == 8 ){
|
|
|
|
|
AND ie.`status`>= 1
|
|
|
|
|
@}
|
|
|
|
|
@if(zxblExaminationQuery.step == 9 ){
|
|
|
|
|
AND ie.`status`>= 2
|
|
|
|
|
AND json_extract(ie.data,"$[*].seller_transfer_file") IS NOT NULL
|
|
|
|
|
@}
|
|
|
|
|
@if(zxblExaminationQuery.step == 10 ){
|
|
|
|
|
AND ie.`status`>= 3
|
|
|
|
|
@}
|
|
|
|
|
@if(zxblExaminationQuery.step == 11 ){
|
|
|
|
|
AND ie.`status`>= 4
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.sellerName)){
|
|
|
|
|
AND ir.`seller_name` LIKE #'%'+sellerName+'%'#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.buyerName)){
|
|
|
|
|
AND ir.`buyer_name` LIKE #'%'+buyerName+'%'#
|
|
|
|
|
@}
|
|
|
|
|
ORDER BY
|
|
|
|
|
ie.`id` DESC
|
|
|
|
|
|
|
|
|
|
getInstanceRoleId
|
|
|
|
|
===
|
|
|
|
|
* 获取id
|
|
|
|
|
SELECT
|
|
|
|
|
`instance_role_id`
|
|
|
|
|
FROM
|
|
|
|
|
`instance_datas`
|
|
|
|
|
WHERE
|
|
|
|
|
`prefix` = #prefix#
|
|
|
|
|
AND `status` = 5
|
|
|
|
|
AND `instance_id` = #examinationInstances.id#
|
|
|
|
|
|
|
|
|
|
getSameRoleItem
|
|
|
|
|
===
|
|
|
|
|
* 获取相同的合同
|
|
|
|
|
SELECT
|
|
|
|
|
*
|
|
|
|
|
FROM
|
|
|
|
|
`instance_datas`
|
|
|
|
|
WHERE
|
|
|
|
|
`instance_role_id` = #instanceRoleId#
|
|
|
|
|
AND `prefix` = #prefix#
|
|
|
|
|
AND `instance_id` = #instanceId#
|
|
|
|
|
ORDER BY
|
|
|
|
|
`id` DESC
|
|
|
|
|
LIMIT 1
|
|
|
|
|
|
|
|
|
|
zxblList
|
|
|
|
|
===
|
|
|
|
|
* 获取正向保理融资列表
|
|
|
|
|
SELECT
|
|
|
|
|
@pageTag(){
|
|
|
|
|
ie.*
|
|
|
|
|
@}
|
|
|
|
|
FROM
|
|
|
|
|
`instance_datas` ie LEFT JOIN `instance_roles` ir ON ie.instance_role_id=ir.id
|
|
|
|
|
WHERE
|
|
|
|
|
ie.`instance_id` = #examinationInstances.id#
|
|
|
|
|
AND ie.`flow_id` = #userExaminations.flowId#
|
|
|
|
|
AND ie.`examination_id` = #userExaminations.examinationId#
|
|
|
|
|
AND ie.`prefix` = #prefix#
|
|
|
|
|
@if(zxblExaminationQuery.step == 12 ){
|
|
|
|
|
AND ie.`status`>= 1
|
|
|
|
|
AND ie.`instance_role_id`=#instanceRoleId#
|
|
|
|
|
@}
|
|
|
|
|
@if(zxblExaminationQuery.step == 2){
|
|
|
|
|
AND ie.`status`>= 1
|
|
|
|
|
@}
|
|
|
|
|
@if(zxblExaminationQuery.step == 4){
|
|
|
|
|
AND ie.`status`> 0
|
|
|
|
|
@}
|
|
|
|
|
@if(zxblExaminationQuery.step == 2){
|
|
|
|
|
AND ie.`status`>= 1
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.contractNo)){
|
|
|
|
|
AND ie.`no`=#contractNo#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.sendNo)){
|
|
|
|
|
AND ie.`no`=#sendNo#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.applyNo)){
|
|
|
|
|
AND ie.`no`=#applyNo#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.acceptNo)){
|
|
|
|
|
AND json_extract(ie.data,"$[*].accept_no") like '%'#acceptNo#''%'
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.financingNo)){
|
|
|
|
|
AND json_extract(ie.data,"$[*].financing_no") like '%'#financingNo#''%'
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.startTime)){
|
|
|
|
|
AND ie.`time`>=#startTime#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.endTime)){
|
|
|
|
|
AND ie.`time`<=#endTime#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.sellerName)){
|
|
|
|
|
AND ir.`seller_name` LIKE #'%'+sellerName+'%'#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(zxblExaminationQuery.buyerName)){
|
|
|
|
|
AND ir.`buyer_name` LIKE #'%'+buyerName+'%'#
|
|
|
|
|
@}
|
|
|
|
|
ORDER BY
|
|
|
|
|
ie.`id` DESC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
queryByCondition
|
|
|
|
|
===
|
|
|
|
|
* 根据不为空的参数进行分页查询
|
|
|
|
|
|
|
|
|
|
select
|
|
|
|
|
@pageTag(){
|
|
|
|
|
t.*
|
|
|
|
|
@}
|
|
|
|
|
from instance_datas t
|
|
|
|
|
where 1=1
|
|
|
|
|
@//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行
|
|
|
|
|
and #function("instanceDatas.query")#
|
|
|
|
|
@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(parentId)){
|
|
|
|
|
and t.parent_id =#parentId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(prefix)){
|
|
|
|
|
and t.prefix =#prefix#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(no)){
|
|
|
|
|
and t.no =#no#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(status)){
|
|
|
|
|
and t.status =#status#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(time)){
|
|
|
|
|
and t.time =#time#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(createdAt)){
|
|
|
|
|
and t.created_at =#createdAt#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(updatedAt)){
|
|
|
|
|
and t.updated_at =#updatedAt#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(data)){
|
|
|
|
|
and t.data =#data#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(instanceRoleId)){
|
|
|
|
|
and t.instance_role_id =#instanceRoleId#
|
|
|
|
|
@}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deleteInstanceDatasByIds
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
* 批量删除
|
|
|
|
|
|
|
|
|
|
delete from instance_datas where find_in_set(id,#ids#)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getInstanceDatasValues
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
* 根据不为空的参数进行查询
|
|
|
|
|
|
|
|
|
|
select t.*
|
|
|
|
|
from instance_datas t
|
|
|
|
|
where 1=1
|
|
|
|
|
@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(parentId)){
|
|
|
|
|
and t.parent_id =#parentId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(prefix)){
|
|
|
|
|
and t.prefix =#prefix#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(no)){
|
|
|
|
|
and t.no =#no#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(status)){
|
|
|
|
|
and t.status =#status#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(time)){
|
|
|
|
|
and t.time =#time#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(createdAt)){
|
|
|
|
|
and t.created_at =#createdAt#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(updatedAt)){
|
|
|
|
|
and t.updated_at =#updatedAt#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(data)){
|
|
|
|
|
and t.data =#data#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(instanceRoleId)){
|
|
|
|
|
and t.instance_role_id =#instanceRoleId#
|
|
|
|
|
@}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getValuesByQuery
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
* 根据不为空的参数进行查询
|
|
|
|
|
|
|
|
|
|
select t.*
|
|
|
|
|
from instance_datas t
|
|
|
|
|
where 1=1
|
|
|
|
|
@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(parentId)){
|
|
|
|
|
and t.parent_id =#parentId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(prefix)){
|
|
|
|
|
and t.prefix =#prefix#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(no)){
|
|
|
|
|
and t.no =#no#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(status)){
|
|
|
|
|
and t.status =#status#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(time)){
|
|
|
|
|
and t.time =#time#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(createdAt)){
|
|
|
|
|
and t.created_at =#createdAt#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(updatedAt)){
|
|
|
|
|
and t.updated_at =#updatedAt#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(data)){
|
|
|
|
|
and t.data =#data#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(instanceRoleId)){
|
|
|
|
|
and t.instance_role_id =#instanceRoleId#
|
|
|
|
|
@}
|