|
@@ -135,8 +135,8 @@
|
|
LEFT JOIN assets_evaluation_target_type AS secType ON evaluation_type_sec_id = secType.id
|
|
LEFT JOIN assets_evaluation_target_type AS secType ON evaluation_type_sec_id = secType.id
|
|
LEFT JOIN assets_value_type AS vType ON assets_value_id = vType.id
|
|
LEFT JOIN assets_value_type AS vType ON assets_value_id = vType.id
|
|
) AS target ON assets.id = target.assets_id
|
|
) AS target ON assets.id = target.assets_id
|
|
- LEFT JOIN assets_production AS report ON report_no = report.production_no
|
|
|
|
- LEFT JOIN assets_production AS statement ON statement_no = statement.production_no
|
|
|
|
|
|
+ LEFT JOIN assets_production AS report ON IF(assets.created < '2025-01-01', report.business_id = assets.id AND report.production_type != 'STATEMENT', report_no = report.production_no)
|
|
|
|
+ LEFT JOIN assets_production AS statement ON IF(assets.created < '2025-01-01', statement.business_id = assets.id AND statement.production_type = 'STATEMENT', statement_no = statement.production_no)
|
|
LEFT JOIN user AS manager ON manager.id = assets.client_manager_id
|
|
LEFT JOIN user AS manager ON manager.id = assets.client_manager_id
|
|
LEFT JOIN user AS principal ON principal.id = assets.principal_id
|
|
LEFT JOIN user AS principal ON principal.id = assets.principal_id
|
|
LEFT JOIN order_fund AS fund ON fund.business_id = assets.id AND fund.business_type = 'ASSET_BUSINESS'
|
|
LEFT JOIN order_fund AS fund ON fund.business_id = assets.id AND fund.business_type = 'ASSET_BUSINESS'
|