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
51
52
53
54
55
56
57
58
<?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.CalCalendarMapperCustom">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.cloudroam.model.CalCalendarDO">
        <id column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="cal_date" property="calDate" />
        <result column="cal_year" property="calYear" />
        <result column="cal_month" property="calMonth" />
        <result column="cal_day" property="calDay" />
        <result column="cal_week" property="calWeek" />
        <result column="type" property="type" />
    </resultMap>
    <update id="updateCalCalendarType">
        update cal_calendar set type=#{type} where  cal_date &gt;=#{startDate} and cal_date &lt;=#{endDate}
    </update>
    <select id="selectProjectCalendarList" resultType="com.cloudroam.bo.calendar.CalCalendarBO">
        select *
        from (
            select * from cal_calendar c
            where cal_week not in (6,7)
            union
            select * from cal_calendar c
            where c.type=2
        ) c
        where 1=1
        <if test=" dto.startDate !=null and dto.startDate !='' ">
            and c.cal_date &gt;= #{dto.startDate}
        </if>
        <if test=" dto.endDate !=null and dto.endDate !='' ">
            and c.cal_date &lt;= #{dto.endDate}
        </if>
        order by  cal_date asc
    </select>
    <select id="selectProjectCalendarMonthList" resultType="com.cloudroam.bo.calendar.CalCalendarBO">
        select cal_year,cal_month
        from (
        select * from cal_calendar c
        where cal_week not in (6,7)
        union
        select * from cal_calendar c
        where c.type=2
        ) c
        where 1=1
        <if test=" dto.startDate !=null and dto.startDate !='' ">
            and c.cal_date &gt;= #{dto.startDate}
        </if>
        <if test=" dto.endDate !=null and dto.endDate !='' ">
            and c.cal_date &lt;= #{dto.endDate}
        </if>
        group by cal_year,cal_month
        order by cal_year,CONVERT(cal_month, SIGNED)
    </select>
 
</mapper>