<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.organization.mapper.common.RefreshUseMapper">

    <update id="updateIsUsedByIds">
        update ${tableName} set is_used = #{isUsed} where delete_type = 0 and id
        <if test=" isUsed == 0 ">
            not
        </if>
        in
        <foreach collection="ids" open="(" item="id" separator="," close=")">
            #{id}
        </foreach>
    </update>
    <update id="initIsUseStatus">
        update ${tableName}
        set is_used = 0
        where delete_type = 0
    </update>
</mapper>