sel_sql='''select item_id from clb_sys_attachment where item_id = %s and year = %s and type_id=1'''
# sel_sql = '''select item_id from clb_sys_attachment where item_id = %s and year = %s and type_id=1'''
cursor_.execute(sel_sql,(item_id,year))
# cursor_.execute(sel_sql, (item_id, year))
selects=cursor_.fetchone()
# selects = cursor_.fetchone()
ifselects:
# if selects:
print(f'{name_pdf},{year}已存在')
# print(f'{name_pdf},{year}已存在')
#
else:
# else:
Upsql='''insert into clb_sys_attachment(year,name,type_id,item_id,group_name,path,full_path,category,file_size,order_by,status,create_by,create_time,page_size) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)'''
# Upsql = '''insert into clb_sys_attachment(year,name,type_id,item_id,group_name,path,full_path,category,file_size,order_by,status,create_by,create_time,page_size) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)'''