出现问题:
<select id="selectOrderStatusByCreateTime" resultMap="BaseResultMap" parameterType="map">
SELECT
<include refid="Base_Column_List"/>
from mmall_order
where status = #{status}
and create_time <= #{date}
order by create_time desc
</select>
在OrderMapper.xml写sql语句涉及到<
这个特殊字符,报红线错误。
解决方法:
<select id="selectOrderStatusByCreateTime" resultMap="BaseResultMap" parameterType="map">
SELECT
<include refid="Base_Column_List"/>
from mmall_order
where status = #{status}
<![CDATA[
and create_time <= #{date}
]]>
order by create_time desc
</select>
将含有需转义的字符包裹在<![CDATA[ ]]>
中
网友评论