<?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.cool.store.mapper.StoreGroupMappingMapper">

    <select id="getStoreGroupMappingByGroupIDs"
            resultType="com.cool.store.entity.StoreGroupMappingDO">
        select
        group_id as groupId,
        store_id as storeId
        from store_group_mapping_${enterpriseId}
        <where>
            <foreach collection="groupIds" open=" group_id in (" close=")" separator="," item="groupId">
                #{groupId}
            </foreach>
        </where>
        group by group_id,store_id
    </select>

</mapper>