<?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.yinlihupo.enlish.service.domain.mapper.UserRoleRelDOMapper">
    <resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.UserRoleRelDO">
        <id column="id" jdbcType="BIGINT" property="id" />
        <result column="user_id" jdbcType="BIGINT" property="userId" />
        <result column="role_id" jdbcType="BIGINT" property="roleId" />
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />

    </resultMap>
    <select id="selectAll" resultMap="BaseResultMap">
        select *
        from user_role_rel
    </select>

    <select id="selectByUserIds" resultMap="BaseResultMap">
        select *
        from user_role_rel
        where user_id in
        <foreach item="item" index="index" collection="userIds" open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>

</mapper>