<?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.eitc.patient.mapper.DiagnosisTypeCostProjectMapper">
    <select id="findList" resultType="com.eitc.patient.vo.DiagnosisTypeCostProjectInfoVO">
        select
            edtcp.id,
            edtcp.total,
            eccd.project_code as projectCode,
            eccd.project_name as projectName,
            eccd.unit_price as unitPrice,
            edtcp.diagnosis_type_id as diagnosisTypeId,
            eccd.unit
        from erm_diagnosis_type_cost_project edtcp
                 left join erm_collect_cost_details eccd on edtcp.collect_cost_details_id = eccd.id
        where edtcp.is_del = 0
          and edtcp.diagnosis_type_id = #{diagnosisTypeId}
        <if test="projectName != null and projectName != ''">
          and eccd.project_name like concat('%', #{projectName}, '%');
        </if>
    </select>
</mapper>
