风控后台


指标sql预览

<p><strong>简要描述:</strong> </p> <ul> <li>统计和运营商指标配置完成的SQL预览</li> </ul> <p><strong>请求URL:</strong> </p> <ul> <li><code>http://xx.com/indicator/indicatorbasicconfig/sqlPreview?indicatorId=3227&amp;mainAttrValue=12&amp;format=1</code></li> </ul> <p><strong>请求方式:</strong></p> <ul> <li>GET </li> </ul> <p><strong>参数:</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">必选</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">indicatorId</td> <td style="text-align: left;">是</td> <td style="text-align: left;">number</td> <td>指标id</td> </tr> <tr> <td style="text-align: left;">mainAttrValue</td> <td style="text-align: left;">否</td> <td style="text-align: left;">string</td> <td>主属性(不填则返回sql模板)</td> </tr> <tr> <td style="text-align: left;">format</td> <td style="text-align: left;">否</td> <td style="text-align: left;">string</td> <td>是否格式化sql,1是,0否</td> </tr> </tbody> </table> <p><strong>返回示例</strong></p> <pre><code> { "msg": "success", "code": 0, "sql": "select current_number as main_attr, max(sr_order_no) as biz_id, sum(duration) as res_value\nfrom (\n\tselect *\n\tfrom (\n\t\tselect *\n\t\tfrom (\n\t\t\tselect *, avg(duration) over (partition by current_number, peer_number ) as f5171\n\t\t\tfrom (\n\t\t\t\tselect *\n\t\t\t\tfrom (\n\t\t\t\t\tselect *, row_number() over (partition by current_number, peer_number order by f5168_s desc) as f5168\n\t\t\t\t\tfrom (\n\t\t\t\t\t\tselect *, count(peer_number) over (partition by current_number, peer_number ) as f5168_s\n\t\t\t\t\t\tfrom (\n\t\t\t\t\t\t\tselect u.id_no, t.*\n\t\t\t\t\t\t\tfrom raw_risk.arc_user u\n\t\t\t\t\t\t\t\tinner join raw_risk.risk_call_record t on u.consumer_no = t.consumer_no\n\t\t\t\t\t\t\twhere t.sr_time &gt;= '2019-07-16 00:00:00'\n\t\t\t\t\t\t\t\tand t.call_time &gt;= '2019-04-18 00:00:00'\n\t\t\t\t\t\t\t\tand t.call_time &lt; '2019-07-17 00:00:00'\n\t\t\t\t\t\t\t\tand dayofweek(t.call_time) in (0, 1, 2, 3, 4)\n\t\t\t\t\t\t\t\tand (hour(t.call_time) &gt;= 8\n\t\t\t\t\t\t\t\t\tand hour(t.call_time) &lt; 20)\n\t\t\t\t\t\t) tmp\n\t\t\t\t\t) tmp\n\t\t\t\t) tmp\n\t\t\t\twhere 1 = 1\n\t\t\t\t\tand f5168 &lt;= 10\n\t\t\t) tmp\n\t\t) tmp\n\t\twhere 1 = 1\n\t\t\tand f5171 &gt;= 15\n\t) tmp\n\twhere 1 = 1\n\t\tand (call_type = 'DIAL'\n\t\t\tor (call_type = 'DIALED'\n\t\t\t\tand duration &gt; 5))\n) tmp\ngroup by current_number" }</code></pre> <p><strong>返回参数说明</strong> </p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">sql</td> <td style="text-align: left;">string</td> <td>格式化后会带上换行和缩进</td> </tr> </tbody> </table> <p><strong>备注</strong> </p>

页面列表

ITEM_HTML