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的更多相关文章
随机推荐
- 使用yamllint 检查yaml语法
安装node 之后npm install -g yaml-lint 使用方法 yamllint confluence.yaml
- 1-web 服务器 框架。
1.静态网页与动态网页 1.静态网页:无法与服务器进行交互的网页. 2.动态网页:能够与服务器进行交互的网页. 2.web与服务器 1.web:网页(HTML,CSS,JS) 2.服务器:能够给用户提 ...
- Dalvik模式下System.loadLibrary函数的执行流程分析
本文博客地址:http://blog.csdn.net/qq1084283172/article/details/78212010 Android逆向分析的过程中免不了碰到Android so被加固的 ...
- 硬盘分区形式(MBR、GPT)、系统引导、文件系统、Inode和Block
目录 MBR和GPT MBR的局限性 GPT的优势 主分区.扩展分区和逻辑分区 挂接卷 Legacy.UEFI引导和GRUB引导 文件系统(FAT16.32.NTFS和EXT2.3.4.Xfs.Tmp ...
- Windows核心编程笔记之内核对象
0x01 子进程继承父进程内核对象句柄 父进程 #include <Windows.h> #include <iostream> #include <strsafe.h& ...
- 插入排序——Python实现
插入排序Python实现 # -*- coding: utf-8 -*- # @Time : 2019/10/28 20:47 # @Author : yuzhou_1shu # @Email : y ...
- 【TensorFlow】使用Object Detection API 训练自己的数据集报错
错误1: 训练正常开始后,能正常看到日志输出,但中途报错 ResourceExhaustedError (see above for traceback): OOM when allocating ...
- 【js】Leetcode每日一题-二叉树的堂兄弟节点
[js]Leetcode每日一题-二叉树的堂兄弟节点 [题目描述] 在二叉树中,根节点位于深度 0 处,每个深度为 k 的节点的子节点位于深度 k+1 处. 如果二叉树的两个节点深度相同,但 父节点不 ...
- Codeforces Round #660 (Div. 2)
A. Captain Flint and Crew Recruitment 题意:定义了一种数(接近质数),这种数可以写成p*q并且p和q都是素数,问n是否可以写成四个不同的数的和,并且保证至少三个数 ...
- 通过LinkedHashMap实现LRU算法
一.基于LinkedHashMap源码分析 方法调用流程(这里只是以put方法位例) put() -> putVal() -> afterNodeInsertion() -> rem ...