xin
2025-06-25 ff40a2ab1e3dd296da98f16337c709f7fda71666
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?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.oying.mapper.BucketStorageMapper">
    <resultMap id="BaseResultMap" type="com.oying.domain.BucketStorage">
        <id column="bucket_id" property="bucketId"/>
        <result column="real_name" property="realName"/>
        <result column="name" property="name"/>
        <result column="suffix" property="suffix"/>
        <result column="path" property="path"/>
        <result column="type" property="type"/>
        <result column="size" property="size"/>
        <result column="create_by" property="createBy"/>
        <result column="create_time" property="createTime"/>
        <result column="update_by" property="updateBy"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        bucket_id, real_name, name, suffix, path, type, size, create_by, create_time, update_by, update_time
    </sql>
 
    <select id="findAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from tool_bucket_storage
        <where>
            <if test="criteria.blurry != null and criteria.blurry != ''">
                and (real_name like concat('%',#{criteria.blurry},'%')
                or name like concat('%',#{criteria.blurry},'%')
                or suffix like concat('%',#{criteria.blurry},'%')
                or size like concat('%',#{criteria.blurry},'%')
                or create_by like concat('%',#{criteria.blurry},'%')
                )
            </if>
            <if test="criteria.type != null and criteria.type != ''">
                and type = #{criteria.type}
            </if>
            <if test="criteria.createTime != null and criteria.createTime.size() > 0">
                AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]}
            </if>
        </where>
        order by bucket_id desc
    </select>
    <select id="findByPath" resultType="com.oying.domain.BucketStorage">
        select
        <include refid="Base_Column_List"/>
        from tool_bucket_storage
        where path = #{path}
    </select>
</mapper>