<?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.tofly.xrtygis.mapper.RxjbglMapper">

    <resultMap id="rxjbglMap" type="com.tofly.xrtygis.entity.Rxjbgl">
        <id property="id" column="ID"/>
        <result property="jbbh" column="JBBH"/>
        <result property="fileid" column="FILEID"/>
        <result property="jbnr" column="JBNR"/>
        <result property="jjry" column="JJRY"/>
        <result property="jbsj" column="JBSJ"/>
        <result property="jbry" column="JBRY"/>
        <result property="jbms" column="JBMS"/>
        <result property="jjzt" column="JJZT"/>
        <result property="jbgd" column="JBGD"/>
        <result property="jbtxqk" column="JBTXQK"/>
        <result property="jbzysx" column="JBZYSX"/>
        <result property="jbbghj" column="JBBGHJ"/>
        <result property="bz" column="BZ"/>
        <result property="ismaneger" column="ISMANEGER"/>
        <association property="jjztName" column="JJZT"
                     select="com.tofly.xrtygis.mapper.RxjbglMapper.getZtName"></association>
        <association property="jjryName" column="JJRY"
                     select="com.tofly.baseapi.mapper.ToflyCodeCommonMapper.getUserName"/>
        <association property="jbryName" column="JBRY"
                     select="com.tofly.baseapi.mapper.ToflyCodeCommonMapper.getUserName"/>
<!--        <collection property="filePath" column="FILEID" select="com.tofly.xrtygis.mapper.RxjbglMapper.getFileByIds"/>-->
    </resultMap>
    <select id="getZtName" resultType="string">
        select decode(#{jjzt}, '0', '未交接', '1', '已交接', '2', '拒绝交接')
        from dual
    </select>
    <select id="getFileByIds" resultType="string">
        select FILE_PATH from TF_YWPN_FILE_W where ID in
        <if test="fileIds != null and fileIds != '' ">
            <foreach collection="fileIds.split(',')" item="id" open="(" separator="," close=")">
                #{id}
            </foreach>
        </if>
    </select>

</mapper>
