<?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.extend.ExtDTMapper">


    <insert id="insertCompExtDT" parameterType="java.util.Map">
        insert into ${tableName} (
        <foreach collection="map" item="value" index="key" separator=",">
            ${key}
        </foreach>
        )
        values (
        <foreach collection="map" item="value" index="key" separator=",">
            #{value}
        </foreach>
        )
    </insert>
    <delete id="deleteByMainID">
        delete
        from ${tableName}
        where mainid = #{mainId}
        <if test=" null!=groupId ">
            and group_id = #{groupId}
        </if>
    </delete>

    <select id="listCompExtDT" resultType="map">
        select ${fields}
        from ${tableName}
        where mainid = #{id}
          and delete_type = 0
    </select>

</mapper>