|
@@ -661,7 +661,7 @@
|
|
major_production mp
|
|
major_production mp
|
|
left join major m on m.id = mp.major_id
|
|
left join major m on m.id = mp.major_id
|
|
INNER JOIN ( SELECT id,business_id,should_amount FROM order_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) orf ON orf.business_id = m.id
|
|
INNER JOIN ( SELECT id,business_id,should_amount FROM order_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0 ) orf ON orf.business_id = m.id
|
|
- LEFT JOIN ( SELECT id,business_id,production_no,real_amount,standard_amount,production_should_amount FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0) off ON (off.business_id = m.id and off.production_no = mp.report_no)
|
|
|
|
|
|
+ LEFT JOIN ( SELECT id,business_id,production_no,real_amount,standard_amount,production_should_amount,production_type FROM production_fund WHERE business_type = 'MAJOR_BUSINESS' AND deleted = 0) off ON (off.business_id = m.id and off.production_no = mp.report_no and off.production_type = mp.production)
|
|
LEFT JOIN user u ON u.id = m.principal_id
|
|
LEFT JOIN user u ON u.id = m.principal_id
|
|
LEFT JOIN user u1 ON u1.id = m.client_manager_id
|
|
LEFT JOIN user u1 ON u1.id = m.client_manager_id
|
|
LEFT JOIN customer_company cc ON cc.id = m.clientele_id
|
|
LEFT JOIN customer_company cc ON cc.id = m.clientele_id
|