<?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.community.huiju.dao.TaUserVerifyMapper">

    <select id="selectCommunityAndAddressAndVerifyStatus" resultType="com.community.huiju.model.TaUserVerify">
        select
        `id` as userVerifyId,
        `user_id`,
        `community_id`,
        `role_id`,
        `phase_id`,
        `phase_name`,
        `building_id`,
        `building_name`,
        `unit_id`,
        `unit_name`,
        `level_id`,
        `level_name`,
        `room_no_id`,
        `room_no_name`,
        `verify_status`,
        `create_date`,
        `verify_name`,
        `remark`
        from ta_user_verify
        where community_id = #{communityId,jdbcType=INTEGER}
        and user_id = #{userId,jdbcType=INTEGER}
        and phase_id = #{phaseId,jdbcType=INTEGER}
        and building_id = #{buildingId,jdbcType=INTEGER}
        and unit_id = #{unitId,jdbcType=INTEGER}
        and level_id = #{levelId,jdbcType=INTEGER}
        and room_no_id = #{roomNoId,jdbcType=INTEGER}
        <if test="verifyStatus != null and verifyStatus != ''">
            and verify_status = #{verifyStatus}
        </if>
    </select>


</mapper>
