Yi - add sql statement and criterias