MaterialFolderMapper.xml 2.41 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.bs.reception.mapper.MaterialFolderMapper">

    <resultMap id="MaterialFolderResult" type="com.bs.reception.entity.materials.MaterialFolder">
        <result property="id" column="id" jdbcType="BIGINT"/>
        <result property="folderName" column="folder_name" jdbcType="VARCHAR"/>
        <result property="folderCode" column="folder_code" jdbcType="VARCHAR"/>
        <result property="typeCode" column="type_code" jdbcType="VARCHAR"/>
        <result property="sortOrder" column="sort_order" jdbcType="INTEGER"/>
        <result property="status" column="status" jdbcType="INTEGER"/>
        <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
        <result property="createById" column="create_by_id" jdbcType="BIGINT"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
        <result property="updateById" column="update_by_id" jdbcType="BIGINT"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
        <result property="remark" column="remark" jdbcType="VARCHAR"/>
        <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
    </resultMap>

    <sql id="selectMaterialFolder">
        select id,
               folder_name,
               folder_code,
               type_code,
               sort_order,
               status,
               create_by,
               create_by_id,
               create_time,
               update_by,
               update_by_id,
               update_time,
               remark,
               del_flag
        from material_folder
    </sql>

    <resultMap id="MaterialFolderTreeResult" type="com.bs.reception.model.materials.MaterialFolderNodeVO">
        <result property="id" column="id"/>
        <result property="folderName" column="folder_name"/>
        <result property="typeCode" column="type_code"/>
        <result property="sortOrder" column="sort_order"/>
    </resultMap>

    <select id="selectFolderTree" resultMap="MaterialFolderTreeResult">
        SELECT
            id,
            folder_name,
            type_code,
            sort_order
        FROM material_folder
        WHERE del_flag = 0
        ORDER BY sort_order
    </select>

</mapper>