mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 09:14:48 +09:00
Issue 62: xml Query Supported Not Like
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9621 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
abae1ca3b0
commit
84e7cb3e2f
7 changed files with 161 additions and 0 deletions
|
|
@ -61,6 +61,9 @@
|
||||||
case 'like_tail' :
|
case 'like_tail' :
|
||||||
case 'like_prefix' :
|
case 'like_prefix' :
|
||||||
case 'like' :
|
case 'like' :
|
||||||
|
case 'notlike_tail' :
|
||||||
|
case 'notlike_prefix' :
|
||||||
|
case 'notlike' :
|
||||||
case 'in' :
|
case 'in' :
|
||||||
case 'notin' :
|
case 'notin' :
|
||||||
case 'notequal' :
|
case 'notequal' :
|
||||||
|
|
@ -103,6 +106,11 @@
|
||||||
case 'like' :
|
case 'like' :
|
||||||
return $name.' like '.$value;
|
return $name.' like '.$value;
|
||||||
break;
|
break;
|
||||||
|
case 'notlike_tail' :
|
||||||
|
case 'notlike_prefix' :
|
||||||
|
case 'notlike' :
|
||||||
|
return $name.' not like '.$value;
|
||||||
|
break;
|
||||||
case 'in' :
|
case 'in' :
|
||||||
return $name.' in '.$value;
|
return $name.' in '.$value;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,15 @@
|
||||||
case 'like' :
|
case 'like' :
|
||||||
$this->value = '%'.$value.'%';
|
$this->value = '%'.$value.'%';
|
||||||
break;
|
break;
|
||||||
|
case 'notlike' :
|
||||||
|
$this->value = '%'.$value.'%';
|
||||||
|
break;
|
||||||
|
case 'notlike_prefix' :
|
||||||
|
$this->value = $value.'%';
|
||||||
|
break;
|
||||||
|
case 'notlike_tail' :
|
||||||
|
$this->value = '%'.$value;
|
||||||
|
break;
|
||||||
case 'in':
|
case 'in':
|
||||||
if(!is_array($value)) $this->value = array($value);
|
if(!is_array($value)) $this->value = array($value);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -143,4 +143,52 @@
|
||||||
and (`group_srl` >= 1 or `group_srl` = -1 or `group_srl` = -2) group by `module_srl`';
|
and (`group_srl` >= 1 or `group_srl` = -1 or `group_srl` = -2) group by `module_srl`';
|
||||||
$this->_test($xml_file, $argsString, $expected);
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_Like_Clause(){
|
||||||
|
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.like.xml";
|
||||||
|
$argsString = '$args->s_mid = "test";';
|
||||||
|
$expected = 'select *
|
||||||
|
from `xe_modules` as `modules`
|
||||||
|
where `module` = \'opage\'
|
||||||
|
and (`mid` like \'%test%\')
|
||||||
|
order by `module_srl` desc
|
||||||
|
limit 0, 20';
|
||||||
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_NotLike_Clause(){
|
||||||
|
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.notlike.xml";
|
||||||
|
$argsString = '$args->s_mid = "test";';
|
||||||
|
$expected = 'select *
|
||||||
|
from `xe_modules` as `modules`
|
||||||
|
where `module` = \'opage\'
|
||||||
|
and (`mid` not like \'%test%\')
|
||||||
|
order by `module_srl` desc
|
||||||
|
limit 0, 20';
|
||||||
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_NotLikeTail_Clause(){
|
||||||
|
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.notliketail.xml";
|
||||||
|
$argsString = '$args->s_mid = "test";';
|
||||||
|
$expected = 'select *
|
||||||
|
from `xe_modules` as `modules`
|
||||||
|
where `module` = \'opage\'
|
||||||
|
and (`mid` not like \'%test\')
|
||||||
|
order by `module_srl` desc
|
||||||
|
limit 0, 20';
|
||||||
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_NotLikePrefix_Clause(){
|
||||||
|
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/opage.getOpageList.notlikeprefix.xml";
|
||||||
|
$argsString = '$args->s_mid = "test";';
|
||||||
|
$expected = 'select *
|
||||||
|
from `xe_modules` as `modules`
|
||||||
|
where `module` = \'opage\'
|
||||||
|
and (`mid` not like \'test%\')
|
||||||
|
order by `module_srl` desc
|
||||||
|
limit 0, 20';
|
||||||
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
<query id="getOpageList" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="modules" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="*" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="module" default="opage" />
|
||||||
|
<group pipe="and">
|
||||||
|
<condition operation="like" column="mid" var="s_mid" pipe="or" />
|
||||||
|
<condition operation="like" column="title" var="s_title" pipe="or" />
|
||||||
|
<condition operation="like" column="comment" var="s_comment" pipe="or" />
|
||||||
|
<condition operation="equal" column="module" var="s_module" pipe="or" />
|
||||||
|
<condition operation="equal" column="module_category_srl" var="s_module_category_srl" pipe="or" />
|
||||||
|
</group>
|
||||||
|
</conditions>
|
||||||
|
<navigation>
|
||||||
|
<index var="sort_index" default="module_srl" order="desc" />
|
||||||
|
<list_count var="list_count" default="20" />
|
||||||
|
<page_count var="page_count" default="10" />
|
||||||
|
<page var="page" default="1" />
|
||||||
|
</navigation>
|
||||||
|
</query>
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
<query id="getOpageList" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="modules" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="*" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="module" default="opage" />
|
||||||
|
<group pipe="and">
|
||||||
|
<condition operation="notlike" column="mid" var="s_mid" pipe="or" />
|
||||||
|
<condition operation="like" column="title" var="s_title" pipe="or" />
|
||||||
|
<condition operation="like" column="comment" var="s_comment" pipe="or" />
|
||||||
|
<condition operation="equal" column="module" var="s_module" pipe="or" />
|
||||||
|
<condition operation="equal" column="module_category_srl" var="s_module_category_srl" pipe="or" />
|
||||||
|
</group>
|
||||||
|
</conditions>
|
||||||
|
<navigation>
|
||||||
|
<index var="sort_index" default="module_srl" order="desc" />
|
||||||
|
<list_count var="list_count" default="20" />
|
||||||
|
<page_count var="page_count" default="10" />
|
||||||
|
<page var="page" default="1" />
|
||||||
|
</navigation>
|
||||||
|
</query>
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
<query id="getOpageList" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="modules" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="*" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="module" default="opage" />
|
||||||
|
<group pipe="and">
|
||||||
|
<condition operation="notlike_prefix" column="mid" var="s_mid" pipe="or" />
|
||||||
|
<condition operation="like" column="title" var="s_title" pipe="or" />
|
||||||
|
<condition operation="like" column="comment" var="s_comment" pipe="or" />
|
||||||
|
<condition operation="equal" column="module" var="s_module" pipe="or" />
|
||||||
|
<condition operation="equal" column="module_category_srl" var="s_module_category_srl" pipe="or" />
|
||||||
|
</group>
|
||||||
|
</conditions>
|
||||||
|
<navigation>
|
||||||
|
<index var="sort_index" default="module_srl" order="desc" />
|
||||||
|
<list_count var="list_count" default="20" />
|
||||||
|
<page_count var="page_count" default="10" />
|
||||||
|
<page var="page" default="1" />
|
||||||
|
</navigation>
|
||||||
|
</query>
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
<query id="getOpageList" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="modules" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="*" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="module" default="opage" />
|
||||||
|
<group pipe="and">
|
||||||
|
<condition operation="notlike_tail" column="mid" var="s_mid" pipe="or" />
|
||||||
|
<condition operation="like" column="title" var="s_title" pipe="or" />
|
||||||
|
<condition operation="like" column="comment" var="s_comment" pipe="or" />
|
||||||
|
<condition operation="equal" column="module" var="s_module" pipe="or" />
|
||||||
|
<condition operation="equal" column="module_category_srl" var="s_module_category_srl" pipe="or" />
|
||||||
|
</group>
|
||||||
|
</conditions>
|
||||||
|
<navigation>
|
||||||
|
<index var="sort_index" default="module_srl" order="desc" />
|
||||||
|
<list_count var="list_count" default="20" />
|
||||||
|
<page_count var="page_count" default="10" />
|
||||||
|
<page var="page" default="1" />
|
||||||
|
</navigation>
|
||||||
|
</query>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue