• sql


    select  a.id  as id,
    SUBSTR(a.oc_date,1,4)||'-'||SUBSTR(a.oc_date,5,2)||'-'||SUBSTR(a.oc_date,7,2) as oc_date,
    a.client_id,
    nvl(ac.client_name, a.client_id) as client_name,
    a.stock_code,
    nvl(c.stock_name, a.stock_code) as stock_name,
    nvl(a.occ_value1, 0) as priceratio,
    nvl(a.occ_value3, 0) as ratio1,
    nvl(a.occ_value1, 0) as count,
    cast(nvl(a.occ_value2, 0) / 10000 as number(22,2)) as reverse_amount,
    cast(nvl(a.occ_value1, 0) / 10000 as number(22,2)) as entrust_balance,
    cast(nvl(a.occ_value4, 0) / 10000 as number(22,2)) as business_amount,
    cast(nvl(a.occ_value4, 0) / 10000 as number(22,2)) as entrust_amount,
    nvl(a.occ_value1, 0) as occ_count,
    nvl(a.occ_value2, 0) as withdraw_ratio,
    nvl(a.occ_value3, 0) as withdraw_count,
    decode(a.entrust_bs, '1', '买入', '2', '卖出', ' ') as entrust_bs, -- 委托
    decode(a.entrust_bs, '2', '买入', '1', '卖出', ' ') as rev_entrust_bs, -- 反向委托
    (case when a.entrust_bs = '1' then '涨' else '跌' end) as updown,
    nvl(a.occ_value1, 0) as ratio,
    nvl(a.occ_value4, 0) as reverse_count,
    a.risk_id,a.branch_no,
    i.risk_name as risk_name,ub.branch_name,ar.description,
    (SELECT cast(init_date as char(8)) as init_date FROM hscon.sys_ics_arg) as DTDATE
    from hsics.spb_risk_push_oa rpo
    left join hsics.r_ics_monitor_result a on rpo.risk_id=a.risk_id
    left join hscon.rmm_risk_item i on a.risk_id = i.risk_id
    left join hscon.uam_branch ub on ub.branch_no=a.branch_no
    left join hsods.act_client ac on ac.CLIENT_ID=a.CLIENT_ID
    left join hscon.atmp_riskinfo_template ar on ar.risk_id=a.risk_id
    left join hsods.iqs_stockcode c on a.exchange_type = c.exchange_type and a.stock_code = c.stock_code
    where a.risk_level in (${riskLevel}) and a.risk_deal_flag ='0' and rpo.status='1' and rpo.company_no=(SELECT company_no FROM hscon.uam_company)
  • 相关阅读:
    成功交付离岸项目
    利用CSP探测网站登陆状态
    Web NFC API
    HTML/W3C-WHATWG-Differences
    MIT教授将网页开发整合为完整独立的程式语言Ur/Web
    移动端前端开发调试
    从0到100——知乎架构变迁史
    C++之再续前缘(一)——C++基础(与C语言的差异)(上)
    又爱又恨系列之枚举enum
    数据结构之队列(三)——循环队列
  • 原文地址:https://www.cnblogs.com/yyy1234/p/16106154.html
Copyright © 2020-2023  润新知