<?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.bonus.canteen.core.nutrition.mapper.HealthMedicalReportTmplMapper">
    <select id="listTemplate" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthMedicalReportTmplVO">
        SELECT
            medical_template_id,
            medical_template_name,
            remark
        FROM
            health_medical_report_template
    </select>

    <select id="listReportProject" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthMedicalReportProjectVO">
        SELECT medical_project_id,
               medical_project_name
        FROM health_medical_report_project
        WHERE medical_template_id = #{medicalTemplateId}
        ORDER BY
            medical_project_id
    </select>

    <select id="listReportDetail" resultType="com.bonus.canteen.core.nutrition.common.vo.HealthMedicalReportDetailVO">
        SELECT medical_project_id,
               medical_project_detail_id,
               medical_project_detail_name,
               medical_project_detail_unit,
               medical_project_detail_reference
        FROM health_medical_report_detail
        WHERE medical_project_id = #{medicalProjectId}
        ORDER BY
            medical_project_detail_id
    </select>

</mapper>
