AllocationMapper.xml 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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="shareLevelId" column="share_level_id"/>
  27. <result property="targetShareLevelId" column="target_share_level_id"/>
  28. <result property="createTime" column="create_time"/>
  29. <result property="deleteTime" column="delete_time"/>
  30. </resultMap>
  31. <select id="queryAfterAllocationList" resultType="com.imed.costaccount.model.vo.AfterAllocationVO">
  32. select * from cost_allocation_query where delete_time = 0 and hosp_id = #{hospId}
  33. <if test="dateYear != null">
  34. and date_year = #{dateYear} and date_month = #{dateMonth}
  35. </if>
  36. <if test="responsibilityCode != null and responsibilityCode != ''">
  37. and responsibility_code = #{responsibilityCode}
  38. </if>
  39. limit #{startIndex},#{pageSize}
  40. </select>
  41. <select id="queryAfterAllocationListCount" resultType="java.lang.Integer">
  42. select count(*) from cost_allocation_query where delete_time = 0 and hosp_id = #{hospId}
  43. <if test="dateYear != null">
  44. and date_year = #{dateYear} and date_month = #{dateMonth}
  45. </if>
  46. <if test="responsibilityCode != null and responsibilityCode != ''">
  47. and responsibility_code = #{responsibilityCode}
  48. </if>
  49. </select>
  50. <select id="queryAfterAllocationListSum" resultType="java.math.BigDecimal">
  51. select sum(amount) from cost_allocation_query where delete_time = 0 and hosp_id = #{hospId}
  52. <if test="dateYear != null">
  53. and date_year = #{dateYear} and date_month = #{dateMonth}
  54. </if>
  55. <if test="responsibilityCode != null and responsibilityCode != ''">
  56. and responsibility_code = #{responsibilityCode}
  57. </if>
  58. </select>
  59. <select id="getAllSortLevel" resultType="com.imed.costaccount.model.Allocation">
  60. select distinct date_year,
  61. date_month,
  62. level_sort,
  63. share_param_code,
  64. share_param_name,
  65. create_time,
  66. id,
  67. share_level_id
  68. from cost_allocation
  69. where date_year = #{year}
  70. and date_month = #{month}
  71. and hosp_id = #{hospId}
  72. group by share_level_id
  73. </select>
  74. </mapper>