mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?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.panzhihua.service_grid.dao.EventResourceMapper">
 
     <resultMap id="baseResult" type="com.panzhihua.service_grid.model.dos.EventResourceDO">
        <result property="id" column="id"/>
        <result property="classification" column="classification"/>
        <result property="refId" column="ref_id"/>
        <result property="type" column="type"/>
        <result property="resourceName" column="resource_name"/>
        <result property="resourceSize" column="resource_size"/>
        <result property="resourceTime" column="resource_time"/>
        <result property="url" column="url"/>
        <result property="createBy" column="create_by"/>
        <result property="createAt" column="create_at"/>
    </resultMap>
 
    <sql id="columns">
    <![CDATA[
        id,classification,ref_id,type,resource_name,resource_size,resource_time, url,create_by,create_at
    ]]>
    </sql>
 
 
    <select id="findByPage" resultType="com.panzhihua.common.model.vos.grid.EventResourceVO"
        parameterType="com.panzhihua.common.model.dtos.grid.PageEventResourceDTO">
        SELECT <include refid="columns" />
        FROM event_resource
        <where>
           <if test="pageEventResourceDTO.classification!=null">
                AND classification = #{pageEventResourceDTO.classification}
            </if>
           <if test="pageEventResourceDTO.id!=null">
                AND id = #{pageEventResourceDTO.id}
            </if>
            <if test="pageEventResourceDTO.refId!=null">
                AND ref_id = #{pageEventResourceDTO.refId}
            </if>
           <if test="pageEventResourceDTO.type!=null">
                AND type = #{pageEventResourceDTO.type}
            </if>
           <if test="pageEventResourceDTO.resourceName!=null">
                AND resource_name = #{pageEventResourceDTO.resourceName}
            </if>
           <if test="pageEventResourceDTO.resourceSize!=null">
                AND resource_size = #{pageEventResourceDTO.resourceSize}
            </if>
           <if test="pageEventResourceDTO.url!=null">
                AND url = #{pageEventResourceDTO.url}
            </if>
           <if test="pageEventResourceDTO.createBy!=null">
                AND create_by = #{pageEventResourceDTO.createBy}
            </if>
           <if test="pageEventResourceDTO.createAtBegin!=null">
                AND create_at &gt;= #{pageEventResourceDTO.createAtBegin}
           </if>
           <if test="pageEventResourceDTO.createAtEnd!=null">
                AND create_at &lt;= #{pageEventResourceDTO.createAtEnd}
           </if>
        </where>
        <if test="pageEventResourceDTO.sortColumns!=null">
            ORDER BY ${pageEventResourceDTO.sortColumns} ${pageEventResourceDTO.sortType}
        </if>
    </select>
 
    <select id="findListByRefId" resultType="com.panzhihua.common.model.vos.grid.EventResourceVO">
        SELECT url,resource_time FROM event_resource
        where ref_id = #{id} and classification = #{classification} and type = #{type} order by id desc
    </select>
</mapper>