Commit fb3ce759 by 朱海

[add]增加按文件夹id搜索

1 parent 08223f55
...@@ -86,10 +86,11 @@ public class ReidController { ...@@ -86,10 +86,11 @@ public class ReidController {
@RequestParam(required = false) Long annotatorId, @RequestParam(defaultValue = "1") Integer countGTE, @RequestParam(required = false) Long annotatorId, @RequestParam(defaultValue = "1") Integer countGTE,
@RequestParam(defaultValue = "1000000") Integer countLTE, @RequestParam(defaultValue = "1000000") Integer countLTE,
@RequestParam(required = false) Date startTime, @RequestParam(required = false) Date startTime,
@RequestParam(required = false) Date endTime) { @RequestParam(required = false) Date endTime,
@RequestParam(required = false) String personId) {
SubTaskMapper mapper = (SubTaskMapper) subTaskService.getMapper(); SubTaskMapper mapper = (SubTaskMapper) subTaskService.getMapper();
List<String> personUnids = mapper.getPersonUnids(packId, status, page == null ? null : (page - 1) * size, size, annotatorId, countGTE, countLTE, startTime, endTime); List<String> personUnids = mapper.getPersonUnids(packId, status, page == null ? null : (page - 1) * size, size, annotatorId, countGTE, countLTE, startTime, endTime, personId);
List<SubTaskVo> people = CollUtil.isEmpty(personUnids) ? Collections.emptyList() : mapper.getPeople(packId, personUnids); List<SubTaskVo> people = CollUtil.isEmpty(personUnids) ? Collections.emptyList() : mapper.getPeople(packId, personUnids);
Map<String, User> labelingMap = reidService.getRedissonClient().<String, User>getMap("labeling:" + packId).readAllMap(); Map<String, User> labelingMap = reidService.getRedissonClient().<String, User>getMap("labeling:" + packId).readAllMap();
...@@ -110,7 +111,7 @@ public class ReidController { ...@@ -110,7 +111,7 @@ public class ReidController {
if (page != null) { if (page != null) {
PageInfo<Map<String, List<SubTaskVo>>> pageInfo = new PageInfo<>(result, page.intValue()); PageInfo<Map<String, List<SubTaskVo>>> pageInfo = new PageInfo<>(result, page.intValue());
pageInfo.setTotal(mapper.countPeople(packId, status, annotatorId, countGTE, countLTE,startTime, endTime)); pageInfo.setTotal(mapper.countPeople(packId, status, annotatorId, countGTE, countLTE,startTime, endTime, personId));
return JsonMessageUtil.getSuccessJsonMsg(pageInfo); return JsonMessageUtil.getSuccessJsonMsg(pageInfo);
} else { } else {
return JsonMessageUtil.getSuccessJsonMsg(result); return JsonMessageUtil.getSuccessJsonMsg(result);
......
...@@ -72,13 +72,14 @@ public interface SubTaskMapper extends BaseMapper { ...@@ -72,13 +72,14 @@ public interface SubTaskMapper extends BaseMapper {
" <if test = 'status != null'> and status=#{status}</if> " + " <if test = 'status != null'> and status=#{status}</if> " +
" <if test = 'status == null'> and status != -1</if> " + " <if test = 'status == null'> and status != -1</if> " +
" <if test = 'annotatorId != null'> and annotator_id = #{annotatorId}</if> " + " <if test = 'annotatorId != null'> and annotator_id = #{annotatorId}</if> " +
"<if test = 'personId != null'> and person_unid = #{personId}</if>" +
"<if test = 'startTime != null &amp;&amp; endTime != null'> and annotate_time between #{startTime} and #{endTime}</if>" + "<if test = 'startTime != null &amp;&amp; endTime != null'> and annotate_time between #{startTime} and #{endTime}</if>" +
"group by person_unid " + "group by person_unid " +
" having count(*) between #{countGTE} and #{countLTE} " + " having count(*) between #{countGTE} and #{countLTE} " +
" order by max(annotate_time) desc nulls last, person_unid desc " + " order by max(annotate_time) desc nulls last, person_unid desc " +
"<if test='offset != null'> offset #{offset} limit #{limit}</if>" + "<if test='offset != null'> offset #{offset} limit #{limit}</if>" +
"</script>") "</script>")
List<String> getPersonUnids(Long packId, Integer status, Long offset, Long limit, Long annotatorId, Integer countGTE, Integer countLTE, Date startTime, Date endTime); List<String> getPersonUnids(Long packId, Integer status, Long offset, Long limit, Long annotatorId, Integer countGTE, Integer countLTE, Date startTime, Date endTime, String personId);
@Select("<script>" + @Select("<script>" +
"select count(*) from " + "select count(*) from " +
...@@ -86,12 +87,13 @@ public interface SubTaskMapper extends BaseMapper { ...@@ -86,12 +87,13 @@ public interface SubTaskMapper extends BaseMapper {
" <if test = 'status != null'> and status=#{status}</if> " + " <if test = 'status != null'> and status=#{status}</if> " +
" <if test = 'status == null'> and status != -1</if> " + " <if test = 'status == null'> and status != -1</if> " +
" <if test = 'annotatorId != null'> and annotator_id = #{annotatorId}</if> " + " <if test = 'annotatorId != null'> and annotator_id = #{annotatorId}</if> " +
"<if test = 'personId != null'> and person_unid = #{personId}</if>" +
"<if test = 'startTime != null &amp;&amp; endTime != null'> and annotate_time between #{startTime} and #{endTime}</if>" + "<if test = 'startTime != null &amp;&amp; endTime != null'> and annotate_time between #{startTime} and #{endTime}</if>" +
" group by person_unid " + " group by person_unid " +
" having count(*) between #{countGTE} and #{countLTE} " + " having count(*) between #{countGTE} and #{countLTE} " +
") as t " + ") as t " +
"</script>") "</script>")
int countPeople(Long packId, Integer status, Long annotatorId, Integer countGTE, Integer countLTE, Date startTime, Date endTime); int countPeople(Long packId, Integer status, Long annotatorId, Integer countGTE, Integer countLTE, Date startTime, Date endTime, String personId);
@Select("<script>" + @Select("<script>" +
"select d_sub_task.id,d_sub_task.unid,d_sub_task.create_time as createTime,pack_id as packId," + "select d_sub_task.id,d_sub_task.unid,d_sub_task.create_time as createTime,pack_id as packId," +
......
package com.viontech.label.platform.model; package com.viontech.label.platform.model;
import com.viontech.label.platform.base.BaseModel; import com.viontech.label.platform.base.BaseModel;
import com.viontech.label.platform.vo.SubTaskVo;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
...@@ -49,6 +51,8 @@ public class SubTask extends BaseModel { ...@@ -49,6 +51,8 @@ public class SubTask extends BaseModel {
private String personFlag; private String personFlag;
private String labelUserName;
public Long getId() { public Long getId() {
return id; return id;
} }
...@@ -224,4 +228,13 @@ public class SubTask extends BaseModel { ...@@ -224,4 +228,13 @@ public class SubTask extends BaseModel {
public void setPersonFlag(String personFlag) { public void setPersonFlag(String personFlag) {
this.personFlag = personFlag; this.personFlag = personFlag;
} }
public String getLabelUserName() {
return labelUserName;
}
public SubTask setLabelUserName(String labelUserName) {
this.labelUserName = labelUserName;
return this;
}
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!