2
0

AllocationMapper.xml 3.4 KB

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