xml中语法的使用

批量删除

    <delete id="deleteDictTypeByIds">
        delete from sso_dict_type where id in
        <foreach item="dictId" collection="array" open="(" separator="," close=")">
            #{dictId}
        </foreach>
    </delete>

更新父结点

 <update id="updateParentStatus">
         update sso_group
     <set>
        <if test="status != null and status != ''">status = #{status},</if>
        <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
        update_time = sysdate()
     </set>
         where  id  in ( ${ancestors})
    </update>
posted @ 2021-08-26 11:17  孙家湾  阅读(56)  评论(0)    收藏  举报