product_select_sql=f'select * from `shopify_product` where shop_id = {AiTestData.shopId} and status = "active" and is_delete = 0 order by update_at desc'
product_select_sql=f'select * from `shopify_product` where shop_id = {AiTestData.shopId} and is_delete = 0 order by update_at desc'
all_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 1 and `is_ignore` = 0 and room_type != 2'
all_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 1 and `is_ignore` = 0 and (`room_type` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))'
wait_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 2 and `is_ignore` = 0 and room_type != 2'
wait_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 2 and `is_ignore` = 0 and (`room_type` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))'
close_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 3 and `is_ignore` = 0 and room_type != 2'
close_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 3 and `is_ignore` = 0 and (`room_type` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))'
your_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 1 and `allocation_uid` = {ticketInfoData.userId} and `is_ignore` = 0 and room_type != 2'
your_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 1 and `allocation_uid` = {ticketInfoData.userId} and `is_ignore` = 0 and (`room_type` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))'
your_wait_ticket_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 2 and `allocation_uid` = {ticketInfoData.userId} and `is_ignore` = 0 and room_type != 2'
your_wait_ticket_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 2 and `allocation_uid` = {ticketInfoData.userId} and `is_ignore` = 0 and (`room_type` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))'
your_close_ticket_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 3 and `allocation_uid` = {ticketInfoData.userId} and `is_ignore` = 0 and room_type != 2'
your_close_ticket_sql=f'select * from `im_room` where `cate_id` = {ticketInfoData.brandId} and `status` = 3 and `allocation_uid` = {ticketInfoData.userId} and `is_ignore` = 0 and (`room_type` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))'
all_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `is_ignore` = 0 and room_type != 2'
all_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `is_ignore` = 0 and (`room_type` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))'
your_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `allocation_uid` = {ticketStatusData.userId} and `is_ignore` = 0 and room_type != 2'
your_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `allocation_uid` = {ticketStatusData.userId} and `is_ignore` = 0 and (`room_type` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))'
unread_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `read_status` = 1 and `is_ignore` = 0 and room_type != 2'
unread_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `read_status` = 1 and `is_ignore` = 0 and (`room_type` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))'
unassigned_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `allocation_uid` = 0 and `is_ignore` = 0 and room_type != 2'
unassigned_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `allocation_uid` = 0 and `is_ignore` = 0 and (`room_type` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))'
chatbot_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `is_ignore` = 0 and room_type in (2,3)'
chatbot_ticket_select_sql=f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `is_ignore` = 0 and room_type in (2,3)'
facebook_select_sql=f'select * from im_facebook_channel_conf where site_id = {facebook_id_list[0]} and is_connected = 1 and ins_relate = "" and expires_at > {int(timeStamp)}'
facebook_select_sql=f'select * from im_facebook_channel_conf where site_id = {facebook_id_list[0]} and is_connected = 1 and expires_at > {int(timeStamp)}'
else:
else:
facebook_select_sql=f'select * from im_facebook_channel_conf where site_id in {facebook_id_list} and is_connected = 1 and ins_relate = "" and expires_at > {int(timeStamp)}'
facebook_select_sql=f'select * from im_facebook_channel_conf where site_id in {facebook_id_list} and is_connected = 1 and expires_at > {int(timeStamp)}'