<?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.hxhq.business.mapper.MjyFfjlMapper">
    <select id="queryList" resultType="com.hxhq.business.dto.mjy.FfjlListDto">
        select t.id,t.mc,t.bh,t.ffzytj,t.ffrq,t.ghrq,t.ckl,t.ckldw,t.rkl,t.rkldw,t.ckmz,t.ckmzdw,t.lqr1_mc,t.lqr2_mc,t.ffr1_mc,t.ffr2_mc,t.jsr1_mc,t.jsr2_mc,t.rkmz,t.rkmzdw
        ,t.syl,t.syldw,t.jlzt,t.jyzt,t.md_other,t.jyksrq,t.jyjsrq,t.gdsqr_id
        ,z.mc as zcgMc,
        (select GROUP_CONCAT(s.name) from t_study s where find_in_set(s.id, t.`md_ids`)) as mdMcs
        FROM `t_mjy_ffjl` t
        left join  `t_zcg` z on z.id=t.zcg_id
        <if test="ew.sqlSegment != '' and ew.sqlSegment != null">
            <where>
                ${ew.sqlSegment}
            </where>
        </if>
    </select>

    <select id="queryInfo" resultType="com.hxhq.business.dto.mjy.FfjlDetailDto">
        select t.*,
        (select GROUP_CONCAT(s.name) from t_study s where find_in_set(s.id, t.`md_ids`)) as mdMcs
        FROM `t_mjy_ffjl` t
        where t.id=#{id}
    </select>
</mapper>