<?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 >=#{startDate} and cal_date <=#{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 >= #{dto.startDate}
|
</if>
|
<if test=" dto.endDate !=null and dto.endDate !='' ">
|
and c.cal_date <= #{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 >= #{dto.startDate}
|
</if>
|
<if test=" dto.endDate !=null and dto.endDate !='' ">
|
and c.cal_date <= #{dto.endDate}
|
</if>
|
group by cal_year,cal_month
|
order by cal_year,CONVERT(cal_month, SIGNED)
|
</select>
|
|
</mapper>
|