|
@@ -6,6 +6,9 @@
|
|
|
|
|
|
<resultMap type="com.bosshand.virgo.api.model.Reminder" id="result">
|
|
|
<id column="id" property="id"/>
|
|
|
+ <result column="creator" property="creator"/>
|
|
|
+ <result column="creatorName" property="creatorName"/>
|
|
|
+ <result column="creatorPortrait" property="creatorPortrait"/>
|
|
|
<result column="organizationId" property="organizationId"/>
|
|
|
<result column="projectId" property="projectId"/>
|
|
|
<result column="name" property="name"/>
|
|
@@ -28,6 +31,9 @@
|
|
|
<if test="id != 0">
|
|
|
and id = #{id}
|
|
|
</if>
|
|
|
+ <if test="creator != 0">
|
|
|
+ and creator = #{creator}
|
|
|
+ </if>
|
|
|
<if test="organizationId != 0">
|
|
|
and organizationId = #{organizationId}
|
|
|
</if>
|
|
@@ -53,8 +59,8 @@
|
|
|
</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 INTO reminder (`creator`, `organizationId`, `projectId`, `name`, `type`, `content`, `date`, `frequency`, `userList`, `attachment`, `state`)
|
|
|
+ VALUES (#{creator}, #{organizationId}, #{projectId}, #{name}, #{type}, #{content}, #{date}, #{frequency}, #{userList}, #{attachment}, #{state})
|
|
|
</insert>
|
|
|
|
|
|
<update id="delete">
|
|
@@ -64,6 +70,7 @@
|
|
|
<update id="update" parameterType="com.bosshand.virgo.api.model.Reminder">
|
|
|
UPDATE reminder
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="creator!=0">creator=#{creator},</if>
|
|
|
<if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
|
<if test="projectId!=0">projectId=#{projectId},</if>
|
|
|
<if test="name!=null">name=#{name},</if>
|
|
@@ -78,4 +85,71 @@
|
|
|
WHERE id=#{id}
|
|
|
</update>
|
|
|
|
|
|
+ <select id="getTotalCount" parameterType="com.bosshand.virgo.api.model.Reminder" resultType="Integer">
|
|
|
+ SELECT count(*) FROM reminder
|
|
|
+ <where>
|
|
|
+ <if test="id != 0">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="creator != 0">
|
|
|
+ and creator = #{creator}
|
|
|
+ </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>
|
|
|
+
|
|
|
+ <select id="getLimit" resultMap="result">
|
|
|
+ SELECT a.*, b.name as creatorName, b.portrait as creatorPortrait FROM reminder a LEFT JOIN mgr_user b ON a.creator = b.id
|
|
|
+ <where>
|
|
|
+ <if test="p.id != 0">
|
|
|
+ and a.id = #{p.id}
|
|
|
+ </if>
|
|
|
+ <if test="p.creator != 0">
|
|
|
+ and a.creator = #{p.creator}
|
|
|
+ </if>
|
|
|
+ <if test="p.organizationId != 0">
|
|
|
+ and a.organizationId = #{p.organizationId}
|
|
|
+ </if>
|
|
|
+ <if test="p.projectId != 0">
|
|
|
+ and a.projectId = #{p.projectId}
|
|
|
+ </if>
|
|
|
+ <if test="p.name != null">
|
|
|
+ and a.name = #{p.name}
|
|
|
+ </if>
|
|
|
+ <if test="p.type != null">
|
|
|
+ and a.type = #{p.type}
|
|
|
+ </if>
|
|
|
+ <if test="p.date != null">
|
|
|
+ and a.date = #{p.date}
|
|
|
+ </if>
|
|
|
+ <if test="p.frequency != null">
|
|
|
+ and a.frequency = #{p.frequency}
|
|
|
+ </if>
|
|
|
+ <if test="p.state != null">
|
|
|
+ and a.state = #{p.state}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit #{currIndex} , #{pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|