ResponsibilityDepartmentMapper.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.kcim.dao.mapper.ResponsibilityDepartmentMapper">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.kcim.dao.model.ResponsibilityDepartment" id="responsibilityDepartmentMap">
  6. <result property="id" column="id" jdbcType="INTEGER"/>
  7. <result property="responsibilityId" column="responsibility_id" jdbcType="INTEGER"/>
  8. <result property="departmentId" column="department_id" jdbcType="INTEGER"/>
  9. <result property="hospId" column="hosp_id" jdbcType="INTEGER"/>
  10. <result property="createTime" column="create_time" jdbcType="BIGINT"/>
  11. <result property="deleteTime" column="delete_time" jdbcType="BIGINT"/>
  12. </resultMap>
  13. <select id="getDepartByCenterId" resultType="com.kcim.vo.DepartVO">
  14. select sd.id as departmentId,concat(sd.department_name,sd.department_code) as departmentName
  15. from cost_responsibility_department crd left join sys_department sd on sd.id = crd.department_id
  16. where crd.responsibility_id = #{responsibilityId} and crd.delete_time = 0 and sd.delete_time = 0
  17. </select>
  18. <select id="getResponsibility" resultType="com.kcim.vo.ResponsibilityDepartIdVO">
  19. SELECT
  20. b.department_id,
  21. b.responsibility_id,
  22. a.responsibility_code,
  23. a.responsibility_name,
  24. a.share_level,
  25. a.share_id
  26. FROM
  27. cost_responsibility a
  28. INNER JOIN cost_responsibility_department b ON a.id = b.responsibility_id
  29. AND b.delete_time = 0
  30. AND b.hosp_id = #{hospId}
  31. WHERE
  32. a.hosp_id = #{hospId}
  33. AND a.delete_time = 0
  34. </select>
  35. </mapper>