Commit fb321027 by 朱海

[chg]标注增加按时间查询

1 parent 0062dd1f
...@@ -81,12 +81,15 @@ public class ReidController { ...@@ -81,12 +81,15 @@ public class ReidController {
* @param packId 图包Id * @param packId 图包Id
*/ */
@GetMapping("/getPeople") @GetMapping("/getPeople")
public Object getPeople(@RequestParam Long packId, @RequestParam(required = false) Integer status public Object getPeople(@RequestParam Long packId, @RequestParam(required = false) Integer status,
, @RequestParam(required = false) Long page, @RequestParam(required = false) Long size, @RequestParam(required = false) Long annotatorId @RequestParam(required = false) Long page, @RequestParam(required = false) Long size,
, @RequestParam(defaultValue = "1") Integer countGTE, @RequestParam(defaultValue = "1000000") Integer countLTE) { @RequestParam(required = false) Long annotatorId, @RequestParam(defaultValue = "1") Integer countGTE,
@RequestParam(defaultValue = "1000000") Integer countLTE,
@RequestParam(required = false) Date startTime,
@RequestParam(required = false) Date endTime) {
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); List<String> personUnids = mapper.getPersonUnids(packId, status, page == null ? null : (page - 1) * size, size, annotatorId, countGTE, countLTE, startTime, endTime);
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();
...@@ -107,7 +110,7 @@ public class ReidController { ...@@ -107,7 +110,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)); pageInfo.setTotal(mapper.countPeople(packId, status, annotatorId, countGTE, countLTE,startTime, endTime));
return JsonMessageUtil.getSuccessJsonMsg(pageInfo); return JsonMessageUtil.getSuccessJsonMsg(pageInfo);
} else { } else {
return JsonMessageUtil.getSuccessJsonMsg(result); return JsonMessageUtil.getSuccessJsonMsg(result);
......
...@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Select; ...@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import java.util.Collection; import java.util.Collection;
import java.util.Date;
import java.util.List; import java.util.List;
public interface SubTaskMapper extends BaseMapper { public interface SubTaskMapper extends BaseMapper {
...@@ -59,7 +60,7 @@ public interface SubTaskMapper extends BaseMapper { ...@@ -59,7 +60,7 @@ public interface SubTaskMapper extends BaseMapper {
@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," +
"pic_id as picId,task_id as taskId,person_unid as personUnid,d_sub_task.status,s_user.name as labelUserName " + "pic_id as picId,task_id as taskId,person_unid as personUnid,d_sub_task.status,d_sub_task.annotate_time as annotateTime, s_user.name as labelUserName " +
"from d_sub_task left join s_user on annotator_id=s_user.id where pack_id=#{packId} and person_unid in " + "from d_sub_task left join s_user on annotator_id=s_user.id where pack_id=#{packId} and person_unid in " +
" <foreach item='item' collection='personUnids' open='(' separator=',' close=')'> #{item} </foreach>" + " <foreach item='item' collection='personUnids' open='(' separator=',' close=')'> #{item} </foreach>" +
" order by person_unid " + " order by person_unid " +
...@@ -71,12 +72,13 @@ public interface SubTaskMapper extends BaseMapper { ...@@ -71,12 +72,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 = '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 min(create_time), person_unid " + " order by min(create_time), person_unid " +
"<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); List<String> getPersonUnids(Long packId, Integer status, Long offset, Long limit, Long annotatorId, Integer countGTE, Integer countLTE, Date startTime, Date endTime);
@Select("<script>" + @Select("<script>" +
"select count(*) from " + "select count(*) from " +
...@@ -84,11 +86,12 @@ public interface SubTaskMapper extends BaseMapper { ...@@ -84,11 +86,12 @@ 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 = '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); int countPeople(Long packId, Integer status, Long annotatorId, Integer countGTE, Integer countLTE, Date startTime, Date endTime);
@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," +
......
...@@ -3,11 +3,15 @@ package com.viontech.label.platform.vo; ...@@ -3,11 +3,15 @@ package com.viontech.label.platform.vo;
import com.viontech.label.platform.model.SubTask; import com.viontech.label.platform.model.SubTask;
import com.viontech.label.platform.vobase.SubTaskVoBase; import com.viontech.label.platform.vobase.SubTaskVoBase;
import java.util.Date;
public class SubTaskVo extends SubTaskVoBase { public class SubTaskVo extends SubTaskVoBase {
private boolean group; private boolean group;
private String labelUserName; private String labelUserName;
private Date annotateTime;
public SubTaskVo() { public SubTaskVo() {
super(); super();
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!