3467aaddcac7a7848ea1aa9b92646128a8479171.svn-base 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.synyi.edc.dao.ISqlbuilderDao" >
  4. <resultMap id="BaseResultMap" type="com.synyi.edc.pojo.Parameter" >
  5. <result column="org_code" property="orgCode" jdbcType="VARCHAR" />
  6. <result column="org_name" property="orgName" jdbcType="VARCHAR" />
  7. <result column="item_id" property="itemId" jdbcType="VARCHAR" />
  8. <result column="item_name" property="itemName" jdbcType="VARCHAR" />
  9. <result column="test_item_name" property="testItemName" jdbcType="VARCHAR" />
  10. <result column="text_value" property="textValue" jdbcType="VARCHAR" />
  11. <result column="numerical_value" property="numericalValue" jdbcType="VARCHAR" />
  12. <result column="reference_range" property="referenceRange" jdbcType="VARCHAR" />
  13. <result column="abnormal_flag_name" property="abnormalFlagName" jdbcType="VARCHAR" />
  14. <result column="drug_id" property="drugId" jdbcType="VARCHAR" />
  15. <result column="drug_name" property="drugName" jdbcType="VARCHAR" />
  16. </resultMap>
  17. <select id="getAllOrgInfo" resultMap="BaseResultMap" >
  18. select
  19. org_code,org_name from mdm.organization
  20. </select>
  21. <select id="getAllLabInfo" resultMap="BaseResultMap" parameterType="com.synyi.edc.pojo.Parameter">
  22. select item_id,item_name from mdm.lis_item where code_sys_id =197
  23. <if test="labName != null and labName != ''">
  24. and item_name like '%${labName}%'
  25. </if>
  26. </select>
  27. <select id="getSuggestionList" resultMap="BaseResultMap" parameterType="com.synyi.edc.pojo.Parameter">
  28. select distinct c.item_name,text_value,numerical_value,reference_range,abnormal_flag_name from
  29. lab.lab_report_result a join mdm.mdm_map b on a.test_item_id=b.source_id
  30. join mdm.lis_item c on b.map_id=c.item_id
  31. where b.md_type = 'lis_item' and c.code_sys_id =197
  32. <if test="itemId != null and itemId != ''">
  33. and c.item_id in (${itemId})
  34. </if>
  35. </select>
  36. <select id="getAllDrugInfo" resultMap="BaseResultMap" parameterType="com.synyi.edc.pojo.Parameter">
  37. select drug_id,case when regular_name is null then trade_name else regular_name end drug_name
  38. from mdm.drug t where t.code_sys_id = 51
  39. <if test="drugName != null and drugName != ''">
  40. and (regular_name like '%${drugName}%' or trade_name like '%${drugName}%')
  41. </if>
  42. </select>
  43. </mapper>