<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.nova.sankuai.infra.mapper.CustomerCapitalResultMapper">
|
<select id="orderExamineShow" resultType="com.nova.sankuai.domain.vo.capitalresult.OrderExamineShowVo">
|
SELECT ci.name AS capitalName,
|
cu.first_quota AS totalCredit,
|
ccr.id AS customerCapitalResultId,
|
ccr.approval_result,
|
ci.id AS capitalId,
|
ci.code AS capitalCode,
|
ci.fund_type AS capitalFundType,
|
ci.auto_push
|
FROM customer_capital_result ccr
|
LEFT JOIN capital_info ci ON ccr.capital_info_id = ci.id
|
LEFT JOIN customer_user cu ON ccr.customer_user_id = cu.id AND cu.delete_flag = 0
|
WHERE ccr.customer_user_id = #{customerUserId}
|
AND ccr.customer_record_id = #{customerRecordId}
|
AND ccr.approval_result = 1
|
AND ci.is_top_view = 1
|
ORDER BY ci.seq
|
</select>
|
|
<select id="findCapitalApprovalResultAdopt"
|
resultType="com.nova.sankuai.domain.vo.capitalresult.CapitalApprovalResultAdoptVo">
|
SELECT
|
ccr.id,
|
cu.phone customerUserPhone,
|
cu.name customerUserName,
|
ccr.customer_record_id,
|
ccr.capital_info_id,
|
ccr.capital_info_code,
|
cu.first_quota totalCredit,
|
ci.name capitalName,
|
c.app_name
|
FROM customer_capital_result ccr
|
LEFT JOIN customer_user cu ON ccr.customer_user_id = cu.id
|
LEFT JOIN capital_info ci ON ccr.capital_info_id = ci.id
|
LEFT JOIN customer c ON ccr.customer_record_id = c.id
|
WHERE ccr.approval_result = 1
|
AND ccr.is_send_sms = 0
|
AND ci.auto_push = 0
|
AND ci.fund_type = 0
|
AND ci.is_top_view = 1
|
AND ccr.creation_date BETWEEN #{startDate} AND #{endDate}
|
</select>
|
<select id="makeLoans" resultType="com.nova.sankuai.domain.vo.capitalresult.CapitalMackLoanAdoptVo">
|
select ccr.id,cu.name customerUserName,c.app_name, cu.phone customerUserPhone,ci.name capitalName,c.card_no lastNumber from customer_capital_result ccr,capital_info ci,customer_user cu,customer c
|
where ccr.customer_user_id=cu.id and ci.id = ccr.capital_info_id and c.id = ccr.customer_record_id
|
and ccr.creation_date BETWEEN #{startDate} AND #{endDate} AND ccr.make_loan_send_sms = 0
|
and ccr.third_order_status = 210
|
</select>
|
<select id="selectNotDrawMoneyList" resultType="com.nova.sankuai.domain.vo.capitalresult.NotDrawMoneyVo">
|
select ccr.id,cu.name, cu.phone, ccr.total_credit,ci.name capitalName,c.app_name
|
from customer_capital_result ccr
|
left join customer c on c.id = ccr.customer_record_id
|
left join customer_user cu on ccr.customer_user_id = cu.id
|
left join capital_info ci on ci.id = ccr.capital_info_id
|
where ccr. approval_result = 1
|
and ci.fund_type = 0
|
and ci.auto_push = 0
|
and c.app_name = '卡大拿'
|
and ccr.third_order_status not between 210 and 240
|
order by ccr.creation_date desc
|
</select>
|
</mapper>
|