sel_sql='''select item_id from clb_sys_attachment where item_id = %s and year = %s'''
cursor.execute(sel_sql,(item_id,year))
selects=cursor.fetchone()
ifselects:
print(f'{com_name},{year}已存在')
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) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)'''