<?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.RepairTrackRecordMapper">
    <resultMap type="com.repair.model.vo.TrackDetailsVo" id="detailDatasMap">
        <result property="id" column="id"/>
        <result property="maintenanceState" column="maintenance_state"/>
        <result property="state" column="state"/>
        <result property="createTime" column="create_time"/>
    </resultMap>
    <select id="queryDetailData" resultType="com.repair.model.vo.TrackDetailsVo" resultMap="detailDatasMap">
        select id,maintenance_state,content as state,create_time from repair_track_record
        where deleted = 0
        <if test="recordId != null and recordId != ''">
            and record_id = #{recordId}
        </if>
        order by create_time asc
    </select>

</mapper>
