<?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.dayou.mapper.UserArchiveMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.dayou.entity.UserArchive">
        <result column="id" property="id" />
        <result column="user_id" property="userId" />
        <result column="major_evaluator_registration_no" property="majorEvaluatorRegistrationNo" />
        <result column="land_evaluator_registration_no" property="landEvaluatorRegistrationNo" />
        <result column="asset_evaluator_registration_no" property="assetEvaluatorRegistrationNo" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,
        user_id, major_evaluator_registration_no, land_evaluator_registration_no, asset_evaluator_registration_no
    </sql>

    <select id="getRegistrationNoByUserId" parameterType="java.lang.Long" resultType="com.dayou.entity.UserArchive">
        select
                u.name as evaluatorName,
                ua.user_id,
               ua.major_evaluator_registration_no,
               ua.land_evaluator_registration_no,
               ua.asset_evaluator_registration_no
                from user_archive ua inner join user u on u.id = ua.user_id
            where u.deleted = 0 and ua.deleted = 0 and u.id = #{userId}
    </select>
</mapper>
