Subversion Repositories SmartDukaan

Rev

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

Rev 3339 Rev 3390
Line 5... Line 5...
5
<mapper namespace="in.shop2020.crm.persistence.AgentMapper">
5
<mapper namespace="in.shop2020.crm.persistence.AgentMapper">
6
  <resultMap type="agent" id="agentResult">
6
  <resultMap type="agent" id="agentResult">
7
    <id property="id" column="id"/>
7
    <id property="id" column="id"/>
8
  </resultMap>
8
  </resultMap>
9
 
9
 
10
  <select id="getAllAgents" resultType="agent">
10
  <select id="getAgents" parameterType="searchFilter" resultType="agent">
-
 
11
    SELECT *
11
    SELECT * FROM agent
12
    FROM agent a
-
 
13
    <where>
-
 
14
        <if test="agentId != null">
-
 
15
            AND a.id = #{agentId}
-
 
16
        </if>
-
 
17
        <if test="agentEmailId != null">
-
 
18
            AND a.emailId = #{agentEmailId}
-
 
19
        </if>
-
 
20
    </where>
12
  </select>
21
  </select>
13
 
22
 
14
  <select id="getAgent" parameterType="long" resultType="agent">
-
 
15
    SELECT * FROM agent
-
 
16
    WHERE id = #{agentId}
-
 
17
  </select>
-
 
18
 
-
 
19
  <select id="getAgentByEmailId" parameterType="String" resultType="agent">
-
 
20
    SELECT * FROM agent
-
 
21
    WHERE emailId = #{emailId}
-
 
22
  </select>
-
 
23
  
-
 
24
  <select id="getRoleNamesForAgent" parameterType="String" resultType="String">
23
  <select id="getRoleNamesForAgent" parameterType="String" resultType="String">
25
    SELECT role_name 
24
    SELECT role_name 
26
    FROM user_roles a
25
    FROM user_roles a
27
    JOIN agent b
26
    JOIN agent b
28
        ON (b.id = a.agentId)
27
        ON (b.id = a.agentId)
Line 38... Line 37...
38
  <update id="updatePasswordForAgent" parameterType="map">
37
  <update id="updatePasswordForAgent" parameterType="map">
39
    UPDATE agent
38
    UPDATE agent
40
    SET password = #{password}
39
    SET password = #{password}
41
    WHERE emailId = #{emailId}
40
    WHERE emailId = #{emailId}
42
  </update>
41
  </update>
43
  
-
 
44
  <select id="getReportees" parameterType="long" resultType="agent">
-
 
45
    SELECT * FROM agent
-
 
46
    WHERE managerId = #{agentId}
-
 
47
  </select>
-
 
48
  
42
 
49
  <select id="getLastEmailProcessedTimestamp" resultType="java.util.Date">
43
  <select id="getLastEmailProcessedTimestamp" resultType="java.util.Date">
50
    SELECT lastUpdatedTimestamp from emailStatus
44
    SELECT lastUpdatedTimestamp from emailStatus
51
  </select>
45
  </select>
52
 
46
 
53
  <update id="updateLastEmailProcessedTimestamp" parameterType="java.util.Date">
47
  <update id="updateLastEmailProcessedTimestamp" parameterType="java.util.Date">