<select id="queryPage" resultType="cn"> select * from Tb WHERE 1 = 1 <if test="param2.urgentDegree!=null and param2.urgentDegree!=''"> and urgent_Degree = #{param2.urgentDegree} </if> <if test="param2.deviceId!=null and param2.deviceId!=''"> and device_Id like CONCAT(CONCAT('%', #{param2.deviceId}), '%') </if> <if test="param2.auditStatusList!=null"> and audit_status in <foreach collection="param2.auditStatusList" item="item" separator="," open="(" close=")" index=""> #{item} </foreach> </if> <if test="userList !=null"> and ((1, ARTICLEID) in <foreach collection="idList" item="item" separator="," open="(" close=")" index=""> (1, #{item}) </foreach>) </if> Order By CREATE_TIME DESC </select>
标签:XML,标签,item,param2,Mybatis,CONCAT From: https://www.cnblogs.com/cjxy1993/p/16601981.html