<?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="net.northking.cctp.saas.db.dao.SaasTenantAdminDao">


  <!-- 请在本文件内添加自定义SQL语句 -->

  <resultMap id="DetailMap" type="net.northking.cctp.saas.dto.tenant.SaasTenantAdminDetailDto">
    <!-- 租户id -->
    <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
    <!-- 管理员登录名 -->
    <result column="admin_login_no" jdbcType="VARCHAR" property="adminLoginNo"/>
    <!-- 管理员id -->
    <result column="user_id" jdbcType="VARCHAR" property="userId"/>

  </resultMap>

  <select id="pagingQuery" resultMap="DetailMap" parameterType="net.northking.cctp.saas.db.entity.SaasTenantAdmin">
    select
    id
    ,tenant_id
    ,admin_login_no
    ,user_id
    ,created_by
    ,created_time
    ,updated_by
    ,updated_time
    from
    <include refid="Table_Name"/>
    <trim prefix="WHERE" prefixOverrides="AND" >
      <if test="id != null">
        AND id = #{id,jdbcType=VARCHAR}
      </if>
      <if test="tenantId != null">
        AND tenant_id = #{tenantId,jdbcType=VARCHAR}
      </if>
      <if test="adminLoginNo != null">
        AND admin_login_no = #{adminLoginNo,jdbcType=VARCHAR}
      </if>
      <if test="userId != null">
        AND user_id = #{userId,jdbcType=VARCHAR}
      </if>
      <if test="createdBy != null">
        AND created_by = #{createdBy,jdbcType=VARCHAR}
      </if>
      <if test="createdTime != null">
        AND created_time = #{createdTime,jdbcType=TIMESTAMP}
      </if>
      <if test="updatedBy != null">
        AND updated_by = #{updatedBy,jdbcType=VARCHAR}
      </if>
      <if test="updatedTime != null">
        AND updated_time = #{updatedTime,jdbcType=TIMESTAMP}
      </if>
    </trim>
  </select>
</mapper>