from TestData.inbox.ticketInfo_test_data import ticketInfoData 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` 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` 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` 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` 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` in (0,1) or (`room_type` = 3 and `ai_handle_status` = 100))' all_ticket_num = len(ticketInfoData.ticket_info_db.select_many_value(sql=all_ticket_select_sql)) wait_ticket_num = len(ticketInfoData.ticket_info_db.select_many_value(sql=wait_ticket_select_sql)) close_ticket_num = len(ticketInfoData.ticket_info_db.select_many_value(sql=close_ticket_select_sql)) your_ticket_num = len(ticketInfoData.ticket_info_db.select_many_value(sql=your_ticket_select_sql)) your_wait_ticket_num = len(ticketInfoData.ticket_info_db.select_many_value(sql=your_wait_ticket_sql)) your_close_ticket_num = len(ticketInfoData.ticket_info_db.select_many_value(sql=your_close_ticket_sql)) setattr(ticketInfoData,'all_ticket_num',all_ticket_num) setattr(ticketInfoData,'close_ticket_num',close_ticket_num) setattr(ticketInfoData,'wait_ticket_num',wait_ticket_num) setattr(ticketInfoData,'your_ticket_num',your_ticket_num) setattr(ticketInfoData,'your_wait_ticket_num',your_wait_ticket_num) setattr(ticketInfoData,'your_close_ticket_num',your_close_ticket_num) ticketInfoData.ticket_info_db.close_db()