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

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里有啥特殊写法吗?

qq_遁去的一_1
浏览 1080回答 2
2回答

侃侃无极

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

翻翻过去那场雪

select语句,建议放到下面的区域中,可以避免特殊字符的转义问题。 <![CDATA[ ]]>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java