For queries that want to implement fuzzy judgments, such as SQL queries that are greater than, equal to, or less than, you can use an expression query method.
Query expression format: $map [' field name '] = Array (' expression ', ' query condition ');
PS: The expression is case-insensitive.
Example:
EQ: Equals (=)
$map [' id '] = array (' eq ', 1); Where is id=1
NEQ: Not equal to (<>)
$map [' id '] = array (' NEQ ', 1); Where is id<>1
GT: Greater Than (>)
$map [' id '] = array (' GT ', 1); Where is id>1
EGT: greater than or equal to (>=)
$map [' id '] = array (' Egt ', 1); Where is Id>=1
LT: Less Than (<)
$map [' id '] = array (' lt ', 1); Where is id<1
ELT: Less than or equal (<=)
$map [' id '] = array (' ELT ', 1); Where is Id<=1
[Not]like: Fuzzy query
$map [' user '] = array (' Like ', '% small% '); Where is like% small%
[Not]like: Fuzzy query
$map [' user '] = array (' notlike ', '% small% '); Where is not like% small%
[Not]like: Array mode for fuzzy queries
$map [' user '] = array (' Like ', array ('% small% ', '% wax% '), ' and ');
The generated SQL
SELECT * from ' think_user ' WHERE (' user ' like '% small ' and ' user '
Like '% wax% '))
[NOT] Between: Interval query
$map [' id '] = array (' Between ', ' 1,3 ');
Where is ' id ' between ' 1 ' and ' 2 '
Ibid equivalent
$map [' id '] = array (' Between ', Array (' 1 ', ' 3 '));
[NOT] Between: Interval query
$map [' id '] = array (' Not between ', ' 1,3 ');
Where is ' id ' not between ' 1 ' and ' 2 '
[NOT] in: Interval query
$map [' id '] = array (' In ', ' 1,2,4 ');
Where is ' id ' in (' 1 ', ' 2 ', ' 4 ')
[NOT] in: Interval query
$map [' id '] = array (' Not ', ' 1,2,4 ');
Where is ' id ' not in (' 1 ', ' 2 ', ' 4 ')
EXP: Custom
$map [' id '] = Array (' exp ', ' in (1,2,4) ');
Where is ' id ' not in (' 1 ', ' 2 ', ' 4 ')
PS: Use exp custom to write a where statement directly in the second parameter
EXP: Custom Add or statement
$map [' id '] = Array (' exp ', ' = 1 ');
$map [' user '] = Array (' exp ', ' = ' crayon small new ');
$map [' _logic '] = ' OR ';
WHERE is ((' id ' =1)) OR ((' user ' = "crayon Small New"))