<?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.lantone.daqe.mapper.DrugInfoMapper">

    <select id="getMatchingDrugPage" resultType="com.lantone.daqe.dto.GetMatchingDrugPageDTO">
        SELECT
            standard,
            synonym
        FROM
        `hos_drug_info`
        WHERE
        1=1
        <if test="getMatchingDrugPageVO.hospitalId != null">
            hospital_id = #{getMatchingDrugPageVO.hospitalId}
        </if>
        <if test="getMatchingDrugPageVO.id != null">
            AND id = #{getMatchingDrugPageVO.id}
        </if>
        <if test="getMatchingDrugPageVO.name != null and getMatchingDrugPageVO.name != ''">
            AND `name` LIKE CONCAT('%',#{getMatchingDrugPageVO.name},'%')
        </if>

    </select>
</mapper>