DgFileMapper.xml 2.05 KB
<?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.pashanhoo.file.mapper.DgFileMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.pashanhoo.file.entity.DgFileDO">
        <id column="BSM_FILE" property="bsmFile"/>
        <result column="BSM_CATALOG" property="bsmCatalog"/>
        <result column="KZM" property="kzm"/>
        <result column="SCRQ" property="scrq"/>
        <result column="SCR" property="scr"/>
        <result column="FJURL" property="fjurl"/>
        <result column="FJSIZE" property="fjsize"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        BSM_FILE,
        BSM_CATALOG,
        KZM,
        SCRQ,
        SCR,
        FJURL,
        FJSIZE
    </sql>

    <resultMap id="result" type="com.pashanhoo.file.entity.vo.DgCatalogWithFileVO">
        <result column="bsm_catalog" property="bsmCatalog"/>
        <result column="wjmc" property="wjmc"/>
        <result column="xh" property="xh"/>
        <collection property="fileLists" ofType="com.pashanhoo.file.entity.vo.DgFileListVO">
            <result column="bsm_file" property="bsmFile"/>
            <result column="bsm_catalog" property="bsmCatalog"/>
            <result column="kzm" property="kzm"/>
            <result column="scrq" property="scrq"/>
            <result column="scr" property="scr"/>
            <result column="fjurl" property="fjurl"/>
            <result column="fjsize" property="fjsize"/>
        </collection>
    </resultMap>

    <select id="getFileList" resultType="com.pashanhoo.file.entity.vo.DgFileListVO">
        select DF.*, DAC.XH, DAC.WJMC,DAC.BSM_CATALOG
        from DG_FILE DF
        join DG_ARCHIVES_CATALOG DAC on DAC.BSM_CATALOG = DF.BSM_CATALOG
        <where>
            <if test="bsmArchive != null and bsmArchive != ''">
                BSM_ARCHIVES = #{bsmArchive,jdbcType=VARCHAR}
            </if>
        </where>
        order by DAC.XH
    </select>
</mapper>