<?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.repair.mapper.RepairDispatchRecordMapper">
    <resultMap type="com.repair.model.vo.RepairCardNumberVo" id="repairCardNumberMap">
        <result property="userId" column="users_id"/>
        <result property="cardNumber" column="card_number"/>
    </resultMap>

    <select id="queryRepairCardNumber" resultType="com.repair.model.vo.RepairCardNumberVo" resultMap="repairCardNumberMap">
        SELECT ru.card_number,rdr.users_id FROM repair_dispatch_record rdr
        left join repair_user ru on ru.deleted = 0 and ru.id = rdr.users_id
        <where>
            and rdr.deleted = 0 and rdr.is_lose_efficacy = 0
            <if test="recordId != null and recordId != ''">
                and rdr.record_id = #{recordId}
            </if>
        </where>
    </select>


</mapper>
