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

    <select id="getMatchingOperationPage" resultType="com.lantone.daqe.dto.GetMatchingOperationPageDTO">
        SELECT
            code,
            standard,
            synonym,
            CASE
            WHEN ISNULL(standard) THEN
            '0'
            ELSE
            '1'
            END AS isMapping
        FROM
        `hos_operation_info`
        WHERE
        1=1
        <if test="getMatchingOperationVO.hospitalId != null">
            hospital_id = #{getMatchingOperationVO.hospitalId}
        </if>
        <if test="getMatchingOperationVO.id != null">
            AND id = #{getMatchingOperationVO.id}
        </if>
        <if test="getMatchingOperationVO.name != null and getMatchingOperationVO.name != ''">
            AND `name` LIKE CONCAT('%',#{getMatchingOperationVO.name},'%')
        </if>
    </select>
</mapper>