<?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.ShareParamCostMapper">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.kcim.dao.model.ShareParamCost" id="shareParamCostMap">
        <result property="id" column="id"/>
        <result property="hospId" column="hosp_id"/>
        <result property="columnCode" column="column_code"/>
        <result property="columnName" column="column_name"/>
        <result property="columnType" column="column_type"/>
        <result property="columnTypeName" column="column_type_name"/>
        <result property="profitId" column="profit_id"/>
        <result property="profitNum" column="profit_num"/>
        <result property="profitName" column="profit_name"/>
        <result property="profitPath" column="profit_path"/>
        <result property="createUser" column="create_user"/>
        <result property="createTime" column="create_time"/>
        <result property="updateUser" column="update_user"/>
        <result property="updateTime" column="update_time"/>
        <result property="deleteUser" column="delete_user"/>
        <result property="deleteTime" column="delete_time"/>
        <result property="delFlag" column="del_flag"/>
    </resultMap>
    <select id="getParamCost" resultType="com.kcim.vo.ShareParamCostVo">
        SELECT
            a.item_type,
            a.column_code,
            a.column_name,
            a.column_type,
            a.column_type_name,
            a.report_type,
            a.profit_id,
            a.profit_num,
            a.profit_name,
            b.share_param_code,
            b.share_param_name,
            b.percent
        FROM
            com_share_param_cost a
                LEFT JOIN com_share_param_cost_detail b ON a.column_code = b.share_param_column_code
                AND b.del_flag = 0
        WHERE
            a.hosp_id = #{hospId}
          AND b.hosp_id = #{hospId}
          AND a.del_flag = 0;
    </select>


</mapper>