endian11
2020-11-03 56dbd70a0fe3615563d7941f18edde82a482822b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package safeluck.drive.evaluation.DB.failitems;
 
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
 
import org.jetbrains.annotations.NotNull;
 
import java.util.List;
 
/**
 * MyApplication2
 * Created by lzw on 2019/11/26. 18:08:08
 * 邮箱:632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
@Dao
public interface LuKaoFailProjDao {
 
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(LuKaoFailedProj proj);
 
  /**
     * 查询 科目三 路考考场的失败项目 (多表查询)
     * 如果要添加 科目二II   III类考场失败项目,需要建立相应的评判标准表数据表
     * @return
     */
    @Query("SELECT emp_id,stu_id,utc,sn,deducting_reason,score_deducting,item_content from criteria_three INNER JOIN lukao_fail_projects ON  criteria_three.item_id= lukao_fail_projects.emp_id where lukao_fail_projects.stu_id=:stu_id and lukao_fail_projects.subject=3")
    LiveData<List<FailedProj_select>> getFailedProjectsForIII(long stu_id);
 
    /**
     * 获取失败项目条数
     * @param subject_id
     * @return
     */
    @Query("SELECT COUNT(*)  from lukao_fail_projects where subject=:subject_id")
    LiveData<Integer> getSubject(int subject_id);
 
    @Query("delete from lukao_fail_projects")
    void deleteAll();
 
 
 
  /**
   * 查询 科目三 路考考场的失败项目 (多表查询)
   * 如果要添加 科目二II   III类考场失败项目,需要建立相应的评判标准表数据表
   * @return
   */
  @Query("SELECT emp_id,stu_id,utc,sn,deducting_reason,score_deducting,item_content from criteria_three INNER JOIN lukao_fail_projects ON  criteria_three.item_id= lukao_fail_projects.emp_id where lukao_fail_projects.stu_id=:stu_id and lukao_fail_projects.subject=3")
    List<FailedProj_select> getAllFailProjIII(long stu_id);
}