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)
  • 相关阅读:
    gjrand 4.0 发布,C语言的伪随机数生成器
    Kite 0.2.0 发布,编程语言
    IBM/DW C++11 标准新特性:Defaulted 和 Deleted 函数
    Apache Solr 3.6.2 发布
    bitmap 内存溢出处理
    Qtractor 0.5.7 发布,多轨音序生成器
    CUBRID Node.js Driver 1.1 发布
    OrientDB 1.3.0 发布,基于文档的数据库
    linux centos 下面httpd支持的svn 服务器端安装
    iptables 1.4.17 发布,Linux防火墙
  • 原文地址:https://www.cnblogs.com/xiao-xue-di/p/13672215.html
Copyright © 2011-2022 走看看