<?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.yonge.cooleshow.biz.dal.mapper.TenantUnbindHistoryMapper">

    <!-- 表字段 -->
    <sql id="baseColumns">
        t.id_ AS id
        , t.tenant_id_ AS tenantId
        , t.tenant_name_ AS tenantName
        , t.user_id_ AS userId
        , t.user_name_ AS userName
        , t.phone_ AS phone
        , t.user_type_ AS userType
        , t.unbind_reason_ AS unbindReason
        , t.status_ AS status
        , t.verify_user_id_ AS verifyUserId
        , t.reason_ AS reason
        , t.intervene_time_ AS interveneTime
        , t.create_time_ AS createTime
    </sql>

    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.entity.TenantUnbindHistory">
        SELECT
        <include refid="baseColumns" />
        FROM tenant_unbind_history t
        <where>
            <if test="param.userId != null">
                AND t.user_id_ = #{param.userId}
            </if>
        </where>
        order by id_ desc
    </select>

</mapper>