zoukankan      html  css  js  c++  java
  • 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)
  • 相关阅读:
    图像轮廓最大内接矩形的求法
    python利用sift和surf进行图像配准
    Faster Rcnn随笔
    opencv利用svm训练
    灰度图片均衡化源码
    彩色直方图(源码)
    Tensorflow内存暴涨问题
    C++写入txt
    C++生成dll以及调用(函数)和类
    列表元素的几种统计方法总结(嵌套列表)
  • 原文地址:https://www.cnblogs.com/xiao-xue-di/p/13672215.html
Copyright © 2011-2022 走看看