<select id="selectYWList" resultType="io.renren.modules.doc.entity.TDocInfoEntity">
select
a.ID,a.status
from t_doc_info a
where status=-1
<if test="deptid != '' and deptid != null">
<!-- and REGEXP_LIKE(a.deptid,#{deptid}) -->
and deptid REGEXP #{deptid}
</if>
ORDER BY a.id desc
</select>
and deptid REGEXP #{deptid} mysql的写法 获取到所有 含有deptid的数据
and REGEXP_LIKE(a.deptid,#{deptid}) oracle 的写法
正则 数据在传过来的时候拼好 下边是正则的写法
https://www.runoob.com/mysql/mysql-regexp.html
<if test="deptid != '' and deptid != null">
判断deptid 不是null 并且不是空