#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
查找所有包含"韩寒创业简史"的记录
"""

import sqlite3


def find_all_hanhan():
    """
    查找所有包含"韩寒创业简史"的记录
    """
    db_path = r"\\ll\D\xtrssvjj\db\dpd.db"
    try:
        conn = sqlite3.connect(db_path)
        cur = conn.cursor()
        
        # 查询所有包含"韩寒创业简史"的记录
        cur.execute("SELECT DISTINCT adid, adname FROM srts WHERE adname LIKE '%韩寒创业简史%' ORDER BY adid")
        results = cur.fetchall()
        conn.close()
        
        if results:
            print(f"找到 {len(results)} 条包含'韩寒创业简史'的记录:")
            for adid, adname in results:
                print(f"  adid: {adid}, adname: {adname}")
            return results
        else:
            print("未找到包含'韩寒创业简史'的记录")
            return []
    except Exception as e:
        print(f"数据库查询错误: {e}")
        return []


if __name__ == "__main__":
    find_all_hanhan()
