import pymysql

conn = pymysql.connect(
    host='172.16.2.100',
    port=9030,
    user='anhvh',
    password='v0WYGeyLRCckXotT',
    database='shared_source',
    cursorclass=pymysql.cursors.DictCursor
)

try:
    with conn.cursor() as cursor:
        # Check product có gender=male nhưng tên có "nữ"
        print("=== Products với gender='male' và product_line LIKE '%Áo%' ===\n")
        cursor.execute("""
            SELECT product_name, gender_by_product, product_line_vn
            FROM magento_product_dimension_with_text_embedding
            WHERE gender_by_product = 'male' AND product_line_vn LIKE '%Áo%'
            LIMIT 10
        """)
        for row in cursor.fetchall():
            print(f"  {row['product_name']}")
            print(f"    → gender: {row['gender_by_product']}, line: {row['product_line_vn']}\n")
        
        print("\n=== Check products có tên 'Áo body nữ' ===\n")
        cursor.execute("""
            SELECT product_name, gender_by_product, product_line_vn
            FROM magento_product_dimension_with_text_embedding
            WHERE product_name LIKE '%Áo body nữ%'
            LIMIT 5
        """)
        for row in cursor.fetchall():
            print(f"  {row['product_name']}")
            print(f"    → gender: {row['gender_by_product']}, line: {row['product_line_vn']}\n")
            
finally:
    conn.close()
