为了账号安全,请及时绑定邮箱和手机立即绑定

mybatis sql语句带or 项目启动卡住

mybatis sql语句带or 项目启动卡住

qq_遁去的一_1 2019-03-01 10:45:13
mybatis的xml 文件: <select id="getGuiZiExceptionList" resultType="com.haier.xiaowei.rpc.rulai.model.Guizi"> SELECT g.GUIZI_NO as guiziNo, g.GUIZI_NAME as guiziName, g.ADDRESS as address, g.PROVINCE as province, g.CITY as city, g.AREA as area, g.LONGITUDE as longitude, g.LATITUDE as latitude, gm.GONGMAO_NAME as gongmao, gm.GONGMAO_NO as gongMaoNo FROM guizi g LEFT JOIN gongmao gm ON g.GONGMAO = gm.GONGMAO_NO WHERE g.GSTATUS = 0 AND ( g.PROVINCE IS NULL or g.PROVINCE = '' or g.CITY IS NULL or g.CITY = '' or g.AREA IS NULL or g.AREA = '' ) or ( g.LONGITUDE IS NULL or g.LONGITUDE = '' or g.LONGITUDE < '50' or g.LATITUDE IS NULL or g.LATITUDE = '' or g.LATITUDE > '100' ) <if test="pageSize!=0"> limit #{start}, #{pageSize} </if> </select> 我把 AND ( g.PROVINCE IS NULL or g.PROVINCE = '' or g.CITY IS NULL or g.CITY = '' or g.AREA IS NULL or g.AREA = '' ) or ( g.LONGITUDE IS NULL or g.LONGITUDE = '' or g.LONGITUDE < '50' or g.LATITUDE IS NULL or g.LATITUDE = '' or g.LATITUDE > '100' ) 这段删了项目可以跑起来,不删的话 控制台一直七月 25, 2017 5:59:06 下午 org.apache.catalina.core.ApplicationContext log信息: Initializing Spring root WebApplicationContext 卡住是or在mybatis里有啥特殊写法吗?
查看完整描述

2 回答

?
侃侃无极

TA贡献2051条经验 获得超10个赞

可以用mybatis中的的符号来表示大于小于,或者把大于小于写在cdata结中.

查看完整回答
反对 回复 2019-03-01
?
翻翻过去那场雪

TA贡献2065条经验 获得超13个赞

select语句,建议放到下面的区域中,可以避免特殊字符的转义问题。

<![CDATA[

]]>
查看完整回答
反对 回复 2019-03-01
  • 2 回答
  • 0 关注
  • 1079 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信