<selectid="getUserListByChoose"resultMap="getUserListByChoose">
select * from smbms_user as user where 1 = 1
<choose><whentest="userName!=null and userName!=''">
and user.userName like Concat('%',#{userName},'%')
</when><whentest="userRole!=null">
and user.userRole = #{userRole}
</when><whentest="gender!=null">
and user.gender = #{gender}
</when><otherwise>
and YEAR(user.creationDate) = YEAR(#{creationDate})
</otherwise></choose></select>