私は3つのテーブルを持っています:
Manager: manager_id, taluka_name
Employee: employee_id, employee_manager_id
Target: target_id, target_employee_id
ここで、すべてのターゲットtaluka_nameの ListView を表示する必要があります。SQlite データベースとのやり取りに greenDao を使用しています。
これは私が試したプロセスです。私が使用した方法を使用すると時間がかかりすぎます:
Step1: Get Manager ID for the taluka name from the DB.
Step2: Get Employee for the Target table->Employee ID.
Step3: Get Manager ID from the Employee table.
Step4: Compare if Both Manager ID are equal {if YES then target
belongs to that taluka}
以下は、Greendaoを使用して達成したいクエリのタイプです
SELECT *
FROM target t, location l, current c
WHERE t.target_location_id = l.location_id
AND t.target_location_id = c.school_id
AND t.target_status <> '0'
AND t.target_status <> '4'
AND DATEDIFF(NOW(),t.target_exec_end_time)<7