select au.id,au.role_id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_guarantee_assign_user au
left join dg_apply_amount_info ai on au.business_id = ai.id
left join crms_company_customer ccl on ai.company_id = ccl.id
left join crms_customer cc on cc.id = ccl.customer_id
left JOIN dg_business_process_status ps ON ps.business_id = au.business_id
au.role_id in
#{id}
AND (ai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%'))
AND au.status = #{status}
AND (au.emp_id =#{userId} or au.emp_id is null)
ORDER BY au.create_time DESC
select au.id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_guarantee_assign_user au
left join dg_apply_amount_info ai on au.business_id = ai.id
left join crms_company_customer ccl on ai.company_id = ccl.id
left join crms_customer cc on cc.id = ccl.customer_id
left JOIN dg_business_process_status ps ON ps.business_id = au.business_id
where au.id in
#{id}
UPDATE dg_guarantee_assign_user SET status = #{auditStatus} WHERE business_id = #{businessId}
UPDATE dg_guarantee_assign_user SET operating_status = #{operationStatus}
WHERE business_id = #{businessId} AND (role_id = 59 OR role_id = 60)