<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.mipsdl.dao.thrsys.ThrSystemDetailDao">
  <resultMap id="BaseResultMap" type="com.glxp.mipsdl.entity.thrsys.ThrSystemDetailEntity">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="key" jdbcType="VARCHAR" property="key" />
    <result column="value" jdbcType="VARCHAR" property="value" />
    <result column="enabled" jdbcType="TINYINT" property="enabled" />
    <result column="guideUrl" jdbcType="VARCHAR" property="guideUrl" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="thirdSysFk" jdbcType="VARCHAR" property="thirdSysFk" />
    <result column="itrCache" jdbcType="TINYINT" property="itrCache" />
    <result column="fromType" jdbcType="INTEGER" property="fromType" />
  </resultMap>
  <sql id="Base_Column_List">
    id, `name`, `key`, `value`, enabled, guideUrl, remark, thirdSysFk, itrCache, fromType
  </sql>

  <select id="selectByKey" resultMap="BaseResultMap">
      select thr_system_detail.*
      from thr_system_detail
               inner join thr_system on thr_system_detail.thirdSysFk = thr_system.thirdId
      where thr_system_detail.thirdSysFk = #{hospCode}
        and thr_system_detail.`key` = #{key}
        and thr_system.enabled = 1
  </select>
</mapper>
