<?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.xhpc.user.mapper.XhpcOperatorInternetBlacklistMapper">

    <resultMap type="com.xhpc.user.domain.XhpcOperatorInternetBlacklist" id="XhpcOperatorInternetBlacklistResult">
        <result column="xhpc_operator_internet_blacklist_id" property="xhpcOperatorInternetBlacklistId" />
        <result column="operator_id" property="operatorId" />
        <result column="internet_user_id" property="internetUserId" />
        <result column="status" property="status" />
        <result column="create_time" property="createTime" />
        <result column="create_by" property="createBy" />
        <result column="update_time" property="updateTime" />
        <result column="update_by" property="updateBy" />
        <result column="remark" property="remark" />
    </resultMap>


    <insert id="insert" parameterType="com.xhpc.user.domain.XhpcInternetUser" useGeneratedKeys="true"
            keyProperty="xhpcOperatorInternetBlacklistId">
        insert into xhpc_operator_internet_blacklist
        <trim prefix="(" suffix=")" suffixOverrides=",">
        <if test="null != operatorId and '' != operatorId">
            operator_id,
        </if>
        <if test="null != internetUserId and '' != internetUserId">
            internet_user_id,
        </if>
        <if test="null != status and '' != status">
            status,
        </if>
        <if test="null != createTime ">
            create_time,
        </if>
        <if test="null != createBy and '' != createBy">
            create_by,
        </if>
        <if test="null != updateTime ">
            update_time,
        </if>
        <if test="null != updateBy and '' != updateBy">
            update_by,
        </if>
        <if test="null != remark and '' != remark">
            remark
        </if>
    </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="null != operatorId and '' != operatorId">
                #{operatorId},
            </if>
            <if test="null != internetUserId and '' != internetUserId">
                #{internetUserId},
            </if>
            <if test="null != status and '' != status">
                #{status},
            </if>
            <if test="null != createTime ">
                #{createTime},
            </if>
            <if test="null != createBy and '' != createBy">
                #{createBy},
            </if>
            <if test="null != updateTime ">
                #{updateTime},
            </if>
            <if test="null != updateBy and '' != updateBy">
                #{updateBy},
            </if>
            <if test="null != remark and '' != remark">
                #{remark}
            </if>
        </trim>
    </insert>

    <delete id="deleteByIds" parameterType="java.lang.Long">
        delete from xhpc_operator_internet_blacklist where operator_id = #{operatorId}
    </delete>

    <select id="list" parameterType="java.lang.Long" resultType="java.util.Map">
        select
        operator_id operatorId, internet_user_id internetUserId
        from xhpc_operator_internet_blacklist
        WHERE 1 = 1
        <if test="operatorId != null and operatorId != ''">
            and operator_id = #{operatorId}
        </if>
    </select>
</mapper> 