1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?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.imed.costaccount.mapper.AllocationMapper">
- <!-- 可根据自己的需求,是否要使用 -->
- <resultMap type="com.imed.costaccount.model.Allocation" id="allocationMap">
- <result property="id" column="id"/>
- <result property="dateYear" column="date_year"/>
- <result property="dateMonth" column="date_month"/>
- <result property="levelSort" column="level_sort"/>
- <result property="levelName" column="level_name"/>
- <result property="hospId" column="hosp_id"/>
- <result property="responsibilityCode" column="responsibility_code"/>
- <result property="responsibilityName" column="responsibility_name"/>
- <result property="accountShareId" column="account_share_id"/>
- <result property="amount" column="amount"/>
- <result property="targetResponsibilityCode" column="target_responsibility_code"/>
- <result property="targetResponsibilityName" column="target_responsibility_name"/>
- <result property="shareParamCode" column="share_param_code"/>
- <result property="shareParamName" column="share_param_name"/>
- <result property="totalAmount" column="total_amount"/>
- <result property="shareParamValueNum" column="share_param_value_num"/>
- <result property="shareParamRate" column="share_param_rate"/>
- <result property="isBaseCost" column="is_base_cost"/>
- <result property="createTime" column="create_time"/>
- <result property="deleteTime" column="delete_time"/>
- </resultMap>
- <select id="queryAfterAllocationList" resultType="com.imed.costaccount.model.vo.AfterAllocationVO">
- select * from cost_allocation where delete_time = 0 and hosp_id = #{hospId}
- <if test="dateYear != null">
- and date_year = #{dateYear} and date_month = #{dateMonth}
- </if>
- <if test="responsibilityCode != null and responsibilityCode != ''">
- and responsibility_code = #{responsibilityCode}
- </if>
- limit #{startIndex},#{pageSize}
- </select>
- <select id="queryAfterAllocationListCount" resultType="java.lang.Integer">
- select count(*) from cost_allocation where delete_time = 0 and hosp_id = #{hospId}
- <if test="dateYear != null">
- and date_year = #{dateYear} and date_month = #{dateMonth}
- </if>
- <if test="responsibilityCode != null and responsibilityCode != ''">
- and responsibility_code = #{responsibilityCode}
- </if>
- </select>
- <select id="queryAfterAllocationListSum" resultType="java.math.BigDecimal">
- select sum(amount) from cost_allocation where delete_time = 0 and hosp_id = #{hospId}
- <if test="dateYear != null">
- and date_year = #{dateYear} and date_month = #{dateMonth}
- </if>
- <if test="responsibilityCode != null and responsibilityCode != ''">
- and responsibility_code = #{responsibilityCode}
- </if>
- </select>
- <select id="getAllSortLevel" resultType="com.imed.costaccount.model.Allocation">
- select distinct date_year,date_month,level_sort, share_param_code, share_param_name, create_time
- from cost_allocation
- where date_year = #{year}
- and date_month = #{month}
- and hosp_id = #{hospId}
- </select>
- </mapper>
|