User research – The best way to organize the search form interface?

I have a tab in my application where users can search Accounts. The chart of accounts has two different types of accounts, User type and Personal. The type of user is one that has a username, password, etc. The staff only maintains the field and the status of the position. Both types of accounts share the following fields: first, last name, email and middle name. The rest of the fields are assigned according to the type of account. My search interface is more complex due to that table. When the user enters this tab and tries to find an account first, he must choose the Account Type, then the Account Status and then the last step is to select the desired filter. That can be username, email or name. Both users and staff will have a name and email, but only the user account type will have a user name. This is the first trick, the second is to find the account by name. So far, what I've researched would be much easier / more efficient for my SQL query to search by Last Name and First Name and then by Full Name. I'm debating how to organize my interface to accommodate something like that. Here is the example of my current interface:

$ (& # 39; # frmFindaccount_filterby & # 39;). on (& # 39; change & # 39 ;, changeAccountAttr);

changeAccountAttr () {function
var elementVal = $ (this) .val ();
$ ("# frmFindaccount_search"). removeAttr (& # 39; pattern maxlength title & # 39;);

switch (elementVal) {
Case 1":
$ ("# frmFindaccount_search"). attr ({
"type the text",
"placeholder": "Example: jcook56",
"Pattern": "[a-z0-9_-]{0.50} $ ",
"title": "The user name allows alphanumeric characters (only in lowercase letters), underscore, hyphen - there are no other special characters",
"maxlength": "50",
"disabled": false,
"required": true
}). val ("");
break;
case "2":
$ ("# frmFindaccount_search"). attr ({
"type": "email",
"placeholder": "example@gmail.com",
"Title": "Enter email address",
"maxlength": "80",
"disabled": false,
"required": true
}). val ("");
break;
case "3":
$ ("# frmFindaccount_search"). attr ({
"type": "search",
"placeholder": "(Last, First) or (Last + First)",
"Pattern": "[a-zA-Z][A-Za-z' .,-]{0,100} $ ",
"title": "A-Z, space, hyphen, apostrophe, period, comma - no other special characters",
"maxlength": "100",
"disabled": false,
"required": true
}). val ("");
break;
default:
$ ("# frmFindaccount_search"). attr ({
"type the text",
"placeholder": "Select search criteria",
"disabled": true,
"required": false
}). val ("");
}
}



I wonder if anyone has any suggestions on how this can be achieved so that the search engine is easy to use and efficient. Maybe showing all the search filters on the screen? In my opinion, sometimes it can confuse, also many fields and move around the smaller screens.