LogMysqlApeT
with LogMysqlApeT(db) as m_client:
condition = "select * from {} where deleted=0 ".format(table)
condition_count = "select count(id) as numbers from {} where deleted=0 ".format(table)
get_data = json.loads(request.body)
industry = get_data.get("industry", '') # 行业
industry2 = get_data.get("industry2", '') # 行业
viewpoint = get_data.get("viewpoint", '') # 观点
viewpointtitle = get_data.get("viewpointtitle", '') # 观点标题
property = get_data.get("property", '') # 属性
contentname = get_data.get("contentname", '') # 母模板名称
parenttitleid = get_data.get("parenttitleid", '') # 观点标题id
pageStartNumber = get_data.get('page', 1)
pageNumber = get_data.get('pageSize', 100)
if industry:
condition += " and industry='{}' ".format(industry)
condition_count += " and industry='{}' ".format(industry)
if industry2:
condition += " and industry2='{}' ".format(industry2)
condition_count += " and industry2='{}' ".format(industry2)
if viewpoint:
condition += " and viewpoint='{}' ".format(viewpoint)
condition_count += " and viewpoint='{}' ".format(viewpoint)
if property:
condition += " and property='{}' ".format(property)
condition_count += " and property='{}' ".format(property)
if viewpointtitle:
condition += " and viewpointtitle = '{}' ".format(viewpointtitle)
condition_count += " and viewpointtitle = '{}' ".format(viewpointtitle)
if contentname:
condition += " and contentname like '%%{}%%' ".format(contentname)
condition_count += " and contentname like '%%{}%%' ".format(contentname)
if parenttitleid:
condition += " and parenttitleid ={} ".format(parenttitleid)
condition_count += " and parenttitleid ={} ".format(parenttitleid)
condition_limit = condition + " limit {},{} ".format((pageStartNumber - 1) * pageNumber, pageNumber)
total = m_client.search_db(condition_count)[0].get('numbers', 0)
logger.info('@@@ 观点标题详情:%s' % condition)
data = m_client.search_db(condition_limit)
LogMysqlApeT的更多相关文章
随机推荐
- Java JFR 民间指南 - 事件详解 - jdk.ObjectAllocationOutsideTLAB
重新申请 TLAB 分配对象事件:jdk.ObjectAllocationOutsideTLAB 引入版本:Java 11 相关 ISSUES: JFR: RecordingStream leaks ...
- 今日浅谈循环 for与while
昨天写的条件分支结构与今日写的循环是编程两个最基本的也非常重要的个结构 for循环 for循环可以从一个元组(tuple),列表(list),字典(dict),集合(set),字符串(string') ...
- 三个dom xss常用tips
分享dom xss的三个案例 (1)javascript里面过滤单引号和双引号? 搭建环境: 只是过滤了单引号和双引号是可以xss的: 使用<>闭合script即可 </script ...
- XCTF-mfw
mfw mfw是什么东西??? 看题: 进来只有几个标签,挨着点一遍,到About页面 看到了Git,猜测有git泄露,访问/.git/HEAD成功 上Githack,但是会一直重复 按了一次ctrl ...
- SQL注入注释符(#、-- 、/**/)使用条件及其他注释方式的探索
以MySQL为例,首先我们知道mysql注释符有#.-- (后面有空格)./**/三种,在SQL注入中经常用到,但是不一定都适用.笔者在sqlilabs通关过程中就遇到不同场景用的注释符不同,这让我很 ...
- <JVM中篇:字节码与类的加载篇>02-字节码指令集
笔记来源:尚硅谷JVM全套教程,百万播放,全网巅峰(宋红康详解java虚拟机) 同步更新:https://gitee.com/vectorx/NOTE_JVM https://codechina.cs ...
- 动手实现一个适用于.NET Core 的诊断工具
前言 大家可能对诊断工具并不陌生,从大名鼎鼎的 dotTrace,到 .NET CLI 推出的一系列的高效诊断组件(dotnet trace,dotnet sos,dotnet dump)等, 这些工 ...
- (CV学习笔记)看图说话(Image Captioning)-2
实现load_img_as_np_array def load_img_as_np_array(path, target_size): """从给定文件[加载]图像,[缩 ...
- 用PS给视频磨皮美颜
无意间找到的,但是一个10分钟的视频渲染了我一天的时间,但是效果是不错的 参考视频链接 https://www.bilibili.com/video/BV1b7411m74e 视频中涉及的添加插件链接 ...
- apache common pool2原理与实战
完整源码,请帮我点个star哦! 原文地址为https://www.cnblogs.com/haixiang/p/14783955.html,转载请注明出处! 简介 对象池顾名思义就是存放对象的池,与 ...