【C017147】存在如下配置:
<select id="sqlLog" parameterType="appLog" resultType=" appLog ">
SELECT * FROM t_applog WHERE
<if test="title != null">
title = #{title}
</if>
<if test="content != null">
AND content = #{content}
</if>
</select>
以下选项说明错误的是()。
A.这个配置存在问题,当第一个if语句不成立时WHERE后面紧跟AND是一个错误的SQL将会出现运行时异常
B.为了解决title为null时的运行时异常我们可以在WHERE后面增加1=1
C.为了解决title为null时的运行时异常我们可以用<where>标签把所有<if>包含起来
D.为了解决title为null时的运行时异常我们可以用<trim prefix="where" prefixOverrides="and |or"> </trim>把所有<if>包含起来,并把WHERE去掉