<?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="cn.com.basic.panel.entity.Cp_calendar_Agenda">
|
<resultMap id="BaseResultMap" type="cn.com.basic.panel.entity.Cp_calendar_Agenda">
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
<result column="content" property="title" jdbcType="VARCHAR" />
|
<result column="starttime" property="start" jdbcType="VARCHAR" />
|
<result column="endtime" property="end" jdbcType="VARCHAR" />
|
<result column="allday" property="allday" jdbcType="VARCHAR" />
|
<result column="color" property="color" jdbcType="VARCHAR" />
|
<result column="userid" property="userid" jdbcType="VARCHAR" />
|
<result column="is_valid" property="isValid" jdbcType="TINYINT" />
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="update_user_id" property="updateUserId" jdbcType="VARCHAR" />
|
<result column="alarmtime" property="alarmtime" jdbcType="VARCHAR" />
|
</resultMap>
|
<sql id="Base_Column_List">
|
id, content, starttime, endtime, allday, color, userid,
|
is_valid , update_time , update_user_id,alarmtime
|
</sql>
|
<sql id="myCalendarColumns">
|
a.id AS "id",
|
a.content AS "title",
|
a.starttime AS "start",
|
a.endtime AS "end",
|
a.allday AS "allday",
|
a.color AS "color",
|
a.userid AS "userid",
|
a.alarmtime as "alarmtime"
|
</sql>
|
|
<sql id="myCalendarJoins">
|
LEFT JOIN t_sys_user user ON user.id = a.userid
|
</sql>
|
|
<sql id="Base_Where_Clause">
|
<where>
|
<trim prefixOverrides="and">
|
<if test="id != null">and a.ID = #{id}</if>
|
<if test="start != null">
|
and a.starttime = #{start,jdbcType=VARCHAR}
|
</if>
|
<if test="end != null">
|
and a.endtime = #{end,jdbcType=VARCHAR}
|
</if>
|
<if test="allday != null">
|
and a.allday = #{allday,jdbcType=VARCHAR}
|
</if>
|
<if test="userid != null">
|
and a.userid = #{userid,jdbcType=VARCHAR}
|
</if>
|
<if test="isValid != null">
|
and a.is_valid = #{isValid,jdbcType=TINYINT}
|
</if>
|
<if test="updateTime != null">
|
and a.update_time = #{updateTime,jdbcType=TIMESTAMP}
|
</if>
|
<if test="updateUserId != null">
|
and a.update_user_id = #{updateUserId,jdbcType=VARCHAR}
|
</if>
|
</trim>
|
</where>
|
<if test="sorting != null">order by ${sorting}</if>
|
<if test="offset != null and limit != null">
|
limit #{offset}, #{limit}
|
</if>
|
</sql>
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.String">
|
select
|
<include refid="Base_Column_List" />
|
from cp_calendar_agenda
|
where id = #{id,jdbcType=VARCHAR}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
delete from
|
cp_calendar_agenda
|
where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
<insert id="insert" parameterType="cn.com.basic.panel.entity.Cp_calendar_Agenda">
|
insert into cp_calendar_agenda
|
(id, content, starttime,
|
endtime, allday, color,
|
userid,is_valid,update_time,update_user_id,alarmtime)
|
values
|
(#{id,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
|
#{start,jdbcType=VARCHAR},
|
#{end,jdbcType=VARCHAR},
|
#{allday,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR},
|
#{userid,jdbcType=VARCHAR},#{isValid,jdbcType=TINYINT},#{updateTime,jdbcType=VARCHAR},#{updateUserId,jdbcType=VARCHAR},#{alarmtime,jdbcType=VARCHAR})
|
</insert>
|
|
<update id="updateByIdSelective" parameterType="cn.com.basic.panel.entity.Cp_calendar_Agenda">
|
update cp_calendar_agenda
|
<set>
|
<if test="title != null">
|
content = #{title,jdbcType=VARCHAR},
|
</if>
|
<if test="start != null">
|
starttime = #{start,jdbcType=VARCHAR},
|
</if>
|
<if test="end != null">
|
endtime = #{end,jdbcType=VARCHAR},
|
</if>
|
<if test="allday != null">
|
allday = #{allday,jdbcType=VARCHAR},
|
</if>
|
<if test="color != null">
|
color = #{color,jdbcType=VARCHAR},
|
</if>
|
<if test="userid != null">
|
userid = #{userid,jdbcType=VARCHAR},
|
</if>
|
<if test="isValid != null">
|
is_valid = #{isValid,jdbcType=TINYINT},
|
</if>
|
<if test="updateTime != null">
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateUserId != null">
|
update_user_id = #{updateUserId,jdbcType=VARCHAR},
|
</if>
|
<if test="alarmtime != null">
|
alarmtime = #{alarmtime,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="cn.com.basic.panel.entity.Cp_calendar_Agenda">
|
update
|
cp_calendar_agenda
|
set content = #{content,jdbcType=VARCHAR},
|
starttime
|
= #{start,jdbcType=VARCHAR},
|
endtime = #{end,jdbcType=VARCHAR},
|
allday = #{allday,jdbcType=VARCHAR},
|
color = #{color,jdbcType=VARCHAR},
|
userid = #{userid,jdbcType=VARCHAR},
|
is_valid = #{isValid,jdbcType=TINYINT},
|
update_time = #{updateTime,jdbcType=VARCHAR},
|
update_user_id = #{updateUserId,jdbcType=VARCHAR},
|
alarmtime = #{alarmtime,jdbcType=VARCHAR}
|
where id
|
= #{id,jdbcType=VARCHAR}
|
</update>
|
|
<select id="select" resultMap="BaseResultMap" parameterType="java.util.Map">
|
SELECT
|
<include refid="myCalendarColumns" />
|
FROM cp_calendar_agenda a
|
<include refid="myCalendarJoins" />
|
<include refid="Base_Where_Clause" />
|
</select>
|
|
<select id="selectAll" resultMap="BaseResultMap" parameterType="java.util.Map">
|
SELECT
|
<include refid="myCalendarColumns" />
|
FROM cp_calendar_agenda a
|
<include refid="myCalendarJoins" />
|
<include refid="Base_Where_Clause" />
|
</select>
|
|
<!-- 查询我接收的通知 start-->
|
<select id="selectCalendarCount" resultType="java.lang.Long"
|
parameterType="java.util.Map">
|
select count(a.id)
|
from cp_calendar_agenda a
|
<include refid="Base_Where_Clause" />
|
</select>
|
|
<select id="selectPageCalendar" resultMap="BaseResultMap"
|
parameterType="java.util.Map">
|
select <include refid="myCalendarColumns" />
|
from cp_calendar_agenda a inner join (select a.id from cp_calendar_agenda a
|
|
<include refid="Base_Where_Clause" />
|
) b on b.id = a.id
|
|
</select>
|
|
</mapper>
|