SELECT fn.*,tf.state,tf.id as fId from teacher_files tf LEFT JOIN teacher_files_notice fn on fn.id= tf.notice_id WHERE tf.teacher_id = #{userId} and fn.notice_name LIKE concat('%', #{noticeName}, '%') and fn.notice_state = 2
SELECT fn.*,tf.state,tf.id as fId from teacher_files tf LEFT JOIN teacher_files_notice fn on fn.id= tf.notice_id WHERE tf.teacher_id = #{userId}
and fn.notice_state = 2
<iftest="noticeName != null "> and fn.notice_name LIKE concat('%', #{noticeName}, '%') </if>