郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?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.gkhy.safePlatform.account.repository.schedule.ScheduleAllYearDateRepository" >
 
    <resultMap id="scheduleAllYearDateInfo" type="com.gkhy.safePlatform.account.entity.schedule.ScheduleAllYearDateInfo">
        <result property="id" column="id"/>
        <result property="scDate" column="sc_date"/>
        <result property="scYear" column="sc_year" />
        <result property="scMonth" column="sc_month" />
        <result property="scMonthDay" column="sc_month_day" />
        <result property="scWeek" column="sc_week" />
        <result property="scWeekDay"  column="sc_week_day"/>
        <result property="scWeekDayName"  column="sc_week_day_name"/>
        <result property="scDbStatus"  column="ac_db_status"/>
        <result property="scLegalHoliday" column="sc_legal_holiday" />
        <result property="info" column="info" />
 
    </resultMap>
 
    <resultMap id="scheduleAllYearDateRespDTO" type="com.gkhy.safePlatform.account.model.dto.resp.ScheduleAllYearDateRespDTO">
        <result property="id" column="id"/>
        <result property="scDate" column="sc_date"/>
        <result property="scYear" column="sc_year" />
        <result property="scMonth" column="sc_month" />
        <result property="scMonthDay" column="sc_month_day" />
        <result property="scWeek" column="sc_week" />
        <result property="scWeekDay"  column="sc_week_day"/>
        <result property="scWeekDayName"  column="sc_week_day_name"/>
        <result property="scDbStatus"  column="ac_db_status"/>
        <result property="scLegalHoliday" column="sc_legal_holiday" />
        <result property="info" column="info" />
 
    </resultMap>
 
    <!--查询-->
    <select id="getScheduleAllYearDate" parameterType="com.gkhy.safePlatform.account.entity.schedule.ScheduleAllYearDateInfo" resultMap="scheduleAllYearDateRespDTO">
        select
          id,
          sc_date,
          sc_year,
          sc_month,
          sc_month_day,
          sc_week,
          sc_week_day,
          sc_week_day_name,
          ac_db_status,
          sc_legal_holiday
        from schedule_year_date_all
        where
        <if test="id != null">
            and id = #{id}
        </if>
        <if test="startTime != null and startTime != '' ">
            and sc_date &lt;= #{statTime}
        </if>
        <if test="endTime != null and endTime != ''">
            and sc_date &gt;= #{endTime}
        </if>
        <if test="scYear != null ">
            and sc_year = #{scYear}
        </if>
        <if test="scMonth != null ">
            and sc_month = #{scMonth}
        </if>
        <if test="scMonthDay != null ">
            and sc_month_day = #{scMonthDay}
        </if>
        <if test="scWeek != null ">
            and sc_week = #{scWeek}
        </if>
        <if test="scWeekDay == null">
            and sc_week_day = #{scWeekDay}
        </if>
        <if test="scWeekDayName != null and scWeekDayName != null">
            and sc_week_day_name = #{scWeekDayName}
        </if>
        <if test="scDbStatus != null ">
            ac_db_status = #{scDbStatus}
        </if>
        <if test="scLegalHoliday != null ">
            sc_legal_holiday = #{scLegalHoliday}
        </if>
        <if test="info != null and info != '' ">
            info = #{info}
        </if>
    </select>
 
 
 
</mapper>