IndexConfigMapper.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.IndexConfigMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.diagbot.entity.IndexConfig">
  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="index_unique" property="indexUnique" />
  13. <result column="disease_id" property="diseaseId" />
  14. <result column="index_desc" property="indexDesc" />
  15. <result column="order_no" property="orderNo" />
  16. <result column="remark" property="remark" />
  17. </resultMap>
  18. <select id="queryIndexConfigPageAlls" resultType="com.diagbot.dto.IndexConfigDTO">
  19. SELECT
  20. a.id as id,
  21. a.gmt_create as gmtCreate,
  22. a.gmt_modified as gmtModified,
  23. a.creator as creator,
  24. a.modifier as modifier,
  25. a.disease_id as diseaseId ,
  26. b.tag_name as diseaseName
  27. FROM
  28. icss_index_config a
  29. JOIN icss_question_info b
  30. WHERE a.disease_id = b.id
  31. AND a.is_deleted = "N"
  32. AND b.is_deleted = "N"
  33. <if test="indexConfigVO.diseaseName != null and indexConfigVO.diseaseName != ''">
  34. AND b.tag_name LIKE CONCAT('%', #{indexConfigVO.diseaseName}, '%')
  35. </if>
  36. GROUP BY a.disease_id
  37. ORDER BY a.gmt_create DESC
  38. </select>
  39. <select id="queryIndexConfigDiseaseName" resultType="com.diagbot.dto.DiseaseInfoDTO">
  40. SELECT DISTINCT
  41. a.dis_id AS diseaseId,
  42. b.tag_name AS diseaseName
  43. FROM
  44. icss_dis_type a
  45. JOIN icss_question_info b
  46. ON a.dis_id = b.id
  47. LEFT JOIN icss_index_config f ON a.dis_id = f.disease_id and f.is_deleted = 'N'
  48. WHERE a.type = 1
  49. AND f.disease_id is null
  50. AND a.is_deleted = "N"
  51. AND b.is_deleted = "N"
  52. <if test="diseaseNameVO.diseaseName != null and diseaseNameVO.diseaseName != ''">
  53. AND b.tag_name LIKE CONCAT('%', #{diseaseNameVO.diseaseName}, '%')
  54. </if>
  55. ORDER BY b.tag_name DESC
  56. </select>
  57. </mapper>