| | |
| | | |
| | | import androidx.lifecycle.LiveData; |
| | | import androidx.room.Dao; |
| | | import androidx.room.Delete; |
| | | import androidx.room.Insert; |
| | | import androidx.room.Query; |
| | | |
| | |
| | | * 如果要添加 科目二II III类考场失败项目,需要建立相应的评判标准表数据表 |
| | | * @return |
| | | */ |
| | | @Query("SELECT emp_id,deducting_reason,score_deducting,item_content from criteria_one INNER JOIN fail_projects ON criteria_one.item_id= fail_projects.emp_id") |
| | | @Query("SELECT emp_id,stu_id,deducting_reason,score_deducting,item_content from criteria_one INNER JOIN fail_projects ON criteria_one.item_id= fail_projects.emp_id") |
| | | LiveData<List<FailedProj_select>> getFailedProjects(); |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Query("SELECT COUNT(*) from fail_projects where subject=:subject_id") |
| | | LiveData<Integer> getSubject(int subject_id); |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | @ColumnInfo(name = "stu_id") |
| | | private long stu_id; |
| | | |
| | | @ColumnInfo(name = "subject") |
| | | private int subject; |
| | | |
| | |
| | | @ColumnInfo(name = "emp_id") |
| | | private int emp_id; |
| | | |
| | | public FailedProj(int subject, int emp_id) { |
| | | public FailedProj(int subject, int emp_id,long stu_id) { |
| | | this.subject = subject; |
| | | this.emp_id = emp_id; |
| | | this.stu_id = stu_id; |
| | | } |
| | | |
| | | public int getId() { |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public long getStu_id() { |
| | | return stu_id; |
| | | } |
| | | |
| | | public void setStu_id(long stu_id) { |
| | | this.stu_id = stu_id; |
| | | } |
| | | |
| | | public int getSubject() { |
| | | return subject; |
| | | } |
| | |
| | | |
| | | @ColumnInfo(name = "emp_id") |
| | | private int emp_id; |
| | | |
| | | private long stu_id; |
| | | private String item_content; |
| | | private String deducting_reason; |
| | | private int score_deducting; |
| | |
| | | this.deducting_reason = deducting_reason; |
| | | } |
| | | |
| | | public long getStu_id() { |
| | | return stu_id; |
| | | } |
| | | |
| | | public void setStu_id(long stu_id) { |
| | | this.stu_id = stu_id; |
| | | } |
| | | |
| | | public int getScore_deducting() { |
| | | return score_deducting; |
| | | } |
| | |
| | | public String toString() { |
| | | return "FailedProj_select{" + |
| | | "emp_id=" + emp_id + |
| | | ", stu_id=" + stu_id + |
| | | ", item_content='" + item_content + '\'' + |
| | | ", deducting_reason='" + deducting_reason + '\'' + |
| | | ", score_deducting=" + score_deducting + |
| | |
| | | @Override |
| | | public void run() { |
| | | |
| | | WorkRoomDataBase.getWorkRoomDataBase(getContext().getApplicationContext()).getFailProjDao().insert(new FailedProj(1, r)); |
| | | WorkRoomDataBase.getWorkRoomDataBase(getContext().getApplicationContext()).getFailProjDao().insert(new FailedProj(1, r,1001)); |
| | | } |
| | | }); |
| | | |