<?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.mcwl.communityCenter.mapper.InviteMapper">

    <select id="selectInviteIds" resultType="java.lang.Long">
        select invitee_user_id
        from cc_invite
        where tenant_id = #{tenantId}
          and community_id = #{communityId}
          and del_flag = '0'
    </select>
    <select id="isInvite" resultType="com.mcwl.communityCenter.domain.Invite">
        select id, tenant_id, community_id, invitee_user_id, type, fee_type, create_by, create_time, update_by, update_time, del_flag, remark
        from cc_invite
        where tenant_id = #{tenantId}
          and community_id = #{communityId}
          and invitee_user_id = #{userId}
          and del_flag = '0'
    </select>
    <select id="selectByTenantIdAndCommunityIdAndInviteeUserId"
            resultType="com.mcwl.communityCenter.domain.Invite">
        select id, tenant_id, community_id, invitee_user_id, type, fee_type, create_by, create_time, update_by, update_time, del_flag, remark
        from cc_invite
        where tenant_id = #{tenantId}
          and community_id = #{communityId}
          and invitee_user_id = #{inviteeUserId}
          and del_flag = '0'
    </select>
</mapper>