<?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.HospitalInfoMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.diagbot.entity.HospitalInfo">
        <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="code" property="code" />
        <result column="name" property="name" />
        <result column="address" property="address" />
        <result column="spell" property="spell" />
        <result column="status" property="status" />
        <result column="order_no" property="orderNo" />
        <result column="remark" property="remark" />
    </resultMap>

    <select id="getHospitalInfos"  resultType="com.diagbot.dto.HospitalInfoDTO">
        select * from tran_hospital_info i where i.status = 1 and i.is_deleted = 'N'
        <if test="id != null and id != ''">
            and i.id = #{id}
        </if>
        <if test="code != null and code != ''">
            and i.code = #{code}
        </if>
    </select>
</mapper>
