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

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.kcim.dao.model.CostCostingCollection" id="costCostingCollectionMap">
        <result property="id" column="id"/>
        <result property="year" column="year"/>
        <result property="month" column="month"/>
        <result property="responsibilityCode" column="responsibility_code"/>
        <result property="responsibilityName" column="responsibility_name"/>
        <result property="leverSort" column="lever_sort"/>
        <result property="shareLevelName" column="share_level_name"/>
        <result property="accountCode" column="account_code"/>
        <result property="accountName" column="account_name"/>
        <result property="isBaseCost" column="is_base_cost"/>
        <result property="amount" column="amount"/>
        <result property="createTime" column="create_time"/>
        <result property="deleteTime" column="delete_time"/>
        <result property="hospId" column="hosp_id"/>
        <result property="shareParamProportion" column="share_param_proportion" />
        <result property="shareParam" column="share_param" />
        <result property="shareValue" column="share_value" />
<!--        <result property="targetResponsibilityCode" column="target_responsibility_code" />-->
<!--        <result property="targetResponsibilityName" column="target_responsibility_name" />-->
        <result property="shareAmount" column="share_amount" />
    </resultMap>
    <select id="selectGroupBy" resultType="com.kcim.vo.CostDepartmentProfitVO">
        SELECT responsibility_code,responsibility_name, SUM(amount) as amount
        from cost_costing_collection  where hosp_id=#{hospId}
        GROUP BY responsibility_code
    </select>


</mapper>