Mybatis写SQL话语注意

Mybatis写SQL语句注意1.mybatis where 动态查询时,首个查询语句的首个单词中不要出现sql的关键字 比如:wh

Mybatis写SQL语句注意


1.mybatis where 动态查询时,首个查询语句的首个单词中不要出现sql的关键字
 比如:

            <where>            coupon.isdel = 0            <if test="orgIds !=null">                AND org.id IN                <foreach collection="orgIds" item="item" index="index" open="("                    separator="," close=")">                    #{item}                </foreach>            </if>        </where>