mybatis中动态sql —入参为基本类型 \ Map类型时 在 if test " "中参数的表示

一、入参为基本类型:

用  _parameter 代替一个为基本类型的入参 进行条件判断

 
<update id="updateAllSignOfDelete" parameterType="java.lang.String">
        update conversation_table set INITIATOR_DELETE = '0',TARGET_DELETE='0'
        where
        <if test="_parameter  != '' and _parameter  != null">
        id = #{id}
        </if>
</update>

二、入参为Map\实体类时:

猜你喜欢

转载自blog.csdn.net/qq_35808136/article/details/88314903