<?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.artfess.file.persistence.dao.CatalogDao">
	<resultMap id="Catalog" type="com.artfess.file.model.Catalog">
		<id property="id" column="id" jdbcType="VARCHAR"/>
		<result property="name" column="name" jdbcType="VARCHAR"/>
		<result property="parentId" column="parentId" jdbcType="VARCHAR"/>
		<result property="orderNo" column="orderNo" jdbcType="NUMERIC"/>
		<result property="createBy" column="create_by_" jdbcType="VARCHAR"/>
	</resultMap>

	<!-- <select id="getMaxorderNo"   parameterType="java.lang.String" resultMap="ArchivesClassification">
		SELECT * FROM portal_sys_file_classify
		WHERE
		prentId=#{prentId}
		ORDER BY orderNo DESC LIMIT 1
	</select> -->

	<select id="getCatalogBypParentId" resultMap="Catalog"  parameterType="java.lang.String">
		SELECT * FROM portal_sys_file_classify
		WHERE
		parentId=#{parentId}
	</select>

	<select id="getCatalogByCreateBy" resultMap="Catalog"  parameterType="java.lang.String">
		SELECT * FROM portal_sys_file_classify
		WHERE
		create_by_=#{userId}
	</select>
	
	<select id="getListByParentId" resultMap="Catalog"  parameterType="java.lang.String">
		SELECT * FROM portal_sys_file_classify
		WHERE
		parentId=#{parentId} AND name=#{name}
	</select>
</mapper>
