<?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.qc.dbanaly.lt.mapper.ModuleInfoMapper">

    <select id="getAnameModidMap" parameterType="long" resultType="string">
        SELECT
        concat(IFNULL(c.map_type,''),'=',a.id)
        from qc_module_info a join med_module_mapping b on a.id=b.module_id
        join med_record_analyze c on b.record_id=c.id
        where a.hospital_id=#{hospitalId} and a.is_deleted='N'
        and b.hospital_id=#{hospitalId} and b.is_deleted='N'
        and c.hospital_id=#{hospitalId} and c.is_deleted='N'
        and c.map_type!='-1' and a.default_module=0
    </select>

</mapper>
