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

    <!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.kcim.dao.model.CostShareLevel" id="costShareLevelMap">
        <result property="id" column="id"/>
        <result property="shareName" column="share_name"/>
        <result property="leverSort" column="lever_sort"/>
        <result property="hospId" column="hosp_id"/>
        <result property="targetLevel" column="target_level"/>
        <result property="calcType" column="calc_type"/>
        <result property="createTime" column="create_time"/>
        <result property="deleteTime" column="delete_time"/>
    </resultMap>
    <select id="getMaxIds" resultType="java.lang.Long">
        select id
        from cost_share_level
        where hosp_id = #{hospId}
          and lever_sort = (select max(lever_sort) from cost_share_level where hosp_id = #{hospId} and delete_time = 0)
          and delete_time = 0
    </select>


</mapper>