var sql = "select * from ms_staff where 1=1";
if (!string.IsNullOrEmpty(id))
{
sql += " and id like:id";
}
if (!string.IsNullOrEmpty(name))
{
sql += " and RealName like:name";
}
var para = new { id = id + '%', name = name + '%' };
var rlt = Connection.Query<Staff>(sql, para);