|
@@ -34,4 +34,77 @@
|
|
|
SELECT '总计'
|
|
|
) AS eva
|
|
|
</select>
|
|
|
+
|
|
|
+ <sql id="personalEfficiencyDetailQuery">
|
|
|
+ SELECT personal.id,
|
|
|
+ personal.order_id,
|
|
|
+ personal.location,
|
|
|
+ (SELECT name FROM customer_company WHERE id = personal.clientele_id) AS customerName,
|
|
|
+ (SELECT name FROM customer_company WHERE id = personal.clientele_sub_id) AS customerSubName,
|
|
|
+ personal.agent,
|
|
|
+ personal.bailorA AS bailor,
|
|
|
+ target.acreage,
|
|
|
+ target.price,
|
|
|
+ target.amount,
|
|
|
+ statement.created AS writeStatementDate,
|
|
|
+ report.created AS writeReportDate,
|
|
|
+ JSON_EXTRACT(selling_ability, '$.sceneDateD') AS valuationDate,
|
|
|
+ personal.purpose,
|
|
|
+ fund.should_amount,
|
|
|
+ fund.real_amount,
|
|
|
+ (SELECT name FROM user WHERE user.id = personal.client_manager_id) AS clientManagerName,
|
|
|
+ nodeInfo.currentNodeName,
|
|
|
+ nodeInfo.handlerName
|
|
|
+ FROM personal
|
|
|
+ LEFT JOIN personal_target AS target ON personal.id = target.personal_id
|
|
|
+ LEFT JOIN order_fund AS fund ON fund.business_id = personal.id AND fund.business_type = 'PERSONAL_BUSINESS'
|
|
|
+ LEFT JOIN personal_production AS statement ON statement.target_id = target.id AND statement.production = 'STATEMENT' AND statement.deleted = 0
|
|
|
+ LEFT JOIN personal_production AS report ON report.target_id = target.id AND report.production != 'STATEMENT' AND report.deleted = 0
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT node.name AS currentNodeName,
|
|
|
+ instance.business_id AS businessId,
|
|
|
+ user.name AS handlerName
|
|
|
+ FROM work_node AS node,
|
|
|
+ work_flow_node_instance AS instance,
|
|
|
+ work_task_record AS record,
|
|
|
+ user
|
|
|
+ WHERE node.id = instance.node_id
|
|
|
+ AND instance.id = record.instance_id
|
|
|
+ AND record.handler_id = user.id
|
|
|
+ AND business_type = 'PERSONAL_BUSINESS'
|
|
|
+ AND instance.state = 'PENDING'
|
|
|
+ AND instance.deleted = 0
|
|
|
+ ) AS nodeInfo ON personal.id = nodeInfo.businessId
|
|
|
+ WHERE personal.deleted = 0
|
|
|
+ <if test="dto != null and dto.evaluateAim != '总计'">
|
|
|
+ AND evaluate_aim = #{dto.evaluateAim}
|
|
|
+ </if>
|
|
|
+ <if test="dto != null and dto.efficiencyType == 'order'">
|
|
|
+ AND personal.created BETWEEN #{dto.startTime} AND #{dto.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="dto != null and dto.efficiencyType == 'statement'">
|
|
|
+ AND statement.created BETWEEN #{dto.startTime} AND #{dto.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="dto != null and dto.efficiencyType == 'report'">
|
|
|
+ AND report.created BETWEEN #{dto.startTime} AND #{dto.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="dto != null and dto.efficiencyType == 'should'">
|
|
|
+ AND fund.created BETWEEN #{dto.startTime} AND #{dto.endTime}
|
|
|
+ AND fund.should_amount IS NOT NULL
|
|
|
+ </if>
|
|
|
+ <if test="dto != null and dto.efficiencyType == 'real'">
|
|
|
+ AND fund.created BETWEEN #{dto.startTime} AND #{dto.endTime}
|
|
|
+ AND fund.real_amount IS NOT NULL
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!--获取效率值相关个贷订单列表-->
|
|
|
+ <select id="getPersonalEfficiencyDetailVO" resultType="com.dayou.vo.PersonalEfficiencyDetailVO">
|
|
|
+ <include refid="personalEfficiencyDetailQuery" />
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--导出效率值相关个贷订单列表-->
|
|
|
+ <select id="exportPersonalEfficiencyDetailVO" resultType="com.dayou.vo.PersonalEfficiencyDetailVO">
|
|
|
+ <include refid="personalEfficiencyDetailQuery" />
|
|
|
+ </select>
|
|
|
</mapper>
|