KlConceptStaticMapper.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.diagbot.mapper.KlConceptStaticMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.diagbot.entity.KlConceptStatic">
  6. <id column="id" property="id" />
  7. <result column="is_deleted" property="isDeleted" />
  8. <result column="gmt_create" property="gmtCreate" />
  9. <result column="gmt_modified" property="gmtModified" />
  10. <result column="creator" property="creator" />
  11. <result column="modifier" property="modifier" />
  12. <result column="concept_id" property="conceptId" />
  13. <result column="status" property="status" />
  14. <result column="clinical_pathway_name" property="clinicalPathwayName" />
  15. <result column="notice_name" property="noticeName" />
  16. </resultMap>
  17. <select id="getStaticInfo" resultType="com.diagbot.entity.KlConceptStatic">
  18. SELECT
  19. b.*
  20. FROM
  21. kl_concept a,
  22. kl_concept_static b,
  23. kl_lexicon c
  24. WHERE
  25. a.is_deleted = 'N'
  26. AND b.is_deleted = 'N'
  27. AND c.is_deleted = 'N'
  28. AND a.id = b.concept_id
  29. AND a.lib_type = c.CODE
  30. <if test="status!=null and status!=''">
  31. AND b.`status` = #{status}
  32. </if>
  33. <if test="name!=null and name!=''">
  34. AND a.lib_name = #{name}
  35. </if>
  36. <if test="typeName!=null and typeName!=''">
  37. AND c.NAME = #{typeName}
  38. </if>
  39. </select>
  40. <!-- 分页查询 -->
  41. <select id="getPage" resultType="com.diagbot.dto.KlConceptStaticDTO">
  42. SELECT
  43. t1.id,
  44. t1.NAME,
  45. t1.clinicalPathwayName,
  46. t1.noticeName,
  47. t1.type,
  48. t1.status,
  49. t1.title,
  50. t1.gmtModified,
  51. t1.modifier
  52. FROM
  53. (
  54. SELECT
  55. a.id,
  56. a.lib_name as NAME ,
  57. b.clinical_pathway_name AS clinicalPathwayName,
  58. b.notice_name AS noticeName,
  59. a.lib_type as type,
  60. b.status,
  61. GROUP_CONCAT( c.title order by c.order_no asc SEPARATOR '、' ) AS title,
  62. b.gmt_modified AS gmtModified,
  63. b.modifier
  64. FROM
  65. kl_concept a,
  66. kl_concept_static b,
  67. kl_concept_detail c
  68. WHERE
  69. a.id = b.concept_id
  70. and a.id = c.concept_id
  71. and a.is_deleted = 'N'
  72. and b.is_deleted = 'N'
  73. and c.is_deleted = 'N'
  74. <if test="klConceptStaticPageVO.status!=null ">
  75. AND b.status = #{klConceptStaticPageVO.status}
  76. </if>
  77. <if test="klConceptStaticPageVO.name!=null and klConceptStaticPageVO.name!=''">
  78. AND a.lib_name like concat('%', #{klConceptStaticPageVO.name},'%')
  79. </if>
  80. <if test="klConceptStaticPageVO.type!=null and klConceptStaticPageVO.type!=''">
  81. AND a.lib_type = #{klConceptStaticPageVO.type}
  82. </if>
  83. GROUP BY
  84. a.id
  85. ) t1
  86. ORDER BY
  87. t1.status DESC,
  88. t1.gmtModified DESC
  89. </select>
  90. </mapper>