| 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.AgentMapper">
|
|
|
6 |
<resultMap type="agent" id="agentResult">
|
|
|
7 |
<id property="id" column="id"/>
|
|
|
8 |
</resultMap>
|
| 3088 |
mandeep.dh |
9 |
|
|
|
10 |
<select id="getAllAgents" resultType="agent">
|
|
|
11 |
SELECT * FROM agent
|
|
|
12 |
</select>
|
|
|
13 |
|
| 3024 |
mandeep.dh |
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>
|
| 3088 |
mandeep.dh |
23 |
|
|
|
24 |
<select id="getRoleNamesForAgent" parameterType="String" resultType="String">
|
|
|
25 |
SELECT role_name
|
|
|
26 |
FROM user_roles a
|
|
|
27 |
JOIN agent b
|
|
|
28 |
ON (b.id = a.agentId)
|
|
|
29 |
WHERE b.emailId = #{emailId}
|
|
|
30 |
</select>
|
|
|
31 |
|
|
|
32 |
<select id="getPermissionsForRoleName" parameterType="String" resultType="String">
|
|
|
33 |
SELECT permission
|
|
|
34 |
FROM roles_permissions
|
|
|
35 |
WHERE role_name = #{role_name}
|
|
|
36 |
</select>
|
|
|
37 |
|
|
|
38 |
<update id="updatePasswordForAgent" parameterType="map">
|
|
|
39 |
UPDATE agent
|
|
|
40 |
SET password = #{password}
|
|
|
41 |
WHERE emailId = #{emailId}
|
|
|
42 |
</update>
|
| 3137 |
mandeep.dh |
43 |
|
|
|
44 |
<select id="getReportees" parameterType="long" resultType="agent">
|
|
|
45 |
SELECT * FROM agent
|
|
|
46 |
WHERE managerId = #{agentId}
|
|
|
47 |
</select>
|
| 3339 |
mandeep.dh |
48 |
|
|
|
49 |
<select id="getLastEmailProcessedTimestamp" resultType="java.util.Date">
|
|
|
50 |
SELECT lastUpdatedTimestamp from emailStatus
|
|
|
51 |
</select>
|
|
|
52 |
|
|
|
53 |
<update id="updateLastEmailProcessedTimestamp" parameterType="java.util.Date">
|
|
|
54 |
UPDATE emailStatus
|
|
|
55 |
SET lastUpdatedTimestamp = #{timestamp}
|
|
|
56 |
</update>
|
| 3024 |
mandeep.dh |
57 |
</mapper>
|