Authored by qinchao

主机根据tag查询 mapper bug

@@ -149,7 +149,7 @@ @@ -149,7 +149,7 @@
149 <if test="params.tagsList != null &amp;&amp; params.tagsList.size()>0" > 149 <if test="params.tagsList != null &amp;&amp; params.tagsList.size()>0" >
150 and 150 and
151 <foreach collection="params.tagsList" index="index" item="item" separator="and"> 151 <foreach collection="params.tagsList" index="index" item="item" separator="and">
152 - instr(a.tags, #{item}) &gt; 0 152 + instr(a.tags, concat(#{item},',')) &gt; 0
153 </foreach> 153 </foreach>
154 </if> 154 </if>
155 </otherwise> 155 </otherwise>
@@ -180,7 +180,7 @@ @@ -180,7 +180,7 @@
180 <if test="params.tagsList != null &amp;&amp; params.tagsList.size()>0" > 180 <if test="params.tagsList != null &amp;&amp; params.tagsList.size()>0" >
181 and 181 and
182 <foreach collection="params.tagsList" index="index" item="item" separator="and"> 182 <foreach collection="params.tagsList" index="index" item="item" separator="and">
183 - instr(a.tags, #{item}) &gt; 0 183 + instr(a.tags, concat(#{item},',')) &gt; 0
184 </foreach> 184 </foreach>
185 </if> 185 </if>
186 </otherwise> 186 </otherwise>
@@ -201,7 +201,7 @@ @@ -201,7 +201,7 @@
201 select 201 select
202 <include refid="Base_Column_List" /> 202 <include refid="Base_Column_List" />
203 from host_info 203 from host_info
204 - where instr(tags, LOWER(#{tag})) &gt; 0 204 + where instr(tags, concat(#{tag},',')) &gt; 0
205 </select> 205 </select>
206 206
207 <select id="selectHostInfosByTagList" resultMap="BaseResultMap"> 207 <select id="selectHostInfosByTagList" resultMap="BaseResultMap">
@@ -212,7 +212,7 @@ @@ -212,7 +212,7 @@
212 <if test="tagsList != null &amp;&amp; tagsList.size > 0" > 212 <if test="tagsList != null &amp;&amp; tagsList.size > 0" >
213 and 213 and
214 <foreach open="(" close=")" item="item" index="index" collection="tagsList" separator="and"> 214 <foreach open="(" close=")" item="item" index="index" collection="tagsList" separator="and">
215 - instr(tags, #{item}) &gt; 0 215 + instr(tags, concat(#{item},',')) &gt; 0
216 </foreach> 216 </foreach>
217 </if> 217 </if>
218 </select> 218 </select>
@@ -225,7 +225,7 @@ @@ -225,7 +225,7 @@
225 <if test="tagsList != null &amp;&amp; tagsList.size > 0" > 225 <if test="tagsList != null &amp;&amp; tagsList.size > 0" >
226 and 226 and
227 <foreach open="(" close=")" item="item" index="index" collection="tagsList" separator="and"> 227 <foreach open="(" close=")" item="item" index="index" collection="tagsList" separator="and">
228 - instr(tags, #{item}) &gt; 0 228 + instr(tags, concat(#{item},',')) &gt; 0
229 </foreach> 229 </foreach>
230 </if> 230 </if>
231 231
@@ -242,7 +242,7 @@ @@ -242,7 +242,7 @@
242 select 242 select
243 <include refid="Base_Column_List" /> 243 <include refid="Base_Column_List" />
244 from host_info 244 from host_info
245 - where instr(tags, LOWER(#{tag})) &gt; 0 245 + where instr(tags, concat(#{tag},',')) &gt; 0
246 AND cloud_type = #{cloudType} 246 AND cloud_type = #{cloudType}
247 </select> 247 </select>
248 248