Subversion Repositories SmartDukaan

Rev

Rev 3024 | Rev 3137 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3024 Rev 3106
Line 7... Line 7...
7
    <id property="id" column="id"/>
7
    <id property="id" column="id"/>
8
  </resultMap>
8
  </resultMap>
9
 
9
 
10
  <insert id="insertTicket" parameterType="ticket" useGeneratedKeys="true" keyProperty="id">
10
  <insert id="insertTicket" parameterType="ticket" useGeneratedKeys="true" keyProperty="id">
11
    INSERT INTO ticket
11
    INSERT INTO ticket
12
      (customerId, openDate, closeDate, receipientId, creatorId, subject, productName, airwayBillNo, orderId)
12
      (customerId, openDate, closeDate, creatorId, description, assigneeId, status,
-
 
13
       priority, category, productName, airwayBillNo, orderId)
13
    VALUES
14
    VALUES
14
      (#{customerId}, #{openDate},  #{closeDate},  #{receipientId},  #{creatorId}, #{subject}, #{productName}, #{airwayBillNo}, #{orderId})
15
      (#{customerId}, NOW(),  #{closeDate},  #{creatorId}, #{description}, #{assigneeId}, #{status},
-
 
16
       #{priority}, #{category}, #{productName}, #{airwayBillNo}, #{orderId})
15
  </insert>
17
  </insert>
16
  
18
  
17
  <update id="updateTicket" parameterType="ticket">
19
  <update id="updateTicket" parameterType="ticket">
18
    UPDATE ticket
20
    UPDATE ticket
19
    SET
21
    SET
-
 
22
    <if test="assigneeId != null">
-
 
23
      assigneeId = #{assigneeId},
-
 
24
    </if>
20
    <if test="subject != null">
25
    <if test="status != null">
21
      subject = #{subject},
26
      status = #{status},
-
 
27
    </if>
-
 
28
    <if test="priority != null">
-
 
29
      priority = #{priority},
-
 
30
    </if>
-
 
31
    <if test="category != null">
-
 
32
      category = #{category},
-
 
33
    </if>
-
 
34
    <if test="description != null">
-
 
35
      description = #{description},
22
    </if>
36
    </if>
23
    closeDate = #{closeDate}
37
    closeDate = #{closeDate}
24
    WHERE id = #{id}
38
    WHERE id = #{id}
25
  </update>
39
  </update>
26
 
40
 
Line 32... Line 46...
32
  
46
  
33
  <select id="getTicket" parameterType="long" resultType="ticket">
47
  <select id="getTicket" parameterType="long" resultType="ticket">
34
    SELECT * FROM ticket
48
    SELECT * FROM ticket
35
    WHERE id = #{ticketId}
49
    WHERE id = #{ticketId}
36
  </select>
50
  </select>
37
  
-
 
38
</mapper>
51
</mapper>
39
52