<?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.casic.missiles.mapper.equipment.EquipmentApplyEquipmentMapper">
    <select id="queryEquipmentList" resultType="com.casic.missiles.model.equipment.EquipmentFixedAssets">
        SELECT
            mfa.id,
            msae.id as apply_relation_id,
            mfa.equipment_no,
            mfa.equipment_name,
            mfa.model_no,
            mfa.mesure_range,
            mfa.use_dept,
            mfa.use_person,
            sd.SIMPLE_NAME as use_dept_name,
            su.`NAME` as use_person_name,
            mfa.manager_state,
            mfa.valid_date
        FROM
            equipment_apply_equipment msae
                LEFT JOIN equipment_fixed_assets mfa on msae.equipment_id = mfa.id
                LEFT JOIN sys_user su ON su.id = mfa.use_person
                LEFT JOIN sys_dept sd ON sd.id = mfa.use_dept
        where msae.is_del = 0
        and msae.apply_id = #{id}
    </select>

    <select id="queryCheckList" resultType="com.casic.missiles.model.equipment.EquipmentApplyEquipment">
        SELECT
            msae.*,
            mfa.equipment_no,
            mfa.equipment_name
        FROM
            equipment_apply_equipment msae
                LEFT JOIN equipment_fixed_assets mfa on msae.equipment_id = mfa.id
        where msae.is_del = 0
        and msae.apply_id = #{acceptanceCheckId}
    </select>


</mapper>
