ReportRelationMapper.xml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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.ReportRelationMapper">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.imed.costaccount.model.ReportRelation" id="reportRelationMap">
  6. <result property="id" column="id"/>
  7. <result property="reportId" column="report_id"/>
  8. <result property="relationCode" column="relation_code"/>
  9. <result property="hospId" column="hosp_id"/>
  10. <result property="relation" column="relation"/>
  11. <result property="createTime" column="create_time"/>
  12. <result property="deleteTime" column="delete_time"/>
  13. </resultMap>
  14. <select id="getAccountRelation" resultType="com.imed.costaccount.model.vo.RelationVO">
  15. select ca.accounting_code as code, ca.accounting_name as name, 1 as relation
  16. from cost_report_relation crr
  17. left join cost_accounting ca on crr.relation_code = ca.accounting_code
  18. where crr.delete_time = 0
  19. and ca.delete_time = 0
  20. and crr.hosp_id = #{hospId}
  21. and ca.hosp_id = #{hospId}
  22. and crr.report_id = #{reportId}
  23. </select>
  24. <select id="getShareParam" resultType="com.imed.costaccount.model.vo.RelationVO">
  25. select csl.id as code, csl.share_name as name, 2 as relation
  26. from cost_report_relation crr
  27. left join cost_share_level csl on crr.relation_code = csl.id
  28. where crr.delete_time = 0
  29. and csl.delete_time = 0
  30. and crr.hosp_id = #{hospId}
  31. and csl.hosp_id = #{hospId}
  32. and crr.report_id = #{reportId}
  33. and crr.relation = 2
  34. </select>
  35. </mapper>