<?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.diagbot.mapper.DiseaseIcdMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.diagbot.entity.DiseaseIcd">
        <id column="id" property="id" />
        <result column="is_deleted" property="isDeleted" />
        <result column="gmt_create" property="gmtCreate" />
        <result column="gmt_modified" property="gmtModified" />
        <result column="creator" property="creator" />
        <result column="modifier" property="modifier" />
        <result column="hospital_code" property="hospitalCode" />
        <result column="disease_name" property="diseaseName" />
        <result column="icd" property="icd" />
        <result column="status" property="status" />
        <result column="remark" property="remark" />
        <result column="icss_question_name" property="icssQuestionName" />
    </resultMap>

    <select id="getDiseaseIcds" resultMap="BaseResultMap" parameterType="java.util.Map">
        select * from tran_disease_icd t where
        FIND_IN_SET(#{hospitalCode},hospital_code)
        and
        icss_question_name in
        <foreach item="item" collection="questions" open="(" separator="," close=")">
            #{item}
        </foreach>
        and status = '1'
        and is_deleted = 'N'
    </select>
</mapper>
