zhanghua
2023-09-08 7ef4892f9f24f941aca37e6b3991b808a0aca619
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
<?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.ycl.mapper.resources.VideoResourcesMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.entity.resources.VideoResources">
        <id column="id" property="id" />
        <result column="belong_to_id" property="belongToId" />
        <result column="type" property="type" />
        <result column="url" property="url" />
        <result column="create_user" property="createUser" />
        <result column="create_time" property="createTime" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, belong_to_id, type, url, create_user, create_time
    </sql>
 
    <select id="selectImagePage" resultType="com.ycl.vo.resources.MediaVO">
        SELECT
        t2.category,
        t2.event_source,
        t2.code as code,
        t1.id,
        t3.region_name,
        t1.create_time,
        t1.url
        FROM
        ums_video_resources t1
        LEFT JOIN ums_base_case t2 ON t1.belong_to_id = t2.id
        LEFT JOIN ums_sccg_region t3 on t3.id=t2.community_id
        <where>
            <if test="type == '03' and type != null and type !='' ">
                t1.type='03'
            </if>
            <if test="type == '01' and type != null and type !='' ">
                t1.type='02' or t1.type='01'
            </if>
            <if test="startTime != '' and endTime != '' and startTime != null and endTime != null">
                and t1.create_time between #{startTime} and #{endTime}
            </if>
        </where>
    </select>
</mapper>