tj
2025-06-05 2d549a04870d1315868a7cf19952b64e8071e711
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.cloudroam.mapper.CalCalendarHolidayMapperCustom">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.cloudroam.model.CalCalendarHolidayDO">
        <id column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="delete_time" property="deleteTime" />
        <result column="start_date" property="startDate" />
        <result column="end_date" property="endDate" />
        <result column="type" property="type" />
        <result column="create_user_id" property="createUserId" />
        <result column="create_user_name" property="createUserName" />
        <result column="update_user_id" property="updateUserId" />
        <result column="update_user_name" property="updateUserName" />
        <result column="is_deleted" property="isDeleted" />
        <result column="delete_user_id" property="deleteUserId" />
        <result column="delete_user_name" property="deleteUserName" />
        <result column="title" property="title" />
    </resultMap>
    <select id="getCalendarHolidayPage" resultType="com.cloudroam.model.CalCalendarHolidayDO">
       <include refid="customList" />
    </select>
    <select id="getCalendarHolidayList" resultType="com.cloudroam.model.CalCalendarHolidayDO">
        <include refid="customList" />
    </select>
 
    <sql id="customList">
        select *
        from cal_calendar_holiday c
        where c.is_deleted=0
        <if test=" dto.startDate !=null and dto.startDate !='' ">
            and c.start_date &gt;= #{dto.startDate}
        </if>
        <if test=" dto.endDate !=null and dto.endDate !='' ">
            and c.end_date &lt;= #{dto.endDate}
        </if>
        <if test=" dto.calDate !=null and dto.calDate !='' ">
            and  str_to_date(#{dto.calDate},'%Y-%m-%d') between c.start_date and c.end_date
        </if>
        <if test=" dto.title !=null and dto.title !='' ">
            and c.title like concat('%',#{dto.title},'%')
        </if>
 
 
    </sql>
 
</mapper>