| 3024 |
mandeep.dh |
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
3 |
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
4 |
|
|
|
5 |
<mapper namespace="in.shop2020.crm.persistence.ActivityMapper">
|
|
|
6 |
<resultMap type="activity" id="activityResult">
|
|
|
7 |
<id property="id" column="id"/>
|
|
|
8 |
</resultMap>
|
|
|
9 |
|
|
|
10 |
<insert id="insertActivity" parameterType="activity" useGeneratedKeys="true" keyProperty="id">
|
|
|
11 |
INSERT INTO activity
|
| 3106 |
mandeep.dh |
12 |
(customerId, ticketAssigneeId, description, ticketId, creatorId, type, creationTimestamp,
|
|
|
13 |
ticketPriority, ticketStatus, ticketCategory, ticketDescription)
|
| 3024 |
mandeep.dh |
14 |
VALUES
|
| 3106 |
mandeep.dh |
15 |
(#{customerId}, #{ticketAssigneeId}, #{description}, #{ticketId}, #{creatorId}, #{type}, NOW(),
|
|
|
16 |
#{ticketPriority}, #{ticketStatus}, #{ticketCategory}, #{ticketDescription})
|
| 3024 |
mandeep.dh |
17 |
</insert>
|
|
|
18 |
|
|
|
19 |
<select id="getActivities" parameterType="long" resultType="activity">
|
|
|
20 |
SELECT * FROM activity
|
|
|
21 |
WHERE customerId = #{customerId}
|
| 3106 |
mandeep.dh |
22 |
ORDER BY creationTimestamp DESC
|
| 3024 |
mandeep.dh |
23 |
</select>
|
|
|
24 |
|
|
|
25 |
<select id="getActivitiesForTicket" parameterType="long" resultType="activity">
|
|
|
26 |
SELECT * FROM activity
|
|
|
27 |
WHERE ticketId = #{ticketId}
|
| 3106 |
mandeep.dh |
28 |
ORDER BY creationTimestamp DESC
|
| 3024 |
mandeep.dh |
29 |
</select>
|
|
|
30 |
|
|
|
31 |
<select id="getActivity" parameterType="long" resultType="activity">
|
|
|
32 |
SELECT * FROM activity
|
|
|
33 |
WHERE id = #{activityId}
|
|
|
34 |
</select>
|
|
|
35 |
|
|
|
36 |
<select id="getLastActivity" parameterType="long" resultType="activity">
|
|
|
37 |
SELECT * FROM activity
|
|
|
38 |
WHERE ticketId = #{ticketId}
|
| 3106 |
mandeep.dh |
39 |
ORDER BY creationTimestamp DESC
|
| 3024 |
mandeep.dh |
40 |
LIMIT 1
|
|
|
41 |
</select>
|
|
|
42 |
</mapper>
|