Professional Documents
Culture Documents
<b>Step 7</b>:
Now following query check that notification is already sent for the day or not
SELECT * from ma_location_notification
WHERE
mobile_holder_id_fk = '304'
AND
package_id_fk = '165'
AND
date = '2011-02-18'
<b>Step 8</b>:
Now following query select advertisement and advertiser detail in order to sen
d a notification
SELECT advmnt_id,adv_id_fk,advmnt_title,advmnt_desc
FROM ma_advertisement
WHERE advmnt_id = 131
<b>Step 3</b>:
Now If any branch seleted then following query select package_id_fk from ma_pac
kage_branches corresponding to branch_id:
SELECT package_id_fk FROM ma_package_branches
WHERE
branch_id_fk =
70
<b>Step 4</b>:
Now If package_id seleted then following query select advertisementId, geograp
hicalId of package and package type from ma_package corresponding to package_id
and check expiry date of package:
SELECT advmnt_id_fk,package_id, geographical_id_fk,package_type
FROM
ma_pack
age
WHERE
package
_id ='199'
AND
date_to
>= '2011-02-18'
AND dat
e_from <= '2011-02-18'
<b>Step 5</b>:
If package_type is broadcast then following query select UserId and check acti
ve status of user:
SELECT
ma_mobile_holder.mobile_holder_id
FROM
ma_mobile_holder
INNER JOIN
ma_users
ON
ma_mobile_holder.user_id_fk = ma_users.user_id
WHERE
ma_users.user_id = '383'
AND
ma_users.active_status = 1
<b>Step 6</b>:
Now following query check disable time of user
SELECT mobile_holder_id FROM ma_mobile_holder
WHERE
mobile_holder_id = 304
AND
(disable_start_time > '2011-02-18 16:09:09'
OR
disable_end_time < '2011-02-18 16:09:09'
OR
disable_start_time = '0000-00-00 00:00:00')
<b>Step 7</b>:
Now following query check that notification is already sent for the day or not
SELECT * from ma_location_notification
WHERE
mobile_holder_id_fk = '304'
AND
package_id_fk = '199'
AND
date = '2011-02-18'
<b>Step 8</b>:
Now following query select advertisement and advertiser detail in order to sen
d a notification
SELECT advmnt_id,adv_id_fk,advmnt_title,advmnt_desc
FROM ma_advertisement
WHERE advmnt_id = 142
<b>Step 4</b>:
Now If package_id seleted then following query select advertisementId, geograp
hicalId of package and package type from ma_package corresponding to package_id
and check expiry date of package:
SELECT advmnt_id_fk,package_id, geographical_id_fk,package_type
FROM
ma_pack
age
WHERE
package
_id ='200'
AND
date_to
>= '2011-02-18'
AND dat
e_from <= '2011-02-18'
<b>Step 5</b>:
If package_type is Zone then following query select UserId and check user zone
:
<b>Step 7</b>:
Now following query check that notification is already sent for the day or not
SELECT * from ma_location_notification
WHERE
mobile_holder_id_fk = '304'
AND
package_id_fk = '200'
AND
date = '2011-02-18'
<b>Step 8</b>:
Now following query select advertisement and advertiser detail in order to sen
d a notification
SELECT advmnt_id,adv_id_fk,advmnt_title,advmnt_desc
FROM ma_advertisement
WHERE advmnt_id = 143