Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
* Fix unit tests
Browse files Browse the repository at this point in the history
* Fix sql error
  • Loading branch information
haiphucnguyen committed Feb 24, 2019
1 parent 7f2d243 commit c4ea399
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<dataset>
<s_account id="1" createdTime="2013-04-10 13:29:23" paymentMethod="Credit Card" status="Active"/>

<s_user username="admin" firstname="Nguyen" lastname="Hai" email="[email protected]"/>
<s_user username="admin" firstname="Nguyen" lastname="Hai" email="[email protected]"
status="EmailVerified"/>

<s_user username="user2" firstname="A" lastname="B" email="[email protected]"/>
<s_user username="user2" firstname="A" lastname="B" email="[email protected]" status="EmailVerified"/>

<s_user_account id="1" isAccountOwner="1"
registerStatus="Active" username="admin" accountId="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
notifier.firstname AS notifiers_firstname, notifier.lastname AS notifiers_lastname,
notifier.username AS notifiers_username, notifier.timezone AS notifiers_timezone,
notifier.email AS notifiers_email, notifier.language AS notifiers_language, s_relay_email_notification.sAccountId AS notifiers_accountId
notifier.email AS notifiers_email, notifier.language AS notifiers_language,
notifier.status AS notifiers_status, s_relay_email_notification.sAccountId AS notifiers_accountId
FROM s_relay_email_notification
INNER JOIN m_tracker_bug ON (s_relay_email_notification.type='Project-Bug' AND m_tracker_bug.id=s_relay_email_notification.typeId)
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
Expand All @@ -512,7 +513,8 @@
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
notifier.firstname AS notifiers_firstname, notifier.lastname AS notifiers_lastname,
notifier.username AS notifiers_username, notifier.timezone AS notifiers_timezone,
notifier.email AS notifiers_email, notifier.language AS notifiers_language, s_relay_email_notification.sAccountId AS notifiers_accountId
notifier.email AS notifiers_email, notifier.language AS notifiers_language,
notifier.status AS notifiers_status, s_relay_email_notification.sAccountId AS notifiers_accountId
FROM s_relay_email_notification
INNER JOIN m_prj_task ON (s_relay_email_notification.type='Project-Task' AND m_prj_task.id=s_relay_email_notification.typeId)
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
Expand All @@ -535,7 +537,7 @@
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
NULL AS notifiers_firstname, NULL AS notifiers_lastname, NULL AS notifiers_username,
NULL AS notifiers_timezone, NULL AS notifiers_email, NULL AS notifiers_language,
NULL AS notifiers_accountId
NULL AS notifiers_status, NULL AS notifiers_accountId
FROM s_relay_email_notification
INNER JOIN m_prj_message ON (s_relay_email_notification.type='Project-Message' AND m_prj_message.id=s_relay_email_notification.typeId)
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
Expand All @@ -554,7 +556,7 @@
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
NULL AS notifiers_firstname, NULL AS notifiers_lastname,
NULL AS notifiers_username, NULL AS notifiers_timezone,
NULL AS notifiers_email, NULL AS notifiers_language, NULL AS notifiers_accountId
NULL AS notifiers_email, NULL AS notifiers_language, NULL AS notifiers_status, NULL AS notifiers_accountId
FROM s_relay_email_notification
INNER JOIN m_prj_milestone ON (s_relay_email_notification.type='Project-Milestone' AND m_prj_milestone.id=s_relay_email_notification.typeId)
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
Expand All @@ -573,7 +575,7 @@
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
NULL AS notifiers_firstname, NULL AS notifiers_lastname,
NULL AS notifiers_username, NULL AS notifiers_timezone,
NULL AS notifiers_email, NULL AS notifiers_language, NULL AS notifiers_accountId
NULL AS notifiers_email, NULL AS notifiers_language, NULL AS notifiers_status, NULL AS notifiers_accountId
FROM s_relay_email_notification
INNER JOIN m_prj_risk ON (s_relay_email_notification.type='Project-Risk' AND m_prj_risk.id=s_relay_email_notification.typeId)
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
Expand All @@ -592,7 +594,7 @@
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
NULL AS notifiers_firstname, NULL AS notifiers_lastname, NULL AS notifiers_username,
NULL AS notifiers_timezone, NULL AS notifiers_email, NULL AS notifiers_language,
NULL AS notifiers_accountId
NULL AS notifiers_status, NULL AS notifiers_accountId
FROM s_relay_email_notification
INNER JOIN m_tracker_component ON (s_relay_email_notification.type='Project-Component' AND m_tracker_component.id=s_relay_email_notification.typeId)
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
Expand All @@ -611,7 +613,7 @@
concat(changeUser.firstname, ' ', changeUser.lastname) as changeByUserFullName,
NULL AS notifiers_firstname, NULL AS notifiers_lastname, NULL AS notifiers_username,
NULL AS notifiers_timezone, NULL AS notifiers_email, NULL AS notifiers_language,
NULL AS notifiers_accountId
NULL AS notifiers_status, NULL AS notifiers_accountId
FROM s_relay_email_notification
INNER JOIN m_tracker_version ON (s_relay_email_notification.type='Project-Version' AND m_tracker_version.id=s_relay_email_notification.typeId)
INNER JOIN s_user AS changeUser ON (changeUser.username=s_relay_email_notification.changeby)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
</select>

<select id="getActiveUsersInProjects" parameterType="map" resultMap="com.mycollab.module.user.dao.UserMapperExt.SimpleUserResult" lang="velocity">
SELECT DISTINCT s_user.username, s_user.firstname, s_user.lastname, s_user.email, s_status
SELECT DISTINCT s_user.username, s_user.firstname, s_user.lastname, s_user.email, s_user.status
FROM s_user, s_user_account, m_prj_member
WHERE s_user.username=s_user_account.username AND s_user_account.accountId=@{_parameter.sAccountId,jdbcType=NUMERIC}
AND m_prj_member.username=s_user.username AND m_prj_member.projectId IN
Expand Down Expand Up @@ -238,18 +238,18 @@
resultMap="com.mycollab.module.user.dao.UserMapperExt.SimpleUserResult" lang="velocity">
<![CDATA[
SELECT DISTINCT s_user.username, s_user.firstname, s_user.lastname, s_user.email,
s_user.status, s_user.website, s_user.registeredTime, s_user_account.registerStatus,
s_user_account.accountId, s_user.language, s_user.avatarid
FROM s_user, s_user_account
s_user.status, s_user.website, s_user.registeredTime, s_user_account.registerStatus,
s_user_account.accountId, s_user.language, s_user.avatarid
FROM s_user, s_user_account
WHERE s_user.username=@{username} AND s_user.username=s_user_account.username AND
s_user_account.accountId=@{sAccountId} AND
EXISTS (SELECT 1
FROM m_prj_member
WHERE m_prj_member.username = s_user.username
AND m_prj_member.status='Active'
AND m_prj_member.projectId=@{projectId,jdbcType=NUMERIC}
AND s_user_account.username=s_user.username
LIMIT 1)
s_user_account.accountId=@{sAccountId} AND
EXISTS (SELECT 1
FROM m_prj_member
WHERE m_prj_member.username = s_user.username
AND m_prj_member.status='Active'
AND m_prj_member.projectId=@{projectId,jdbcType=NUMERIC}
AND s_user_account.username=s_user.username
LIMIT 1)
]]>
</select>

Expand Down

0 comments on commit c4ea399

Please sign in to comment.