<?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.TenantMemberMapper">



    <!-- 表字段 -->
    <sql id="baseColumns">
        t.id_ AS id
        , t.payer_name_ AS payerName
        , t.app_id_ AS appId
        , t.request_no_ AS requestNo
        , t.tenant_id_ AS tenantId
        , t.name_ AS name
        , t.member_id_ AS memberId
        , t.prov_code_ AS provCode
        , t.area_code_ AS areaCode
        , t.district_code_ AS districtCode
        , t.address_ AS address
        , t.social_credit_code_ AS socialCreditCode
        , t.social_credit_code_expires_ AS socialCreditCodeExpires
        , t.business_scope_ AS businessScope
        , t.legal_person_ AS legalPerson
        , t.legal_licence_type_ AS legalLicenceType
        , t.legal_cert_id_ AS legalCertId
        , t.legal_cert_id_expires_ AS legalCertIdExpires
        , t.legal_mp_ AS legalMp
        , t.zip_code_ AS zipCode
        , t.card_no_ AS cardNo
        , t.bank_code_ AS bankCode
        , t.settle_account_id_ AS settleAccountId
        , t.memo_ AS memo
        , t.status_ AS status
        , t.month_max_receipt_ AS monthMaxReceipt
        , t.bank_acct_type_ AS bankAcctType
        , t.card_name_ AS cardName
        , t.contact_email_ AS contactEmail
        , t.contact_licence_no_ AS contactLicenceNo
        , t.contact_name_ AS contactName
        , t.contact_mobile_ AS contactMobile
        , t.create_time_ AS createTime
        , t.update_time_ AS updateTime
    </sql>

    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantMemberWrapper$TenantMember">
        SELECT
        <include refid="baseColumns" />
        FROM tenant_member t
        <where>
            <if test="param.memberId != null and param.memberId != ''">
                and t.member_id_ like concat('%',#{param.memberId},'%')
            </if>
            <if test="param.name != null and param.name != ''">
                and t.name_ like concat('%',#{param.name},'%')
            </if>
            <if test="param.payerType != null">
                and t.payer_type_ = #{param.payerType}
            </if>
            <if test="param.status != null">
                and t.status_ = #{param.status}
            </if>
        </where>
    </select>

</mapper>