第一种写法:
原符号 | < |
<= |
> |
>= |
& |
' |
" |
---|---|---|---|---|---|---|---|
替换符号 | < |
<= |
> |
>= |
& |
' |
" |
SQL示例如下:
select * from (
select * from (<include refid="baseOrderInfoVo" />) a
union all
select * from (<include refid="baseOrderReturnVo" />) b
union all
select * from (<include refid="baseSpjhdVo" />) c
) billdtovo
<where>
<if test="term.q!=null and term.q!='' "> and djbh like concat('%',#{term.q},'%') </if>
<if test="term.djlx!=null and term.djlx!='' ">and djlx=#{term.djlx} </if>
<if test="term.state!=null ">and status=#{term.state} </if>
<if test="term.rqf!=null and term.rqf!='' "> and rq >= #{term.rqf} </if>
<if test="term.rqt!=null and term.rqt!='' "> and rq <= #{term.rqt} </if>
</where>
order by djlx,rq,djbh
第二种写法:
大于等于 | <![CDATA[ >= ]]> |
---|---|
小于等于 | <![CDATA[ <= ]]> |
SQL示例如下:
select * from (
select * from (<include refid="baseOrderInfoVo" />) a
union all
select * from (<include refid="baseOrderReturnVo" />) b
union all
select * from (<include refid="baseSpjhdVo" />) c
) billdtovo
<where>
<if test="term.q!=null and term.q!='' "> and djbh like concat('%',#{term.q},'%') </if>
<if test="term.djlx!=null and term.djlx!='' ">and djlx=#{term.djlx} </if>
<if test="term.state!=null ">and status=#{term.state} </if>
<if test="term.rqf!=null and term.rqf!='' "> and rq <![CDATA[ >= ]]> #{term.rqf} </if>
<if test="term.rqt!=null and term.rqt!='' "> and rq <![CDATA[ <= ]]> #{term.rqt} </if>
</where>
order by djlx,rq,djbh