12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?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.backendsys.modules.upload.dao.SysFileDao">
- <sql id="includeFile">
- id,
- COALESCE(category_id, '') category_id,
- COALESCE(request_id, '') request_id,
- COALESCE(upload_id, '') upload_id,
- user_id,
- name,
- content_type,
- url,
- COALESCE(url_thumb, '') url_thumb,
- COALESCE(object_key, '') object_key,
- size,
- md5,
- target,
- create_time,
- update_time
- </sql>
- <!-- type="java.util.LinkedHashMap" -->
- <resultMap id="resultMapFileList" type="com.backendsys.modules.upload.entity.SysFile">
- <id property="id" column="id" jdbcType="BIGINT" />
- <result property="category_id" column="category_id" javaType="java.lang.Long" />
- <result property="request_id" column="request_id" />
- <result property="upload_id" column="upload_id" />
- <result property="user_id" column="user_id" javaType="java.lang.Long" />
- <result property="name" column="name" />
- <result property="content_type" column="content_type" />
- <result property="url" column="url" />
- <result property="url_thumb" column="url_thumb" />
- <result property="object_key" column="object_key" />
- <result property="size" column="size" javaType="java.lang.Long" />
- <result property="md5" column="md5" />
- <result property="target" column="target" javaType="java.lang.Integer" />
- <result property="create_time" column="create_time" />
- <result property="update_time" column="update_time" />
- </resultMap>
- <select id="selectUploadFileList" resultMap="resultMapFileList">
- SELECT <include refid="includeFile" /> FROM sys_file
- <where>
- <if test="name != null and name != ''">
- AND name LIKE CONCAT('%', #{name}, '%')
- </if>
- <if test="category_id != null and category_id != ''">
- AND category_id = #{category_id}
- </if>
- <if test="user_id != null and user_id != ''">
- AND user_id = #{user_id}
- </if>
- <if test="object_key != null and object_key != ''">
- AND object_key = #{object_key}
- </if>
- <if test="target != null and target != ''">
- AND target = #{target}
- </if>
- </where>
- ORDER BY create_time DESC
- </select>
- </mapper>
|