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)
  • 相关阅读:
    cookie和session
    图书馆里系统前端页面
    图书管理系统后端接口
    Vue组件
    axios前端登录
    django配置跨域并开发测试接口
    axios封装
    初始化vue项目
    model的基础操作
    Windows 系统版本介绍
  • 原文地址:https://www.cnblogs.com/xiao-xue-di/p/13672215.html
Copyright © 2011-2022 走看看