AND users.admin_flg = 0 AND users.status in (2,3,4,5,6,7)
GROUP BY
currency)
</LIST_TRANSFER_TOTAL_FROM_TO>
<SELECT_TRANSFER>
<SELECT_TRANSFER>
SELECT
SELECT
transfer.t_id AS t_id
transfer.t_id AS t_id
...
@@ -3002,7 +2877,7 @@
...
@@ -3002,7 +2877,7 @@
, '__ELEMENT17__'
, '__ELEMENT17__'
, '__ELEMENT18__'
, '__ELEMENT18__'
, '__ELEMENT19__'
, '__ELEMENT19__'
, NOW() + INTERVAL 16 HOUR
, CONVERT_TZ(NOW(),@@session.time_zone,'+09:00')
, '__ELEMENT20__'
, '__ELEMENT20__'
)
)
</INSERT_TRANSFER_API>
</INSERT_TRANSFER_API>
...
@@ -3069,6 +2944,45 @@
...
@@ -3069,6 +2944,45 @@
)
)
</INSERT_TRANSFER_CSV>
</INSERT_TRANSFER_CSV>
<INSERT_SETTLEMENT_FORM>
INSERT INTO t_settlement_forms
(
form_name,
form_owner,
form_data,
create_time
)
VALUES
(
'__ELEMENT01__',
'__ELEMENT02__',
'__ELEMENT03__',
CONVERT_TZ(NOW(), @@session.time_zone, "+09:00")
)
</INSERT_SETTLEMENT_FORM>
<SELECT_SETTLEMENT_FORM>
SELECT * FROM
t_settlement_forms
WHERE
form_name = '__ELEMENT01__'
</SELECT_SETTLEMENT_FORM>
<UPDATE_SETTLEMENT_FORM>
UPDATE t_settlement_forms
SET
is_paid = 1
WHERE
form_name = '__ELEMENT01__'
</UPDATE_SETTLEMENT_FORM>
<DELETE_SETTLEMENT_FORM>
DELETE FROM
t_settlement_forms
WHERE
form_name = '__ELEMENT01__'
</DELETE_SETTLEMENT_FORM>
<!--
<!--
処理履歴の件数取得
処理履歴の件数取得
条 件:なし
条 件:なし
...
@@ -3392,7 +3306,7 @@
...
@@ -3392,7 +3306,7 @@
, t_id AS transaction_id
, t_id AS transaction_id
FROM
FROM
t_transfer
t_transfer
WHERE NOW() + INTERVAL 16 HOUR > t_transfer.create_time
WHERE CONVERT_TZ(NOW(),@@session.time_zone,'+09:00') > t_transfer.create_time
UNION ALL
UNION ALL
SELECT /* 通貨両替 */
SELECT /* 通貨両替 */
create_time AS transaction_time
create_time AS transaction_time
...
@@ -3772,7 +3686,7 @@ FROM
...
@@ -3772,7 +3686,7 @@ FROM
t_deposit
t_deposit
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND NOW() + INTERVAL 16 HOUR > deposit_date
AND CONVERT_TZ(NOW(),@@session.time_zone,'+09:00') > deposit_date
AND currency = '__ELEMENT02__'
AND currency = '__ELEMENT02__'
UNION ALL
UNION ALL
SELECT /* 通常出金 */
SELECT /* 通常出金 */
...
@@ -4100,7 +4014,7 @@ WHERE
...
@@ -4100,7 +4014,7 @@ WHERE
t_deposit
t_deposit
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND NOW() + INTERVAL 16 HOUR > deposit_date
AND CONVERT_TZ(NOW(),@@session.time_zone,'+09:00') > deposit_date
AND currency = '__ELEMENT02__'
AND currency = '__ELEMENT02__'
UNION ALL
UNION ALL
SELECT /* 通常出金 */
SELECT /* 通常出金 */
...
@@ -4414,7 +4328,7 @@ WHERE
...
@@ -4414,7 +4328,7 @@ WHERE
FROM (
FROM (
SELECT
SELECT
(SELECT COUNT(*) FROM t_deposit WHERE user_account = '__ELEMENT01__'
(SELECT COUNT(*) FROM t_deposit WHERE user_account = '__ELEMENT01__'
AND currency = '__ELEMENT02__' __ELEMENT03__ AND NOW() + INTERVAL 16 HOUR > deposit_date) deposit,
AND currency = '__ELEMENT02__' __ELEMENT03__ AND CONVERT_TZ(NOW(),@@session.time_zone,'+09:00') > deposit_date) deposit,
(SELECT COUNT(*) FROM t_withdraw WHERE user_account = '__ELEMENT01__'
(SELECT COUNT(*) FROM t_withdraw WHERE user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__' __ELEMENT03__ AND STATUS <= 3
AND debit_currency = '__ELEMENT02__' __ELEMENT03__ AND STATUS <= 3
...
@@ -4479,7 +4393,7 @@ WHERE
...
@@ -4479,7 +4393,7 @@ WHERE
t_deposit
t_deposit
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND NOW() + INTERVAL 16 HOUR > deposit_date
AND CONVERT_TZ(NOW(),@@session.time_zone,'+09:00') > deposit_date
AND currency = '__ELEMENT02__'
AND currency = '__ELEMENT02__'
UNION ALL
UNION ALL
SELECT /* 通常出金 */
SELECT /* 通常出金 */
...
@@ -4773,89 +4687,277 @@ WHERE
...
@@ -4773,89 +4687,277 @@ WHERE
__ELEMENT03__
__ELEMENT03__
</LIST_USER_TRANSACTION_ADMIN_COUNT>
</LIST_USER_TRANSACTION_ADMIN_COUNT>
<SELECT_USER_TRANSACTION_ADMIN_COUNT>
<LIST_USER_TRANSACTION_ADMIN_COUNT_REVISED>
SELECT COUNT(*) as overall_total FROM (
SELECT
SELECT /* 通常入金 */
count(trans.currency) total,
create_time AS transaction_time
trans.currency as currency
, deposit_date AS process_time
FROM
, DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string
(
, DATE_FORMAT(deposit_date, '%Y/%m/%d') AS process_time_string
SELECT
, transaction_number AS transaction_number
user_account,
, '1' AS transaction_type
currency,
, '' AS withdraw_account_number
transaction_number,
, user_account AS deposit_account_number
create_time AS transaction_time,
, '' AS withdraw_amount
deposit_date AS process_time,
, '' AS withdraw_fee
DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string,
, amount AS deposit_amount
DATE_FORMAT(deposit_date, '%Y/%m/%d') AS process_time_string,
, fee AS deposit_fee
'' AS withdraw_account_number,
, '' AS rate
user_account AS deposit_account_number,
, currency AS deposit_currency
'1' AS transaction_type,
, '' AS withdraw_currency
'' AS withdraw_amount,
, '' AS transfer_currency
'' AS withdraw_fee,
, '' AS transfer_amount
0 AS type,
, 0 AS TYPE
amount AS deposit_amount,
, 0 AS STATUS
fee AS deposit_fee,
, message AS message
msecond
, method AS method
, msecond AS msecond
, 0 AS process_status
FROM
FROM
t_deposit
t_deposit
WHERE CONVERT_TZ(NOW(),@@session.time_zone,'+09:00') > deposit_date AND user_account = '__ELEMENT01__'
UNION ALL
SELECT
user_account,
currency,
transaction_number,
create_time AS transaction_time,
create_time AS process_time,
DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string,
DATE_FORMAT(create_time, '%Y/%m/%d') AS process_time_string,
user_account AS withdraw_account_number,
0 AS deposit_account_number,
'3' AS transaction_type,
0 AS withdraw_amount,
'' AS withdraw_fee,
0 AS type,
amount AS deposit_amount,
0 AS deposit_fee,
msecond
FROM
t_exchange
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND NOW() + INTERVAL 16 HOUR > deposit_date
UNION ALL
AND currency = '__ELEMENT02__'
SELECT
UNION
user_account,
SELECT /* 両替(入金) */
debit_currency AS currency,
create_time AS transaction_time
transaction_number,
, create_time AS process_time
create_time AS transaction_time,
, DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string
create_time AS process_time,
, DATE_FORMAT(create_time, '%Y/%m/%d') AS process_time_string
DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string,
, transaction_number AS transaction_number
DATE_FORMAT(create_time, '%Y/%m/%d') AS process_time_string,
, '3' AS transaction_type
user_account AS withdraw_account_number,
, '' AS withdraw_account_number
0 AS deposit_account_number,
, user_account AS deposit_account_number
'4' AS transaction_type,
, 0 AS withdraw_amount
debit_amount AS withdraw_amount,
, '' AS withdraw_fee
0 AS withdraw_fee,
, amount AS deposit_amount
0 AS type,
, 0 AS deposit_fee
0 AS deposit_amount,
, '' AS rate
'' AS deposit_fee,
, currency AS deposit_currency
msecond
, '' AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_amount
, 0 AS TYPE
, 0 AS STATUS
, '' AS message
, '' AS method
, msecond AS msecond
, 0 AS process_status
FROM
FROM
t_exchange
t_exchange
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND currency = '__ELEMENT02__'
UNION ALL
UNION
SELECT
SELECT /* 通常出金 */
user_account,
create_time AS transaction_time
debit_currency AS currency,
, process_time AS process_time
transaction_number,
, DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string
create_time AS transaction_time,
, DATE_FORMAT(process_time, '%Y/%m/%d') AS process_time_string
create_time AS process_time,
, transaction_number AS transaction_number
DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string,
, '2' AS transaction_type
DATE_FORMAT(create_time, '%Y/%m/%d') AS process_time_string,
, '' AS withdraw_account_number
from_account AS withdraw_account_number,
, '' AS deposit_account_number
to_account AS deposit_account_number,
, debit_amount AS withdraw_amount
'5' AS transaction_type,
, fee AS withdraw_fee
debit_amount AS withdraw_amount,
, '' AS deposit_amount
from_fee AS withdraw_fee,
0 AS type,
'' AS deposit_amount,
'' AS deposit_fee,
msecond
FROM
t_transfer
WHERE
user_account = '__ELEMENT01__'
UNION ALL
SELECT
to_account AS user_account,
transfer_currency AS currency,
transaction_number,
create_time AS transaction_time,
create_time AS process_time,
DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string,
DATE_FORMAT(create_time, '%Y/%m/%d') AS process_time_string,
from_account AS withdraw_account_number,
to_account AS deposit_account_number,
'6' AS transaction_type,
'' AS withdraw_amount,
'' AS withdraw_fee,
0 AS type,
transfer_amount AS deposit_amount,
to_fee AS deposit_fee,
msecond
FROM
t_transfer
WHERE
to_account = '__ELEMENT01__'
UNION ALL
SELECT
to_account AS user_account,
currency,
transaction_number,
transaction_time,
process_time,
transaction_time_string,
process_time_string,
withdraw_account_number,
deposit_account_number,
'8' AS transaction_type,
'' AS withdraw_amount,
'' AS withdraw_fee,
0 AS type,
deposit_amount,
deposit_fee,
msecond
FROM
v_request_unified_for_balance
WHERE
to_account = '__ELEMENT01__'
UNION ALL
SELECT
from_account as user_account,
debit_currency AS currency,
transaction_number,
transaction_time,
process_time,
transaction_time_string,
process_time_string,
withdraw_account_number,
deposit_account_number,
'7' AS transaction_type,
withdraw_amount,
withdraw_fee,
0 AS type,
'' AS deposit_amount,
'' AS deposit_fee,
msecond
FROM
v_request_unified_for_balance
WHERE
from_account = '__ELEMENT01__'
UNION ALL
SELECT
user_account,
debit_currency AS currency,
transaction_number,
transaction_time,
process_time,
transaction_time_string,
process_time_string,
withdraw_account_number,
deposit_account_number,
transaction_type,
withdraw_amount,
withdraw_fee,
type AS type,
deposit_amount,
deposit_fee,
msecond
FROM
v_withdrawal_unified_for_balance
WHERE
user_account = '__ELEMENT01__'
) AS trans
LEFT OUTER JOIN v_users_all AS withdraw_user ON (trans.withdraw_account_number = withdraw_user.user_account)
LEFT OUTER JOIN v_users_all AS deposit_user ON (trans.deposit_account_number = deposit_user.user_account)
WHERE 1
__ELEMENT03__
GROUP BY currency
ORDER BY currency DESC
</LIST_USER_TRANSACTION_ADMIN_COUNT_REVISED>
<LIST_USER_TRANSACTION_ADMIN>
SELECT
trans.transaction_time AS transaction_time
, trans.transaction_time_string AS transaction_time_string
, trans.process_time_string AS process_time_string
, trans.transaction_number AS transaction_number
, trans.message AS message
, trans.method AS method
, (CASE WHEN transaction_type in ('1','3','6','8','9','10') THEN deposit_currency ELSE withdraw_currency END) AS currency
, (CASE WHEN ('__ELEMENT02__'='JPY' or '__ELEMENT02__'='PHP' or '__ELEMENT02__'='IDR' or '__ELEMENT02__'='MYR' or '__ELEMENT02__'='THB' or '__ELEMENT02__'='VND') THEN trans.deposit_amount ELSE (trans.deposit_amount / 100) END) AS deposit_amount
, (CASE WHEN ('__ELEMENT02__'='JPY' or '__ELEMENT02__'='PHP' or '__ELEMENT02__'='IDR' or '__ELEMENT02__'='MYR' or '__ELEMENT02__'='THB' or '__ELEMENT02__'='VND') THEN trans.withdraw_amount ELSE (trans.withdraw_amount / 100) END) AS withdraw_amount
, (CASE WHEN transaction_type in ('1','3','6','8','9','10') THEN (CASE WHEN ('__ELEMENT02__'='JPY' or '__ELEMENT02__'='PHP' or '__ELEMENT02__'='IDR' or '__ELEMENT02__'='MYR' or '__ELEMENT02__'='THB' or '__ELEMENT02__'='VND') THEN trans.deposit_fee ELSE (trans.deposit_fee / 100) END) ELSE (CASE WHEN ('__ELEMENT02__'='JPY' or '__ELEMENT02__'='PHP' or '__ELEMENT02__'='IDR' or '__ELEMENT02__'='MYR' or '__ELEMENT02__'='THB' or '__ELEMENT02__'='VND') THEN trans.withdraw_fee ELSE (trans.withdraw_fee / 100) END) END) AS fee
, (CASE WHEN transaction_type in ('1','3','6','8','9','10') THEN withdraw_account_number ELSE deposit_account_number END) AS account_number
, (CASE WHEN transaction_type in ('1','3','6','8','9','10') THEN CONCAT(IFNULL(withdraw_user.first_name, ''), ' ', IFNULL(withdraw_user.last_name, '')) ELSE CONCAT(IFNULL(deposit_user.first_name, ''), ' ', IFNULL(deposit_user.last_name, '')) END) AS account_name
, trans.transaction_type AS transaction_type
, trans.type AS type
, trans.status AS status
, trans.process_status AS process_status
, (SELECT
(CASE WHEN ('__ELEMENT02__'='JPY' or '__ELEMENT02__'='PHP' or '__ELEMENT02__'='IDR' or '__ELEMENT02__'='MYR' or '__ELEMENT02__'='THB' or '__ELEMENT02__'='VND') THEN (sum(IFNULL(deposit_amount, 0))-sum(IFNULL(withdraw_amount, 0))-sum(IFNULL(fee, 0))) ELSE ((sum(IFNULL(deposit_amount, 0))-sum(IFNULL(withdraw_amount, 0))-sum(IFNULL(fee, 0))) / 100) END)
FROM
(SELECT
trans_in.transaction_time AS transaction_time
, trans_in.msecond AS msecond
, trans_in.deposit_amount AS deposit_amount
, trans_in.withdraw_amount AS withdraw_amount
, trans_in.process_status AS process_status
, (CASE WHEN transaction_type in ('1','3','6','8','9','10') THEN deposit_fee ELSE withdraw_fee END) AS fee
FROM (
SELECT /* 通常入金 */
create_time AS transaction_time
, deposit_date AS process_time
, DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string
, DATE_FORMAT(deposit_date, '%Y/%m/%d') AS process_time_string
, transaction_number AS transaction_number
, '1' AS transaction_type
, '' AS withdraw_account_number
, user_account AS deposit_account_number
, '' AS withdraw_amount
, '' AS withdraw_fee
, amount AS deposit_amount
, fee AS deposit_fee
, '' AS rate
, currency AS deposit_currency
, '' AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_amount
, 0 AS type
, 0 AS status
, message AS message
, method AS method
, msecond AS msecond
, 0 AS process_status
FROM
t_deposit
WHERE
user_account = '__ELEMENT01__'
AND CONVERT_TZ(NOW(),@@session.time_zone,'+09:00') > deposit_date
AND currency = '__ELEMENT02__'
UNION ALL
SELECT /* 通常出金 */
create_time AS transaction_time
, process_time AS process_time
, DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string
, DATE_FORMAT(process_time, '%Y/%m/%d') AS process_time_string
, transaction_number AS transaction_number
, '2' AS transaction_type
, '' AS withdraw_account_number
, '' AS deposit_account_number
, debit_amount AS withdraw_amount
, fee AS withdraw_fee
, '' AS deposit_amount
, '' AS deposit_fee
, '' AS deposit_fee
, '' AS rate
, '' AS rate
, '' AS deposit_currency
, '' AS deposit_currency
, debit_currency AS withdraw_currency
, debit_currency AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, TYPE AS TYPE
, type AS type
, STATUS AS STATUS
, status AS status
, receipt_message AS message
, receipt_message AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -4864,12 +4966,42 @@ WHERE
...
@@ -4864,12 +4966,42 @@ WHERE
t_withdraw
t_withdraw
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND STATUS<= '3'
AND status<= '3'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
AND (TYPE = '0'
AND (type = '0'
OR TYPE = '3'
OR type = '3'
OR TYPE = '1')
OR type = '1')
UNION
UNION ALL
SELECT /* 両替(入金) */
create_time AS transaction_time
, create_time AS process_time
, DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string
, DATE_FORMAT(create_time, '%Y/%m/%d') AS process_time_string
, transaction_number AS transaction_number
, '3' AS transaction_type
, '' AS withdraw_account_number
, user_account AS deposit_account_number
, 0 AS withdraw_amount
, '' AS withdraw_fee
, amount AS deposit_amount
, 0 AS deposit_fee
, '' AS rate
, currency AS deposit_currency
, '' AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_amount
, 0 AS type
, 0 AS status
, '' AS message
, '' AS method
, msecond AS msecond
, 0 AS process_status
FROM
t_exchange
WHERE
user_account = '__ELEMENT01__'
AND currency = '__ELEMENT02__'
UNION ALL
SELECT /* 両替(出金) */
SELECT /* 両替(出金) */
create_time AS transaction_time
create_time AS transaction_time
, create_time AS process_time
, create_time AS process_time
...
@@ -4888,8 +5020,8 @@ WHERE
...
@@ -4888,8 +5020,8 @@ WHERE
, debit_currency AS withdraw_currency
, debit_currency AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS TYPE
, 0 AS type
, 0 AS STATUS
, 0 AS status
, '' AS message
, '' AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -4899,7 +5031,7 @@ WHERE
...
@@ -4899,7 +5031,7 @@ WHERE
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
UNION
UNION ALL
SELECT /* 口座振替(出金) */
SELECT /* 口座振替(出金) */
create_time AS transaction_time
create_time AS transaction_time
, create_time AS process_time
, create_time AS process_time
...
@@ -4918,8 +5050,8 @@ WHERE
...
@@ -4918,8 +5050,8 @@ WHERE
, debit_currency AS withdraw_currency
, debit_currency AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS TYPE
, 0 AS type
, 0 AS STATUS
, 0 AS status
, message AS message
, message AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -4929,7 +5061,7 @@ WHERE
...
@@ -4929,7 +5061,7 @@ WHERE
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
UNION
UNION ALL
SELECT /* 口座振替(入金) */
SELECT /* 口座振替(入金) */
create_time AS transaction_time
create_time AS transaction_time
, create_time AS process_time
, create_time AS process_time
...
@@ -4948,8 +5080,8 @@ WHERE
...
@@ -4948,8 +5080,8 @@ WHERE
, '' AS withdraw_currency
, '' AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS TYPE
, 0 AS type
, 0 AS STATUS
, 0 AS status
, message AS message
, message AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -4959,7 +5091,7 @@ WHERE
...
@@ -4959,7 +5091,7 @@ WHERE
WHERE
WHERE
to_account = '__ELEMENT01__'
to_account = '__ELEMENT01__'
AND transfer_currency = '__ELEMENT02__'
AND transfer_currency = '__ELEMENT02__'
UNION
UNION ALL
SELECT /* 引き落し(出金) */
SELECT /* 引き落し(出金) */
update_time AS transaction_time
update_time AS transaction_time
, update_time AS process_time
, update_time AS process_time
...
@@ -4978,8 +5110,8 @@ WHERE
...
@@ -4978,8 +5110,8 @@ WHERE
, debit_currency AS withdraw_currency
, debit_currency AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS TYPE
, 0 AS type
, 0 AS STATUS
, 0 AS status
, message AS message
, message AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -4989,8 +5121,8 @@ WHERE
...
@@ -4989,8 +5121,8 @@ WHERE
WHERE
WHERE
from_account = '__ELEMENT01__'
from_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
AND STATUS = 1
AND status = 1
UNION
UNION ALL
SELECT /* 引き落し(入金) */
SELECT /* 引き落し(入金) */
update_time AS transaction_time
update_time AS transaction_time
, update_time AS process_time
, update_time AS process_time
...
@@ -5009,8 +5141,8 @@ WHERE
...
@@ -5009,8 +5141,8 @@ WHERE
, '' AS withdraw_currency
, '' AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS TYPE
, 0 AS type
, 0 AS STATUS
, 0 AS status
, message AS message
, message AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5020,8 +5152,8 @@ WHERE
...
@@ -5020,8 +5152,8 @@ WHERE
WHERE
WHERE
to_account = '__ELEMENT01__'
to_account = '__ELEMENT01__'
AND currency = '__ELEMENT02__'
AND currency = '__ELEMENT02__'
AND STATUS = 1
AND status = 1
UNION
UNION ALL
SELECT /* 出金(組戻し) */
SELECT /* 出金(組戻し) */
create_time AS transaction_time
create_time AS transaction_time
, process_time AS process_time
, process_time AS process_time
...
@@ -5040,8 +5172,8 @@ WHERE
...
@@ -5040,8 +5172,8 @@ WHERE
, '' AS withdraw_currency
, '' AS withdraw_currency
, 0 AS debit_currency
, 0 AS debit_currency
, 0 AS debit_amount
, 0 AS debit_amount
, 0 AS TYPE
, 0 AS type
, STATUS AS STATUS
, status AS status
, '' AS message
, '' AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5049,10 +5181,10 @@ WHERE
...
@@ -5049,10 +5181,10 @@ WHERE
FROM
FROM
t_withdraw
t_withdraw
WHERE
WHERE
STATUS = '4'
status = '4'
AND user_account = '__ELEMENT01__'
AND user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
UNION
UNION ALL
SELECT /* 出金(キャンセル) */
SELECT /* 出金(キャンセル) */
create_time AS transaction_time
create_time AS transaction_time
, process_time AS process_time
, process_time AS process_time
...
@@ -5071,278 +5203,59 @@ WHERE
...
@@ -5071,278 +5203,59 @@ WHERE
, '' AS withdraw_currency
, '' AS withdraw_currency
, 0 AS debit_currency
, 0 AS debit_currency
, 0 AS debit_amount
, 0 AS debit_amount
, 0 AS TYPE
, 0 AS type
, STATUS AS STATUS
, status AS status
, '' AS message
, '' AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
, 0 AS process_status
, 0 AS process_status
FROM
FROM
t_withdraw
t_withdraw
WHERE
WHERE
STATUS = '6'
status = '6'
AND user_account = '__ELEMENT01__'
AND user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
UNION
UNION ALL
SELECT /* 账户休止金 */
SELECT /* 账户休止金 */
create_time AS transaction_time
create_time AS transaction_time
, process_time AS process_time
, process_time AS process_time
, DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string
, DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string
, DATE_FORMAT(process_time, '%Y/%m/%d') AS process_time_string
, DATE_FORMAT(process_time, '%Y/%m/%d') AS process_time_string
, transaction_number AS transaction_number
, transaction_number AS transaction_number
, '11' AS transaction_type
, '11' AS transaction_type
, '' AS withdraw_account_number
, '' AS withdraw_account_number
, '' AS deposit_account_number
, user_account AS deposit_account_number
, debit_amount AS withdraw_amount
, debit_amount AS withdraw_amount
, fee AS withdraw_fee
, fee AS withdraw_fee
, debit_amount AS deposit_amount
, debit_amount AS deposit_amount
, '' AS deposit_fee
, '' AS deposit_fee
, '' AS rate
, '' AS rate
, '' AS deposit_currency
, '' AS deposit_currency
, debit_currency AS withdraw_currency
, debit_currency AS withdraw_currency
, 0 AS debit_currency
, 0 AS debit_currency
, 0 AS debit_amount
, 0 AS debit_amount
, 0 AS TYPE
, 0 AS type
, STATUS AS STATUS
, status AS status
, moneyout_solution AS message
, '' AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
, 0 AS process_status
, 0 AS process_status
FROM
FROM
t_withdraw
t_withdraw
WHERE
WHERE
STATUS = '2'
status = '2'
AND user_account = '__ELEMENT01__'
AND user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
AND TYPE = '11'
AND type = '11'
) AS trans
) AS trans_in
LEFT OUTER JOIN v_users_all AS withdraw_user
LEFT OUTER JOIN
ON (trans.withdraw_account_number = withdraw_user.user_account)
unix_timestamp(t2.transaction_time) < unix_timestamp(trans.transaction_time) OR (unix_timestamp(t2.transaction_time) = unix_timestamp(trans.transaction_time) AND t2.msecond <= trans.msecond)) AS balance
<LIST_USER_TRANSACTION_ADMIN_COUNT_REVISED>
SELECT
count(trans.currency) total,
trans.currency as currency
FROM
(
SELECT
user_account,
currency,
transaction_number,
create_time AS transaction_time,
deposit_date AS process_time,
DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string,
DATE_FORMAT(deposit_date, '%Y/%m/%d') AS process_time_string,
'' AS withdraw_account_number,
user_account AS deposit_account_number,
'1' AS transaction_type,
'' AS withdraw_amount,
'' AS withdraw_fee,
0 AS type,
amount AS deposit_amount,
fee AS deposit_fee,
msecond
FROM
t_deposit
WHERE NOW() + INTERVAL 16 HOUR > deposit_date AND user_account = '__ELEMENT01__'
UNION ALL
SELECT
user_account,
currency,
transaction_number,
create_time AS transaction_time,
create_time AS process_time,
DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string,
DATE_FORMAT(create_time, '%Y/%m/%d') AS process_time_string,
user_account AS withdraw_account_number,
0 AS deposit_account_number,
'3' AS transaction_type,
0 AS withdraw_amount,
'' AS withdraw_fee,
0 AS type,
amount AS deposit_amount,
0 AS deposit_fee,
msecond
FROM
t_exchange
WHERE
user_account = '__ELEMENT01__'
UNION ALL
SELECT
user_account,
debit_currency AS currency,
transaction_number,
create_time AS transaction_time,
create_time AS process_time,
DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string,
DATE_FORMAT(create_time, '%Y/%m/%d') AS process_time_string,
user_account AS withdraw_account_number,
0 AS deposit_account_number,
'4' AS transaction_type,
debit_amount AS withdraw_amount,
0 AS withdraw_fee,
0 AS type,
0 AS deposit_amount,
'' AS deposit_fee,
msecond
FROM
t_exchange
WHERE
user_account = '__ELEMENT01__'
UNION ALL
SELECT
user_account,
debit_currency AS currency,
transaction_number,
create_time AS transaction_time,
create_time AS process_time,
DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string,
DATE_FORMAT(create_time, '%Y/%m/%d') AS process_time_string,
from_account AS withdraw_account_number,
to_account AS deposit_account_number,
'5' AS transaction_type,
debit_amount AS withdraw_amount,
from_fee AS withdraw_fee,
0 AS type,
'' AS deposit_amount,
'' AS deposit_fee,
msecond
FROM
t_transfer
WHERE
user_account = '__ELEMENT01__'
UNION ALL
SELECT
to_account AS user_account,
transfer_currency AS currency,
transaction_number,
create_time AS transaction_time,
create_time AS process_time,
DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string,
DATE_FORMAT(create_time, '%Y/%m/%d') AS process_time_string,
from_account AS withdraw_account_number,
to_account AS deposit_account_number,
'6' AS transaction_type,
'' AS withdraw_amount,
'' AS withdraw_fee,
0 AS type,
transfer_amount AS deposit_amount,
to_fee AS deposit_fee,
msecond
FROM
t_transfer
WHERE
to_account = '__ELEMENT01__'
UNION ALL
SELECT
to_account AS user_account,
currency,
transaction_number,
transaction_time,
process_time,
transaction_time_string,
process_time_string,
withdraw_account_number,
deposit_account_number,
'8' AS transaction_type,
'' AS withdraw_amount,
'' AS withdraw_fee,
0 AS type,
deposit_amount,
deposit_fee,
msecond
FROM
v_request_unified_for_balance
WHERE
to_account = '__ELEMENT01__'
UNION ALL
SELECT
from_account as user_account,
debit_currency AS currency,
transaction_number,
transaction_time,
process_time,
transaction_time_string,
process_time_string,
withdraw_account_number,
deposit_account_number,
'7' AS transaction_type,
withdraw_amount,
withdraw_fee,
0 AS type,
'' AS deposit_amount,
'' AS deposit_fee,
msecond
FROM
v_request_unified_for_balance
WHERE
from_account = '__ELEMENT01__'
UNION ALL
SELECT
user_account,
debit_currency AS currency,
transaction_number,
transaction_time,
process_time,
transaction_time_string,
process_time_string,
withdraw_account_number,
deposit_account_number,
transaction_type,
withdraw_amount,
withdraw_fee,
type AS type,
deposit_amount,
deposit_fee,
msecond
FROM
v_withdrawal_unified_for_balance
WHERE
user_account = '__ELEMENT01__'
) AS trans
LEFT OUTER JOIN v_users_all AS withdraw_user ON (trans.withdraw_account_number = withdraw_user.user_account)
LEFT OUTER JOIN v_users_all AS deposit_user ON (trans.deposit_account_number = deposit_user.user_account)
WHERE 1
__ELEMENT03__
GROUP BY currency
ORDER BY currency DESC
</LIST_USER_TRANSACTION_ADMIN_COUNT_REVISED>
<LIST_USER_TRANSACTION_ADMIN>
SELECT
trans.transaction_time AS transaction_time
, trans.transaction_time_string AS transaction_time_string
, trans.process_time_string AS process_time_string
, trans.transaction_number AS transaction_number
, trans.message AS message
, trans.method AS method
, (CASE WHEN transaction_type in ('1','3','6','8','9','10') THEN deposit_currency ELSE withdraw_currency END) AS currency
, (CASE WHEN ('__ELEMENT02__'='JPY' or '__ELEMENT02__'='PHP' or '__ELEMENT02__'='IDR' or '__ELEMENT02__'='MYR' or '__ELEMENT02__'='THB' or '__ELEMENT02__'='VND') THEN trans.deposit_amount ELSE (trans.deposit_amount / 100) END) AS deposit_amount
, (CASE WHEN ('__ELEMENT02__'='JPY' or '__ELEMENT02__'='PHP' or '__ELEMENT02__'='IDR' or '__ELEMENT02__'='MYR' or '__ELEMENT02__'='THB' or '__ELEMENT02__'='VND') THEN trans.withdraw_amount ELSE (trans.withdraw_amount / 100) END) AS withdraw_amount
, (CASE WHEN transaction_type in ('1','3','6','8','9','10') THEN (CASE WHEN ('__ELEMENT02__'='JPY' or '__ELEMENT02__'='PHP' or '__ELEMENT02__'='IDR' or '__ELEMENT02__'='MYR' or '__ELEMENT02__'='THB' or '__ELEMENT02__'='VND') THEN trans.deposit_fee ELSE (trans.deposit_fee / 100) END) ELSE (CASE WHEN ('__ELEMENT02__'='JPY' or '__ELEMENT02__'='PHP' or '__ELEMENT02__'='IDR' or '__ELEMENT02__'='MYR' or '__ELEMENT02__'='THB' or '__ELEMENT02__'='VND') THEN trans.withdraw_fee ELSE (trans.withdraw_fee / 100) END) END) AS fee
, (CASE WHEN transaction_type in ('1','3','6','8','9','10') THEN withdraw_account_number ELSE deposit_account_number END) AS account_number
, (CASE WHEN transaction_type in ('1','3','6','8','9','10') THEN CONCAT(IFNULL(withdraw_user.first_name, ''), ' ', IFNULL(withdraw_user.last_name, '')) ELSE CONCAT(IFNULL(deposit_user.first_name, ''), ' ', IFNULL(deposit_user.last_name, '')) END) AS account_name
, trans.transaction_type AS transaction_type
, trans.type AS type
, trans.status AS status
, trans.process_status AS process_status
, (SELECT
(CASE WHEN ('__ELEMENT02__'='JPY' or '__ELEMENT02__'='PHP' or '__ELEMENT02__'='IDR' or '__ELEMENT02__'='MYR' or '__ELEMENT02__'='THB' or '__ELEMENT02__'='VND') THEN (sum(IFNULL(deposit_amount, 0))-sum(IFNULL(withdraw_amount, 0))-sum(IFNULL(fee, 0))) ELSE ((sum(IFNULL(deposit_amount, 0))-sum(IFNULL(withdraw_amount, 0))-sum(IFNULL(fee, 0))) / 100) END)
FROM
(SELECT
trans_in.transaction_time AS transaction_time
, trans_in.msecond AS msecond
, trans_in.deposit_amount AS deposit_amount
, trans_in.withdraw_amount AS withdraw_amount
, trans_in.process_status AS process_status
, (CASE WHEN transaction_type in ('1','3','6','8','9','10') THEN deposit_fee ELSE withdraw_fee END) AS fee
FROM (
FROM (
SELECT /* 通常入金 */
SELECT /* 通常入金 */
create_time AS transaction_time
create_time AS transaction_time
...
@@ -5372,7 +5285,7 @@ FROM
...
@@ -5372,7 +5285,7 @@ FROM
t_deposit
t_deposit
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND NOW() + INTERVAL 16 HOUR > deposit_date
AND CONVERT_TZ(NOW(),@@session.time_zone,'+09:00') > deposit_date
unix_timestamp(t2.transaction_time) < unix_timestamp(trans.transaction_time) OR (unix_timestamp(t2.transaction_time) = unix_timestamp(trans.transaction_time) AND t2.msecond <= trans.msecond)) AS balance
1
FROM (
__ELEMENT03__
ORDER BY
transaction_time DESC, msecond DESC
__ELEMENT04__
</LIST_USER_TRANSACTION_ADMIN>
<SELECT_USER_TRANSACTION_ADMIN_COUNT>
SELECT COUNT(*) as overall_total FROM (
SELECT /* 通常入金 */
SELECT /* 通常入金 */
create_time AS transaction_time
create_time AS transaction_time
, deposit_date AS process_time
, deposit_date AS process_time
...
@@ -5712,8 +5632,8 @@ WHERE
...
@@ -5712,8 +5632,8 @@ WHERE
, '' AS withdraw_currency
, '' AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS type
, 0 AS TYPE
, 0 AS status
, 0 AS STATUS
, message AS message
, message AS message
, method AS method
, method AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5722,43 +5642,9 @@ WHERE
...
@@ -5722,43 +5642,9 @@ WHERE
t_deposit
t_deposit
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND NOW() + INTERVAL 16 HOUR > deposit_date
AND CONVERT_TZ(NOW(),@@session.time_zone,'+09:00') > deposit_date
AND currency = '__ELEMENT02__'
AND currency = '__ELEMENT02__'
UNION ALL
UNION
SELECT /* 通常出金 */
create_time AS transaction_time
, process_time AS process_time
, DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string
, DATE_FORMAT(process_time, '%Y/%m/%d') AS process_time_string
, transaction_number AS transaction_number
, '2' AS transaction_type
, '' AS withdraw_account_number
, '' AS deposit_account_number
, debit_amount AS withdraw_amount
, fee AS withdraw_fee
, '' AS deposit_amount
, '' AS deposit_fee
, '' AS rate
, '' AS deposit_currency
, debit_currency AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_amount
, type AS type
, status AS status
, receipt_message AS message
, '' AS method
, msecond AS msecond
, 0 AS process_status
FROM
t_withdraw
WHERE
user_account = '__ELEMENT01__'
AND status <= '3'
AND debit_currency = '__ELEMENT02__'
AND (type = '0'
OR type = '3'
OR type = '1')
UNION ALL
SELECT /* 両替(入金) */
SELECT /* 両替(入金) */
create_time AS transaction_time
create_time AS transaction_time
, create_time AS process_time
, create_time AS process_time
...
@@ -5777,8 +5663,8 @@ WHERE
...
@@ -5777,8 +5663,8 @@ WHERE
, '' AS withdraw_currency
, '' AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS type
, 0 AS TYPE
, 0 AS status
, 0 AS STATUS
, '' AS message
, '' AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5788,7 +5674,41 @@ WHERE
...
@@ -5788,7 +5674,41 @@ WHERE
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND currency = '__ELEMENT02__'
AND currency = '__ELEMENT02__'
UNION ALL
UNION
SELECT /* 通常出金 */
create_time AS transaction_time
, process_time AS process_time
, DATE_FORMAT(create_time, '%Y/%m/%d') AS transaction_time_string
, DATE_FORMAT(process_time, '%Y/%m/%d') AS process_time_string
, transaction_number AS transaction_number
, '2' AS transaction_type
, '' AS withdraw_account_number
, '' AS deposit_account_number
, debit_amount AS withdraw_amount
, fee AS withdraw_fee
, '' AS deposit_amount
, '' AS deposit_fee
, '' AS rate
, '' AS deposit_currency
, debit_currency AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_amount
, TYPE AS TYPE
, STATUS AS STATUS
, receipt_message AS message
, '' AS method
, msecond AS msecond
, 0 AS process_status
FROM
t_withdraw
WHERE
user_account = '__ELEMENT01__'
AND STATUS <= '3'
AND debit_currency = '__ELEMENT02__'
AND (TYPE = '0'
OR TYPE = '3'
OR TYPE = '1')
UNION
SELECT /* 両替(出金) */
SELECT /* 両替(出金) */
create_time AS transaction_time
create_time AS transaction_time
, create_time AS process_time
, create_time AS process_time
...
@@ -5807,8 +5727,8 @@ WHERE
...
@@ -5807,8 +5727,8 @@ WHERE
, debit_currency AS withdraw_currency
, debit_currency AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS type
, 0 AS TYPE
, 0 AS status
, 0 AS STATUS
, '' AS message
, '' AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5818,7 +5738,7 @@ WHERE
...
@@ -5818,7 +5738,7 @@ WHERE
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
UNION ALL
UNION
SELECT /* 口座振替(出金) */
SELECT /* 口座振替(出金) */
create_time AS transaction_time
create_time AS transaction_time
, create_time AS process_time
, create_time AS process_time
...
@@ -5837,8 +5757,8 @@ WHERE
...
@@ -5837,8 +5757,8 @@ WHERE
, debit_currency AS withdraw_currency
, debit_currency AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS type
, 0 AS TYPE
, 0 AS status
, 0 AS STATUS
, message AS message
, message AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5848,7 +5768,7 @@ WHERE
...
@@ -5848,7 +5768,7 @@ WHERE
WHERE
WHERE
user_account = '__ELEMENT01__'
user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
UNION ALL
UNION
SELECT /* 口座振替(入金) */
SELECT /* 口座振替(入金) */
create_time AS transaction_time
create_time AS transaction_time
, create_time AS process_time
, create_time AS process_time
...
@@ -5867,8 +5787,8 @@ WHERE
...
@@ -5867,8 +5787,8 @@ WHERE
, '' AS withdraw_currency
, '' AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS type
, 0 AS TYPE
, 0 AS status
, 0 AS STATUS
, message AS message
, message AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5878,7 +5798,7 @@ WHERE
...
@@ -5878,7 +5798,7 @@ WHERE
WHERE
WHERE
to_account = '__ELEMENT01__'
to_account = '__ELEMENT01__'
AND transfer_currency = '__ELEMENT02__'
AND transfer_currency = '__ELEMENT02__'
UNION ALL
UNION
SELECT /* 引き落し(出金) */
SELECT /* 引き落し(出金) */
update_time AS transaction_time
update_time AS transaction_time
, update_time AS process_time
, update_time AS process_time
...
@@ -5897,8 +5817,8 @@ WHERE
...
@@ -5897,8 +5817,8 @@ WHERE
, debit_currency AS withdraw_currency
, debit_currency AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS type
, 0 AS TYPE
, 0 AS status
, 0 AS STATUS
, message AS message
, message AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5908,8 +5828,8 @@ WHERE
...
@@ -5908,8 +5828,8 @@ WHERE
WHERE
WHERE
from_account = '__ELEMENT01__'
from_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
AND status = 1
AND STATUS = 1
UNION ALL
UNION
SELECT /* 引き落し(入金) */
SELECT /* 引き落し(入金) */
update_time AS transaction_time
update_time AS transaction_time
, update_time AS process_time
, update_time AS process_time
...
@@ -5928,8 +5848,8 @@ WHERE
...
@@ -5928,8 +5848,8 @@ WHERE
, '' AS withdraw_currency
, '' AS withdraw_currency
, '' AS transfer_currency
, '' AS transfer_currency
, '' AS transfer_amount
, '' AS transfer_amount
, 0 AS type
, 0 AS TYPE
, 0 AS status
, 0 AS STATUS
, message AS message
, message AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5939,8 +5859,8 @@ WHERE
...
@@ -5939,8 +5859,8 @@ WHERE
WHERE
WHERE
to_account = '__ELEMENT01__'
to_account = '__ELEMENT01__'
AND currency = '__ELEMENT02__'
AND currency = '__ELEMENT02__'
AND status = 1
AND STATUS = 1
UNION ALL
UNION
SELECT /* 出金(組戻し) */
SELECT /* 出金(組戻し) */
create_time AS transaction_time
create_time AS transaction_time
, process_time AS process_time
, process_time AS process_time
...
@@ -5959,8 +5879,8 @@ WHERE
...
@@ -5959,8 +5879,8 @@ WHERE
, '' AS withdraw_currency
, '' AS withdraw_currency
, 0 AS debit_currency
, 0 AS debit_currency
, 0 AS debit_amount
, 0 AS debit_amount
, 0 AS type
, 0 AS TYPE
, status AS status
, STATUS AS STATUS
, '' AS message
, '' AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5968,10 +5888,10 @@ WHERE
...
@@ -5968,10 +5888,10 @@ WHERE
FROM
FROM
t_withdraw
t_withdraw
WHERE
WHERE
status = '4'
STATUS = '4'
AND user_account = '__ELEMENT01__'
AND user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
UNION ALL
UNION
SELECT /* 出金(キャンセル) */
SELECT /* 出金(キャンセル) */
create_time AS transaction_time
create_time AS transaction_time
, process_time AS process_time
, process_time AS process_time
...
@@ -5990,8 +5910,8 @@ WHERE
...
@@ -5990,8 +5910,8 @@ WHERE
, '' AS withdraw_currency
, '' AS withdraw_currency
, 0 AS debit_currency
, 0 AS debit_currency
, 0 AS debit_amount
, 0 AS debit_amount
, 0 AS type
, 0 AS TYPE
, status AS status
, STATUS AS STATUS
, '' AS message
, '' AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -5999,10 +5919,10 @@ WHERE
...
@@ -5999,10 +5919,10 @@ WHERE
FROM
FROM
t_withdraw
t_withdraw
WHERE
WHERE
status = '6'
STATUS = '6'
AND user_account = '__ELEMENT01__'
AND user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
UNION ALL
UNION
SELECT /* 账户休止金 */
SELECT /* 账户休止金 */
create_time AS transaction_time
create_time AS transaction_time
, process_time AS process_time
, process_time AS process_time
...
@@ -6021,8 +5941,8 @@ WHERE
...
@@ -6021,8 +5941,8 @@ WHERE
, debit_currency AS withdraw_currency
, debit_currency AS withdraw_currency
, 0 AS debit_currency
, 0 AS debit_currency
, 0 AS debit_amount
, 0 AS debit_amount
, 0 AS type
, 0 AS TYPE
, status AS status
, STATUS AS STATUS
, moneyout_solution AS message
, moneyout_solution AS message
, '' AS method
, '' AS method
, msecond AS msecond
, msecond AS msecond
...
@@ -6030,24 +5950,18 @@ WHERE
...
@@ -6030,24 +5950,18 @@ WHERE
FROM
FROM
t_withdraw
t_withdraw
WHERE
WHERE
status = '2'
STATUS = '2'
AND user_account = '__ELEMENT01__'
AND user_account = '__ELEMENT01__'
AND debit_currency = '__ELEMENT02__'
AND debit_currency = '__ELEMENT02__'
AND type = '11'
AND TYPE = '11'
) AS trans
) AS trans
LEFT OUTER JOIN
LEFT OUTER JOIN v_users_all AS withdraw_user
v_users_all AS withdraw_user
ON (trans.withdraw_account_number = withdraw_user.user_account)