<?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.kcim.dao.mapper.ReportFormMapper">

    <!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.kcim.dao.model.ReportForm" id="costReportFormMap">
        <result property="id" column="id"/>
        <result property="num" column="num"/>
        <result property="reportName" column="report_name"/>
        <result property="parentId" column="parent_id"/>
        <result property="calcType" column="calc_type"/>
        <result property="reportType" column="report_type"/>
        <result property="calcFormula" column="calc_formula"/>
        <result property="sort" column="sort"/>
        <result property="ratioBase" column="ratio_base"/>
        <result property="hospId" column="hosp_id"/>
        <result property="oldId" column="old_id"/>
        <result property="isLoss" column="is_loss"/>
        <result property="costType" column="cost_type"/>
        <result property="fraction" column="fraction"/>
        <result property="createTime" column="create_time"/>
        <result property="deleteTime" column="delete_time"/>
        <result property="description" column="description"/>
    </resultMap>
    <select id="getByReportId" resultType="com.kcim.dao.model.ReportForm">
        select id,
               num,
               report_name,
               parent_id,
               calc_type,
               report_type,
               calc_formula,
               sort,
               ratio_base,
               hosp_id,
               old_id,
               is_loss,
               cost_type,
               fraction,
               create_time,
               delete_time,
               description
        from cost_report_form
        where hosp_id = #{hospId}
          and report_type = #{reportType}
              and id = #{reportId}


    </select>
    <select id="getByReportType" resultType="com.kcim.dao.model.ReportForm">
        select id,
               num,
               report_name,
               parent_id,
               calc_type,
               report_type,
               calc_formula,
               sort,
               ratio_base,
               hosp_id,
               old_id,
               is_loss,
               cost_type,
               fraction,
               create_time,
               delete_time,
               description,
               hide,
               data_type,
               decimal_place,
               permil
        from cost_report_form
        where hosp_id = #{hospId}
          and report_type = #{reportType}
    </select>


</mapper>