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

    <resultMap id="rxwtglMap" type="com.tofly.xrtygis.entity.Rxwtgl">
        <id property="id" column="ID"/>
        <result property="wtbh" column="WTBH"/>
        <result property="wtms" column="WTMS"/>
        <result property="fileid" column="FILEID"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="createDate" column="CREATE_DATE"/>
        <result property="shbz" column="SHBZ"/>
        <result property="shry" column="SHRY"/>
        <result property="sfrk" column="SFRK"/>
        <result property="btmc" column="BTMC"/>
        <result property="shsj" column="SHSJ"/>
        <result property="hfry" column="HFRY"/>
        <result property="hfnr" column="HFNR"/>
        <result property="hfsj" column="HFSJ"/>
        <result property="sfhf" column="SFHF"/>
        <association property="hfryName" column="HFRY"
                     select="com.tofly.xrtygis.mapper.IFileMapper.getUserName"/>
        <association property="shbzName" column="SHBZ" select="getshbzName"/>
        <association property="sfrkName" column="SFRK" select="getShRkName"/>
        <association property="shRyName" column="SHRY"
                     select="com.tofly.xrtygis.mapper.IFileMapper.getUserName"/>
        <association property="createUserName" column="CREATE_USER"
                     select="com.tofly.xrtygis.mapper.IFileMapper.getUserName"/>
        <collection property="filePath" column="FILEID" select="com.tofly.xrtygis.mapper.RxjbglMapper.getFileByIds"/>
    </resultMap>

    <select id="getshbzName" resultType="string">
        select decode(#{shbz}, '0', '待审核', '1', '审核通过', '2', '审核不通过')
        from dual
    </select>

    <select id="getShRkName" resultType="string">
        select decode(#{sfrk}, '0', '未入知识库', '1', '已进入知识库')
        from dual
    </select>
</mapper>
