ShareParamValueMapper.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.ShareParamValueMapper">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.imed.costaccount.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. <select id="getValues" resultType="com.imed.costaccount.model.dto.ShareParamValueVO">
  19. select cspv.*, csp.share_param_name, cr.responsibility_name
  20. from cost_share_param_value cspv
  21. left join cost_share_param csp
  22. on csp.share_param_code = cspv.share_param_code and csp.hosp_id = cspv.hosp_id
  23. left join cost_responsibility cr
  24. on cspv.responsibility_code = cr.responsibility_code and cspv.hosp_id = cr.hosp_id
  25. where cspv.hosp_id = #{hospId}
  26. and cspv.delete_time = 0
  27. and csp.delete_time = 0
  28. and cr.delete_time = 0
  29. and cspv.date_month = month(#{date})
  30. and cspv.date_year = year(#{date})
  31. <if test="shareParamCode != null and shareParamCode != ''">
  32. and cspv.share_param_code = #{shareParamCode}
  33. </if>
  34. <if test="responsibilityCode != null and responsibilityCode != ''">
  35. and cspv.responsibility_code = #{responsibilityCode}
  36. </if>
  37. limit #{current},#{pageSize}
  38. </select>
  39. <select id="getValuesCount" resultType="java.lang.Integer">
  40. select count(*)
  41. from cost_share_param_value cspv
  42. left join cost_share_param csp
  43. on csp.share_param_code = cspv.share_param_code and csp.hosp_id = cspv.hosp_id
  44. left join cost_responsibility cr
  45. on cspv.responsibility_code = cr.responsibility_code and cspv.hosp_id = cr.hosp_id
  46. where cspv.hosp_id = #{hospId}
  47. and cspv.delete_time = 0
  48. and csp.delete_time = 0
  49. and cr.delete_time = 0
  50. and cspv.date_month = month(#{date})
  51. and cspv.date_year = year(#{date})
  52. <if test="shareParamCode != null and shareParamCode != ''">
  53. and cspv.share_param_code = #{shareParamCode}
  54. </if>
  55. <if test="responsibilityCode != null and responsibilityCode != ''">
  56. and cspv.responsibility_code = #{responsibilityCode}
  57. </if>
  58. </select>
  59. </mapper>