ShareParamValueMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.kcim.dao.mapper.ShareParamValueMapper">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.kcim.dao.model.ShareParamValue" id="shareParamValueMap">
  6. <result property="id" column="id"/>
  7. <result property="dateYear" column="date_year"/>
  8. <result property="dateMonth" column="date_month"/>
  9. <result property="shareParamCode" column="share_param_code"/>
  10. <result property="responsibilityCode" column="responsibility_code"/>
  11. <result property="valueNum" column="value_num"/>
  12. <result property="hospId" column="hosp_id"/>
  13. <result property="fileId" column="fileId"/>
  14. <result property="dataSourceType" column="data_source_type"/>
  15. <result property="createTime" column="create_time"/>
  16. <result property="deleteTime" column="delete_time"/>
  17. </resultMap>
  18. <update id="reducingHistory">
  19. update cost_share_param_value set delete_time = 0
  20. where file_id = #{id}
  21. and hosp_id = #{hospId}
  22. and id in
  23. <foreach close=")" collection="list" item="item" open="(" separator=",">
  24. #{item}
  25. </foreach>
  26. </update>
  27. <select id="getValues" resultType="com.kcim.dao.model.dto.ShareParamValueVO">
  28. select cspv.*, csp.share_param_name, cr.responsibility_name
  29. from cost_share_param_value cspv
  30. left join cost_share_param csp
  31. on csp.share_param_code = cspv.share_param_code and csp.hosp_id = cspv.hosp_id
  32. left join cost_responsibility cr
  33. on cspv.responsibility_code = cr.responsibility_code and cspv.hosp_id = cr.hosp_id
  34. where cspv.hosp_id = #{hospId}
  35. and cspv.delete_time = 0
  36. and csp.delete_time = 0
  37. and cr.delete_time = 0
  38. and cspv.date_month = month(#{date})
  39. and cspv.date_year = year(#{date})
  40. <if test="shareParamCode != null and shareParamCode != ''">
  41. and (cspv.share_param_code like concat('%',#{shareParamCode,jdbcType=VARCHAR},'%') or csp.share_param_name like concat('%',#{shareParamCode,jdbcType=VARCHAR},'%') )
  42. </if>
  43. <if test="responsibilityCode != null and responsibilityCode != ''">
  44. and cspv.responsibility_code = #{responsibilityCode}
  45. </if>
  46. limit #{current},#{pageSize}
  47. </select>
  48. <select id="getValuesCount" resultType="java.lang.Integer">
  49. select count(*)
  50. from cost_share_param_value cspv
  51. left join cost_share_param csp
  52. on csp.share_param_code = cspv.share_param_code and csp.hosp_id = cspv.hosp_id
  53. left join cost_responsibility cr
  54. on cspv.responsibility_code = cr.responsibility_code and cspv.hosp_id = cr.hosp_id
  55. where cspv.hosp_id = #{hospId}
  56. and cspv.delete_time = 0
  57. and csp.delete_time = 0
  58. and cr.delete_time = 0
  59. and cspv.date_month = month(#{date})
  60. and cspv.date_year = year(#{date})
  61. <if test="shareParamCode != null and shareParamCode != ''">
  62. and (cspv.share_param_code like concat('%',#{shareParamCode,jdbcType=VARCHAR},'%') or csp.share_param_name like concat('%',#{shareParamCode,jdbcType=VARCHAR},'%') )
  63. </if>
  64. <if test="responsibilityCode != null and responsibilityCode != ''">
  65. and cspv.responsibility_code = #{responsibilityCode}
  66. </if>
  67. </select>
  68. <select id="getListByYearAndMonth" resultType="com.kcim.dao.model.ShareParamValue">
  69. select cspv.*
  70. from cost_share_param_value cspv
  71. left join cost_share_param csp
  72. on csp.share_param_code = cspv.share_param_code and csp.hosp_id = cspv.hosp_id
  73. left join cost_responsibility cr
  74. on cspv.responsibility_code = cr.responsibility_code and cspv.hosp_id = cr.hosp_id
  75. where cspv.hosp_id = #{hospId}
  76. and cspv.delete_time = 0
  77. and csp.delete_time = 0
  78. and cr.delete_time = 0
  79. and cspv.date_month = #{month}
  80. and cspv.date_year = #{year}
  81. </select>
  82. <select id="selectHistoryList" resultType="com.kcim.dao.model.ShareParamValue">
  83. select *
  84. from cost_share_param_value
  85. where hosp_id = #{hospId}
  86. and delete_time != 0
  87. and file_id = #{id}
  88. </select>
  89. </mapper>