AllocationMapper.xml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.imed.costaccount.mapper.AllocationMapper">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.imed.costaccount.model.Allocation" id="allocationMap">
  6. <result property="id" column="id"/>
  7. <result property="dateYear" column="date_year"/>
  8. <result property="dateMonth" column="date_month"/>
  9. <result property="levelSort" column="level_sort"/>
  10. <result property="levelName" column="level_name"/>
  11. <result property="hospId" column="hosp_id"/>
  12. <result property="responsibilityCode" column="responsibility_code"/>
  13. <result property="responsibilityName" column="responsibility_name"/>
  14. <result property="accountShareId" column="account_share_id"/>
  15. <result property="amount" column="amount"/>
  16. <result property="targetResponsibilityCode" column="target_responsibility_code"/>
  17. <result property="targetResponsibilityName" column="target_responsibility_name"/>
  18. <result property="shareParamCode" column="share_param_code"/>
  19. <result property="shareParamName" column="share_param_name"/>
  20. <result property="totalAmount" column="total_amount"/>
  21. <result property="shareParamValueNum" column="share_param_value_num"/>
  22. <result property="shareParamRate" column="share_param_rate"/>
  23. <result property="isBaseCost" column="is_base_cost"/>
  24. <result property="levelSort" column="level_sort" />
  25. <result property="levelName" column="level_name" />
  26. <result property="createTime" column="create_time"/>
  27. <result property="deleteTime" column="delete_time"/>
  28. </resultMap>
  29. <select id="queryAfterAllocationList" resultType="com.imed.costaccount.model.vo.AfterAllocationVO">
  30. select * from cost_allocation where delete_time = 0 and hosp_id = #{hospId}
  31. <if test="dateYear != null">
  32. and date_year = #{dateYear} and date_month = #{dateMonth}
  33. </if>
  34. <if test="responsibilityCode != null and responsibilityCode != ''">
  35. and responsibility_code = #{responsibilityCode}
  36. </if>
  37. limit #{startIndex},#{pageSize}
  38. </select>
  39. <select id="queryAfterAllocationListCount" resultType="java.lang.Integer">
  40. select count(*) from cost_allocation where delete_time = 0 and hosp_id = #{hospId}
  41. <if test="dateYear != null">
  42. and date_year = #{dateYear} and date_month = #{dateMonth}
  43. </if>
  44. <if test="responsibilityCode != null and responsibilityCode != ''">
  45. and responsibility_code = #{responsibilityCode}
  46. </if>
  47. </select>
  48. <select id="queryAfterAllocationListSum" resultType="java.math.BigDecimal">
  49. select sum(amount) from cost_allocation where delete_time = 0 and hosp_id = #{hospId}
  50. <if test="dateYear != null">
  51. and date_year = #{dateYear} and date_month = #{dateMonth}
  52. </if>
  53. <if test="responsibilityCode != null and responsibilityCode != ''">
  54. and responsibility_code = #{responsibilityCode}
  55. </if>
  56. </select>
  57. <select id="getAllSortLevel" resultType="com.imed.costaccount.model.Allocation">
  58. select distinct date_year,date_month,level_sort, share_param_code, share_param_name, create_time,id
  59. from cost_allocation
  60. where date_year = #{year}
  61. and date_month = #{month}
  62. and hosp_id = #{hospId}
  63. </select>
  64. </mapper>