|
@@ -0,0 +1,81 @@
|
|
|
+<!DOCTYPE mapper
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+
|
|
|
+<mapper namespace="com.bosshand.virgo.api.dao.ReminderDao">
|
|
|
+
|
|
|
+ <resultMap type="com.bosshand.virgo.api.model.Reminder" id="result">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="organizationId" property="organizationId"/>
|
|
|
+ <result column="projectId" property="projectId"/>
|
|
|
+ <result column="name" property="name"/>
|
|
|
+ <result column="type" property="type"/>
|
|
|
+ <result column="content" property="content"/>
|
|
|
+ <result column="date" property="date"/>
|
|
|
+ <result column="frequency" property="frequency"/>
|
|
|
+ <result column="userList" property="userList"/>
|
|
|
+ <result column="attachment" property="attachment"/>
|
|
|
+ <result column="state" property="state"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="get" resultMap="result">
|
|
|
+ select * from reminder where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getList" resultMap="result">
|
|
|
+ select * from reminder
|
|
|
+ <where>
|
|
|
+ <if test="id != 0">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="organizationId != 0">
|
|
|
+ and organizationId = #{organizationId}
|
|
|
+ </if>
|
|
|
+ <if test="projectId != 0">
|
|
|
+ and projectId = #{projectId}
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ and name = #{name}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="date != null">
|
|
|
+ and date = #{date}
|
|
|
+ </if>
|
|
|
+ <if test="frequency != null">
|
|
|
+ and frequency = #{frequency}
|
|
|
+ </if>
|
|
|
+ <if test="state != null">
|
|
|
+ and state = #{state}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ INSERT INTO reminder (`organizationId`, `projectId`, `name`, `type`, `content`, `date`, `frequency`, `userList`, `attachment`, `state`)
|
|
|
+ VALUES (#{organizationId}, #{projectId}, #{name}, #{type}, #{content}, #{date}, #{frequency}, #{userList}, #{attachment}, #{state})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="delete">
|
|
|
+ DELETE FROM reminder WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.bosshand.virgo.api.model.Reminder">
|
|
|
+ UPDATE reminder
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
|
+ <if test="projectId!=0">projectId=#{projectId},</if>
|
|
|
+ <if test="name!=null">name=#{name},</if>
|
|
|
+ <if test="type!=null">type=#{type},</if>
|
|
|
+ <if test="content!=null">content=#{content},</if>
|
|
|
+ <if test="date!=null">date=#{date},</if>
|
|
|
+ <if test="frequency!=null">frequency=#{frequency},</if>
|
|
|
+ <if test="userList!=null">userList=#{userList},</if>
|
|
|
+ <if test="attachment!=null">attachment=#{attachment},</if>
|
|
|
+ <if test="state!=null">state=#{state},</if>
|
|
|
+ </trim>
|
|
|
+ WHERE id=#{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|