<if test="person != null and person != ''">and create_by = #{person}
</if>
<if test="dept != null and dept != ''">and dept_no = #{dept}
</if>
<if test="deptLike != null and deptLike != ''">
<bind name="pattern" value="deptLike+'%'"/>
and dept_no like #{pattern}
</if>
<if test="perMap != null">
and
<foreach collection="perMap.keys" item="key" open="(" close=")" separator="or" >
<if test="perMap[key] == 'like'">
<bind name="pattern" value="key+'%'"/>
dept_no like #{pattern}
</if>
<if test="perMap[key] == 'equal'">
dept_no = ${key}
</if>
<if test="perMap[key] != null and perMap[key] != 'like' and perMap[key] != 'equal'">
dept_no = ${key} and create_by = #{perMap[${key}]}
</if>
</foreach>
</if>
Session session=ShiroUtils.getSession();
String person = (String)session.getAttribute("person");
params.put("person",person);
String dept = (String)session.getAttribute("dept");
params.put("dept",dept);
Map<String,String> perMap = (Map<String,String>)session.getAttribute("perMap");
params.put("perMap",perMap);
String deptLike = (String)session.getAttribute("deptLike");
params.put("deptLike",deptLike);