<?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.ruoyi.project.common.mapper.ExclusiveMapper">
    <resultMap id="exclusive" type="com.ruoyi.project.common.dto.ExclusiveDto">
        <result column="id" property="id"/>
        <result column="table_ame" property="tableName"/>
        <result column="id_field_name" property="idFieldName"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>


    <select id="getExclusive" resultMap="exclusive" parameterType="com.ruoyi.project.common.dto.ExclusiveDto">
        select
               ${idFieldName} as id,
               update_time
        from ${tableName}
        where ${idFieldName} = #{id} and del_flag = '0'
    </select>

    <select id="getExclusives" resultMap="exclusive">
        select
            ${dto.idFieldName} as id,
            update_time
        from ${dto.tableName}
        where del_flag = '0' and ${dto.idFieldName} in
        <foreach collection="list"  item="item" open="(" separator="," close=")">
            #{item.id}
        </foreach>
    </select>
</mapper>