<?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.ads.business.dao.TypeRoleDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ads.business.entity.TypeRole">
        <id column="id" property="id" />
        <result column="type_id" property="typeId" />
        <result column="mobile" property="mobile" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, type_id, mobile
    </sql>
    <insert id="insertBatch" >
        insert into hsay_type_role
        (
        type_id, mobile)
        values
        <foreach item="item" index="index" collection="list" separator=",">
            (
            #{item.typeId},
            #{item.mobile}
            )
        </foreach>
    </insert>

    <select id="getMobileList"
            resultType="com.ads.business.entity.TypeRole">
        select
        id,
        type_id,
        mobile
        from hsay_type_role
        where type_id = #{typeId}

    </select>

    <select id="getListByTypeId" resultType="java.lang.String">
        select
                mobile
        from    hsay_type_role
        where type_id = #{typeId} and mobile = #{mobile}
    </select>

</mapper>
