select '' as name
select name from biz_company where biz_company.id = #{source_id}
select nick_name from sys_user where sys_user.user_id = #{source_id}
select name from biz_channel where biz_channel.id = #{source_id}
select '' as name
select count(1) from biz_archive_input t where t.deleted = 0
and t.from_id = #{id}
and t.from_id = #{from_id} or t.id = #{from_id}
SELECT
t1.*,
t2.name as company_name,
t2.social_credit_code as social_credit_code,
t3.nick_name as signer_name,
t4.title as source_category_name,
t4.referrer_data_source
FROM biz_archive_input t1
left join biz_company t2 on t2.id = t1.company_id
left join sys_user t3 on t3.user_id = t1.signer_id
left join biz_source t4 on t4.id = t1.source_category_id
t1.deleted = 0
AND (t1.from_id = #{fromId} or t1.id = #{fromId})
AND t1.id = #{id}
AND t2.name like concat("%", #{companyName}, "%")
and archive_type_id = #{archiveTypeId}
AND t1.company_id = #{companyId}
AND t1.archive_code = #{archiveCode}
AND t1.start_month = #{startMonth}
AND t1.end_month = #{endMonth}
AND t1.proof_url = #{proofUrl}
AND t1.contract_no = #{contractNo}
AND t1.form_date = #{formDate}
AND t1.amount = #{amount}
AND t1.verify_status = #{verifyStatus}
AND t1.contract_type = #{contractType}
AND t1.service_type = #{serviceType}
AND t1.output_date = #{outputDate}
AND t1.month_num = #{monthNum}
AND t2.name like concat('%', #{companyName}, '%')
AND t1.verify_remark = #{verifyRemark}
AND t1.tenant_id = #{tenantId}
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 1)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 2)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 3)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 4)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 5)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 6)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 7)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 8)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 9)
SELECT
t1.*,
t2.name as company_name,
t2.customer_label_id as customerLabelId,
t5.lable as customerLabelName,
t2.social_credit_code as social_credit_code,
t3.nick_name as signer_name,
t4.title as source_category_name,
t4.referrer_data_source
FROM biz_archive_input t1
left join biz_company t2 on t2.id = t1.company_id
left join sys_user t3 on t3.user_id = t1.signer_id
left join biz_source t4 on t4.id = t1.source_category_id
left join biz_lable t5 on t5.id = t2.customer_label_id
t1.deleted = 0
AND (t1.from_id = #{fromId} or t1.id = #{fromId})
AND t1.id = #{id}
AND t1.contract_no like concat("%",#{contractNo}, "%")
AND t2.name like concat("%", #{companyName}, "%")
and archive_type_id = #{archiveTypeId}
AND t1.company_id = #{companyId}
AND t1.archive_code = #{archiveCode}
AND t1.start_month = #{startMonth}
AND t1.end_month = #{endMonth}
AND t1.proof_url = #{proofUrl}
AND t1.boss like concat("%",#{boss}, "%")
AND (
DATE_FORMAT(t1.form_date,'%Y-%m-%d') >= #{formDate[0]}
AND
DATE_FORMAT(t1.form_date,'%Y-%m-%d') <= #{formDate[1]}
)
AND t1.amount = #{amount}
AND t1.verify_status = #{verifyStatus}
AND t1.contract_type = #{contractType}
AND t1.service_type = #{serviceType}
AND t1.output_date = #{outputDate}
AND t1.month_num = #{monthNum}
AND t2.name like concat('%', #{companyName}, '%')
AND t1.verify_remark = #{verifyRemark}
AND t1.tenant_id = #{tenantId}
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 1)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 2)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 3)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 4)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 5)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 6)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 7)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 8)
AND not exists (select 1 from
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 9)
AND t2.customer_label_id IN
#{item,jdbcType=BIGINT}
UPDATE biz_archive_input
SET deleted=1
WHERE id in
#{id}
update biz_entrust entrust set entrust.deleted = 1,update_time = now(),updater_id = #{updaterId}
where work_order_id = #{workOrderId}
and task_type_id = #{taskTypeId}
#{endDate} ]]>
DELETE FROM biz_archive_input
AND id = #{id}
AND tenant_id = #{tenantId}