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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.diagbot.entity.QcModuleInfo">
        <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="name" property="name" />
        <result column="hospital_id" property="hospitalId" />
        <result column="mode_id" property="modeId" />
        <result column="remark" property="remark" />
    </resultMap>

    <select id="getById" resultType="com.diagbot.dto.GetModuleInfoOneDTO">
        select t1.*, t2.name mode_name from qc_module_info t1
        left join qc_mode t2 on t1.mode_id = t2.id and t2.is_deleted = 'N'
        where t1.is_deleted = 'N'
        and t1.id = #{moduleId}
    </select>
</mapper>
