Subversion Repositories SmartDukaan

Rev

Rev 3269 | Rev 3390 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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,
3269 mandeep.dh 13
       ticketPriority, ticketStatus, ticketCategory, ticketDescription, emailId, customerMobileNumber)
3024 mandeep.dh 14
    VALUES
3106 mandeep.dh 15
      (#{customerId}, #{ticketAssigneeId}, #{description}, #{ticketId}, #{creatorId}, #{type}, NOW(),
3269 mandeep.dh 16
       #{ticketPriority}, #{ticketStatus}, #{ticketCategory}, #{ticketDescription}, #{emailId}, #{customerMobileNumber})
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
 
3339 mandeep.dh 25
  <select id="getActivitiesByCreator" parameterType="long" resultType="activity">
26
    SELECT * FROM activity
27
    WHERE creatorId = #{creatorId}
28
    ORDER BY creationTimestamp DESC
29
  </select>
30
 
3024 mandeep.dh 31
  <select id="getActivitiesForTicket" parameterType="long" resultType="activity">
32
    SELECT * FROM activity
33
    WHERE ticketId = #{ticketId}
3106 mandeep.dh 34
    ORDER BY creationTimestamp DESC
3024 mandeep.dh 35
  </select>
36
 
37
  <select id="getActivity" parameterType="long" resultType="activity">
38
    SELECT * FROM activity
39
    WHERE id = #{activityId}
40
  </select>
41
 
42
  <select id="getLastActivity" parameterType="long" resultType="activity">
43
    SELECT * FROM activity
44
    WHERE ticketId = #{ticketId}
3106 mandeep.dh 45
    ORDER BY creationTimestamp DESC
3024 mandeep.dh 46
    LIMIT 1
47
  </select>
48
</mapper>