xml中:
<select id="selectIptvMessage" parameterType="pojo.IptvMessage" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from iptv_message where 1 = 1 <if test="columnName != null and columnName !=''"> and column_name = #{columnName} </if> <if test="columnTitle != null and columnTitle !=''"> and column_title = #{columnTitle} </if> <if test="endTime != null and endTime !=''"> and column_time <= #{endTime} </if> <if test="startTime != null and startTime !=''"> and column_time >= #{startTime} </if> <if test="city != null and city !=''"> and city = #{city} </if> <if test="county != null and county !=''"> and county = #{county} </if> <if test="town != null and town !=''"> and town = #{town} </if> <if test="iptvName != null and iptvName !=''"> and iptv_name = #{iptvName} </if></select>
页面正常显示,如果没有条件,显示正常,稍微有一个条件查询不到数据,log4j日志有sql语句,有参数,结果为空。
在navicat里查询有数据。
很怪异的错误。好几个人都看了都没有找到问题所在。后来,把工程和数据库布置到另一台电脑上,竟然可以查到数据。
看来不是程序本身的错误,起码有了方向,开始从软件着手,eclipse换成那台电脑的版本,tomcat也换掉,jdk从新配置安装,环境变量配置,最后问题锁定在了数据库,
重新安装mysql,问题得到了解决。
建立数据库的时候要选择字符集,其实经验丰富的人早就想到了,一输入汉子就不出结果,肯定要考虑字符集。希望对他人有所帮助。