123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?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.AllocationQueryMapper">
- <!-- 可根据自己的需求,是否要使用 -->
- <resultMap type="com.imed.costaccount.model.AllocationQuery" id="allocationQueryMap">
- <result property="id" column="id"/>
- <result property="dateYear" column="date_year"/>
- <result property="dateMonth" column="date_month"/>
- <result property="hospId" column="hosp_id"/>
- <result property="responsibilityCode" column="responsibility_code"/>
- <result property="responsibilityName" column="responsibility_name"/>
- <result property="originId" column="origin_id"/>
- <result property="originType" column="origin_type"/>
- <result property="amount" column="amount"/>
- <result property="accountingCode" column="accounting_code"/>
- <result property="accountingName" column="accounting_name"/>
- <result property="createTime" column="create_time"/>
- <result property="deleteTime" column="delete_time"/>
- </resultMap>
- <select id="getTotalMoney" resultType="java.math.BigDecimal">
- select sum(amount)
- from cost_allocation_query
- where date_year = #{dateYear}
- and date_month = #{month}
- and hosp_id = #{hospId}
- </select>
- <select id="getRespCodeAndName" resultType="com.imed.costaccount.model.vo.CodeAndNameVO">
- select responsibility_code as code, responsibility_name as name
- from cost_allocation_query
- where date_year = #{dateYear}
- and date_month = #{month}
- and hosp_id = #{hospId}
- </select>
- <select id="getAccountCodeAndName" resultType="com.imed.costaccount.model.vo.CodeAndNameVO">
- select accounting_code as code, accounting_name as name
- from cost_allocation_query
- where date_year = #{dateYear}
- and date_month = #{month}
- and hosp_id = #{hospId}
- </select>
- <select id="getCountByRespAndAccounts" resultType="java.math.BigDecimal">
- select IFNULL(sum(amount), 0)
- from cost_allocation_query
- where date_year = #{dateYear}
- and date_month = #{month}
- and hosp_id = #{hospId}
- and responsibility_code = #{code}
- and accounting_code in
- <foreach collection="accountCodes" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- <select id="getTotalByAccountAndResps" resultType="java.math.BigDecimal">
- select IFNULL(sum(amount), 0)
- from cost_allocation_query
- where date_year = #{dateYear}
- and date_month = #{month}
- and hosp_id = #{hospId}
- and accounting_code = #{code}
- and responsibility_code in
- <foreach collection="respCodes" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- <select id="getTotalByAccountAndRespCode" resultType="java.math.BigDecimal">
- select IFNULL(sum(amount), 0)
- from cost_allocation_query
- where date_year = #{dateYear}
- and date_month = #{month}
- and hosp_id = #{hospId}
- and accounting_code = #{accountCode}
- and responsibility_code = #{responsibilityCode}
- </select>
- </mapper>
|