|
@@ -926,7 +926,11 @@
|
|
|
ROUND(SUM(IF(cd.defined_low_limit_amount < fc.claim_amount,
|
|
|
fc.claim_amount * (cd.ratio / 100) * (bpd.performance_distribution / 100),
|
|
|
cd.defined_low_limit_amount * (cd.ratio / 100) * (bpd.performance_distribution / 100)
|
|
|
- )), 2) AS commissionTotalAmount,
|
|
|
+ )), 2) AS allCommissionTotalAmount,
|
|
|
+ ROUND(SUM(IF(ap.save_file_date IS NOT NULL, (IF(cd.defined_low_limit_amount < fc.claim_amount,
|
|
|
+ fc.claim_amount * (cd.ratio / 100) * (bpd.performance_distribution / 100),
|
|
|
+ cd.defined_low_limit_amount * (cd.ratio / 100) * (bpd.performance_distribution / 100)
|
|
|
+ )), 0)), 2) AS commissionTotalAmount,
|
|
|
'评估人员' as userType,
|
|
|
'资产业务' as businessType,
|
|
|
#{vo.startDate} as startDate,
|
|
@@ -962,8 +966,7 @@
|
|
|
save_file_date,
|
|
|
created
|
|
|
FROM assets_production
|
|
|
- WHERE deleted = 0
|
|
|
- AND save_file_date IS NOT NULL) ap ON ap.production_no = pf.production_no
|
|
|
+ WHERE deleted = 0) ap ON ap.production_no = pf.production_no
|
|
|
LEFT JOIN assets a ON a.id = ap.business_id
|
|
|
INNER JOIN (SELECT id, business_id, production_id, commission_rate_id, defined_low_limit_amount, ratio
|
|
|
FROM commission_declare
|
|
@@ -1007,7 +1010,8 @@
|
|
|
fc.claim_amount * (cd.ratio / 100),
|
|
|
cd.defined_low_limit_amount * (cd.ratio / 100)
|
|
|
),2) AS totalAmount,
|
|
|
- u.name as userName
|
|
|
+ u.name as userName,
|
|
|
+ pf.modified AS realFundDateTime
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
@@ -1035,8 +1039,8 @@
|
|
|
AND created >= #{vo.startDate}
|
|
|
AND created <= #{vo.endDate}
|
|
|
) fc
|
|
|
- INNER JOIN ( SELECT id, order_fund_id, business_id, production_no FROM production_fund WHERE business_type = 'ASSET_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
|
|
|
- INNER JOIN ( SELECT id, business_id, assets_name, production_no, production_type, save_file_date, created FROM assets_production WHERE deleted = 0 AND save_file_date IS NOT NULL ) ap ON ap.production_no = pf.production_no
|
|
|
+ INNER JOIN ( SELECT id, order_fund_id, business_id, production_no,modified FROM production_fund WHERE business_type = 'ASSET_BUSINESS' AND deleted = 0 ) pf ON ( pf.id = fc.production_fund_id AND pf.order_fund_id = fc.order_fund_id )
|
|
|
+ INNER JOIN ( SELECT id, business_id, assets_name, production_no, production_type, save_file_date, created FROM assets_production WHERE deleted = 0 ) ap ON ap.production_no = pf.production_no
|
|
|
LEFT JOIN assets a ON a.id = ap.business_id
|
|
|
INNER JOIN ( SELECT id, business_id, production_id, commission_rate_id, ratio, defined_low_limit_amount FROM commission_declare WHERE business_type = 'COMMISSION_DECLARE_ASSET_EVALUATE' AND deleted = 0 AND declare_result = '审核通过' ) cd ON (
|
|
|
cd.business_id = a.id
|