MAX(ifnull ( icbc.cust_name, ph.owners_name )) AS custName,
MAX(ph.owners_name ) AS custName,
MAX(ifnull ( icbc.phone, ph.telephone )) AS phone,
MAX(ph.telephone) AS phone,
MAX(ifnull ( icbc.id_card, ph.id_card )) AS idCard,
MAX(ph.id_card) AS idCard,
MAX(ph.amos_user_id) AS amosUserId,
MAX(ph.amos_user_id) AS amosUserId,
MAX(icbc.open_account_status) AS openAccountStatus,
MAX(icbc.open_account_status) AS openAccountStatus,
MAX(icbc.out_user_id) AS outUserId,
MAX(icbc.out_user_id) AS outUserId,
...
@@ -132,11 +132,11 @@
...
@@ -132,11 +132,11 @@
</if>
</if>
) ph
) ph
LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
LEFT JOIN ( SELECT amos_user_id, MAX ( payment_time ) payment_time, SUM ( payment_amount ) paymentAmount FROM hygf_icbc_withhold_record WHERE withhold_status = '成功' GROUP BY amos_user_id ) wr ON wr.amos_user_id = icbc.amos_user_id
LEFT JOIN ( SELECT amos_user_id, MAX ( payment_time ) payment_time, SUM ( payment_amount ) paymentAmount FROM hygf_icbc_withhold_record WHERE withhold_status = '成功' GROUP BY amos_user_id ) wr ON wr.amos_user_id = ph.amos_user_id
<where>
<where>
1=1
1=1
<iftest="param.type != null and param.type != ''">
<iftest="param.type != null and param.type != ''">
AND icbc.type LIKE CONCAT('%', #{param.type}, '%')
AND icbc.type = #{param.type}
</if>
</if>
<iftest="param != null">
<iftest="param != null">
<iftest="param.openAccountStatus != null and param.openAccountStatus != ''">
<iftest="param.openAccountStatus != null and param.openAccountStatus != ''">