<?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.ruoyi.web.mapper.HdInfoMapper">
    
    <resultMap type="HdInfo" id="HdInfoResult">
        <result property="id"    column="id"    />
        <result property="hdrq"    column="hdrq"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <resultMap id="grzdResultMap" type="GrzdVO">
        <result property="ny" column="ny" />
        <result property="money" column="money" />
        <result property="czzt" column="czzt" />
        <result property="jezt" column="jezt" />
        <result property="zfzt" column="zfzt" />
    </resultMap>

    <sql id="Base_Column_List">
        id,
        hdrq,
        create_by,
        create_time,
        update_by,
        update_time
    </sql>

    <select id="hdUser" resultType="HdUserDTO">
        select hq.user_id,nick_name from hd_qd hq
        left join ry.sys_user su on hq.user_id = su.user_id
        <where>
            and fid = #{id}
        </where>
        order by qdsj
    </select>

    <select id="hdWqd" resultType="HdWqdDTO">
        select user_id,nick_name from ry.sys_user where user_id not in (1,2) and user_id not in (select user_id from hd_qd where fid = #{id})
    </select>

</mapper>