instr函数
语法格式
格式一
instr( string1, string2 )
instr(源字符串, 目标字符串)
格式二
instr( string1, string2 [, start_position [, nth_appearance ] ] )
instr(源字符串, 目标字符串, 起始位置, 匹配序号)
string2 的值要在string1中查找,是从start_position给出的数值位置
开始在string1检索,检索第nth_appearance次出现string2
返回结果
大于0,表示匹配成功
等于0,表示匹配失败
SELECT
<include refid="Base_Column_List"/>
FROM UUM_EMPLOYEE ue
LEFT JOIN UUM_USER uu ON ue.ACCOUNT_ID=uu.ID
LEFT JOIN UUM_ACCOUNT ua ON ue.ACCOUNT_ID=ua.ID
WHERE 1=1
<if test="deptmentCodes !=null and deptmentCodes !=''">
<foreach collection="deptmentCodes" item="dept_code" separator=" or "
open="and (" close=")">
instr(ue.dept_codes,#{dept_code}) != 0
</foreach>
</if>
order by uu.USER_NAME