<?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="org.springblade.business.mapper.MileagexyMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="mileagexyResultMap" type="org.springblade.business.entity.Mileagexy">
        <result column="id" property="id"/>
        <result column="createUser" property="create_user"/>
        <result column="createDept" property="create_dept"/>
        <result column="createTime" property="create_time"/>
        <result column="updateUser" property="update_user"/>
        <result column="updateTime" property="update_time"/>
        <result column="status" property="status"/>
        <result column="isDeleted" property="is_deleted"/>
        <result column="tenantId" property="tenant_id"/>
        <result column="projectId" property="project_id"/>
        <result column="notes" property="notes"/>
        <result column="code" property="code"/>
        <result column="value" property="value"/>
        <result column="x" property="x"/>
        <result column="y" property="y"/>
        <result column="r" property="r"/>
        <result column="r2" property="r2"/>
        <result column="swing" property="swing"/>
        <result column="l" property="l"/>
        <result column="valueEnd" property="value_end"/>
        <result column="orderNum" property="order_num"/>
        <result column="type" property="type"/>
        <result column="angle" property="angle"/>
        <result column="du" property="du"/>
        <result column="fen" property="fen"/>
        <result column="miao" property="miao"/>
        <result column="dlq" property="dlq"/>
        <result column="dlh" property="dlh"/>
        <result column="ids" property="ids"/>
        <result column="partNo" property="part_no"/>
        <result column="partId" property="part_id"/>
        <result column="contractId" property="contract_id"/>
    </resultMap>

    <select id="getLast" resultMap="mileagexyResultMap">
        select * from t_om_mileagexy  where part_id = #{partId}   and project_id =#{projectId}
        <if test="orderNum!=null and orderNum != ''">
            and order_num = #{orderNum}
        </if>
        order by order_num DESC
    </select>

</mapper>
