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的更多相关文章
随机推荐
- Weekly Contest 139
1071. Greatest Common Divisor of Strings For strings S and T, we say "T divides S" if and ...
- 1.Java开发环境搭建
Java开发环境搭建 date: 2021-4-7 19:17:30 JDK安装 下载所需的JDK版本,点此下载JDK8的安装包 挑选对应的系统版本 配置环境变量 打开高级系统设置,找到系统变量 在系 ...
- hdu1316 水大数
题意: 给你一个区间,问这个区间有多少个斐波那契数. 思路: 水的大数,可以直接模拟,要是懒可以用JAVA,我模拟的,打表打到1000个就足够用了... #include<s ...
- hdu2489-DFS+最小生成树
题意: 给你n个点,和任意两点的距离,让你在这N个点中找到一个有m个点并且ratio最小的树. ratio = sum(edge) / su ...
- 最新版Theos.2016.08的安装方法
http://bbs.pediy.com/showthread.php?t=212425 标题: [翻译]手把手安装最新版Theos.2016.08作者: roysue时间: 2016-08-26,1 ...
- android dalvik浅析一:解释器及其执行
dalvik是android中使用的虚拟机,基于寄存器,分析基于android4.2源代码.本篇主要分析的是dalvik中的解释器部分,源码位于/dalvik/vm,主要代码在interp和mterp ...
- SSM项目使用Spring提供的测试
在测试类上添加注解@RunWith(SpringJUnit4ClassRunner.class)和@ContextConfiguration(locations = {"classpath: ...
- Mac SSH工具-Termius
全平台,功能强大 SSH连接.SFTP连接.端口转发.多设备同步 官方网站
- 服务治理演进剖析 & Service Mesh、 xDS核心原理梳理
基于XDS协议实现控制面板与数据面板通信分享 基于这段时间在同程艺龙基础架构部的蹲坑,聊一聊微服务治理的核心难点.历史演进.最新动态, 以上内容属自我思考,不代表同程艺龙技术水准.如理解有偏差.理解不 ...
- [Python] 爬虫系统与数据处理实战 Part.1 静态网页
爬虫技术基础 HTTP/HTTPS(7层):应用层,浏览器 SSL:加密层,传输层.应用层之间 TCP/IP(4层):传输层 数据在传输过程中是加密的,浏览器显示的是解密后的数据,对爬虫没有影响 中间 ...