Best way to select row with following scenario using greenDao?

大城市里の小女人 提交于 2019-12-24 19:23:54

问题


I have 3 tables :

    Manager: manager_id, taluka_name  
    Employee: employee_id, employee_manager_id   
    Target: target_id, target_employee_id  

Now i have to show a ListView of all the targets taluka_name wise. I am using greenDao for the interaction with the SQlite database.

This is the process i have tried, It is taking too long using the method i have used:

    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}

Below is the type of query i want to accomplish using 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

来源:https://stackoverflow.com/questions/14547288/best-way-to-select-row-with-following-scenario-using-greendao

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!