读书人

Mybatis写SQL话语注意

发布时间: 2013-09-05 16:02:07 作者: rapoo

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>




读书人网 >SQL Server

热点推荐