TranLisConfigMapper.xml 1.8 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.diagbot.mapper.TranLisConfigMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.diagbot.entity.TranLisConfig">
  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="hospital_code" property="hospitalCode" />
  13. <result column="meal_name" property="mealName" />
  14. <result column="item_name" property="itemName" />
  15. <result column="unique_id" property="uniqueId" />
  16. <result column="unique_name" property="uniqueName" />
  17. </resultMap>
  18. <select id="getLisConfigByhospitalIds" resultType="com.diagbot.dto.LisConfigDTO">
  19. SELECT CONCAT(IFNULL(meal_name,""),"--",IFNULL(item_name,"")) AS
  20. assembly ,a.*
  21. FROM tran_lis_config a WHERE a.is_deleted = 'N'
  22. <if test="hospitalCode!=null">
  23. AND hospital_code = #{hospitalCode}
  24. </if>
  25. <if test="assemblys!=null">
  26. AND CONCAT(IFNULL(meal_name,""),"--",IFNULL(item_name,"")) IN
  27. <foreach collection="assemblys" item="assemblys" open="(" close=")" separator=",">
  28. #{assemblys}
  29. </foreach>
  30. </if>
  31. </select>
  32. <select id="getLisConfigByNamesAndHosCode" resultType="com.diagbot.dto.LisConfigDTO">
  33. SELECT *
  34. FROM tran_lis_config a WHERE a.is_deleted = 'N'
  35. <if test="hosCode!=null">
  36. AND hospital_code = #{hosCode}
  37. </if>
  38. <if test="mealName!=null">
  39. AND meal_name = #{mealName}
  40. </if>
  41. <if test="itemName!=null">
  42. AND item_name = #{itemName}
  43. </if>
  44. </select>
  45. </mapper>