Ejemplo n.º 1
0
    def meterial_outbound_list(self, statu):
        try:
            # with connection.cursor() as cursor:
            #     # Create a new record
            #     sql = "INSERT INTO `users` (`email`, `password`) VALUES (%s, %s)"
            #     cursor.execute(sql, ('*****@*****.**', 'very-secret'))
            #
            # connection.commit()

            with connection.cursor() as cursor:
                # Read a single record
                sql = "SELECT MAX(id) FROM wisdom_warehouse_access WHERE type = 2 and access_type ='out' and STATUS=%d" % statu
                cursor.execute(sql)
                result = cursor.fetchone()  # 获取第一行
                # print(result['MAX(id)'])
                return result['MAX(id)']
        finally:
            pass
Ejemplo n.º 2
0
    def quality_check_list(self, statu):
        try:
            # with connection.cursor() as cursor:
            #     # Create a new record
            #     sql = "INSERT INTO `users` (`email`, `password`) VALUES (%s, %s)"
            #     cursor.execute(sql, ('*****@*****.**', 'very-secret'))
            #
            # connection.commit()

            with connection.cursor() as cursor:
                # Read a single record
                sql = "SELECT MAX(id) FROM wisdom_quality_check WHERE STATUS=%d" % statu
                cursor.execute(sql)
                result = cursor.fetchone()  # 获取第一行
                # print(result['MAX(id)'])
                return result['MAX(id)']
        finally:
            pass