巡检点带巡检项下拉;白蚁防治宣传返回文件大小
parent
be3e8e4afa
commit
49879a00c0
|
|
@ -47,10 +47,15 @@ public class InspectPointController {
|
|||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
@GetMapping("/list")
|
||||
public R<List<InspectPoint>> list() {
|
||||
return R.ok(service.lambdaQuery().orderByAsc(InspectPoint::getOrderIndex).list());
|
||||
}
|
||||
|
||||
@Operation(summary = "列表(带巡检项)")
|
||||
@GetMapping("/listWithItem")
|
||||
public R<List<InspectPoint>> listWithItem() {
|
||||
return R.ok(service.listWithItem());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ public interface TermiteSurveyMapper extends BaseMapper<TermiteSurvey> {
|
|||
|
||||
@Select("""
|
||||
<script>
|
||||
select * from public.file_descriptor where group_id = #{groupId}
|
||||
select *,file_size as fileLength from public.file_descriptor where group_id = #{groupId}
|
||||
</script>
|
||||
""")
|
||||
List<FileDescriptor> queryFileList(@Param("groupId") String groupId);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import jakarta.validation.constraints.Size;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 巡检点
|
||||
|
|
@ -54,4 +55,8 @@ public class InspectPoint implements Serializable {
|
|||
@Schema(description="排序")
|
||||
private Integer orderIndex;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "巡检项")
|
||||
private List<InspectItem> children;
|
||||
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
|
|
@ -66,6 +67,14 @@ public class InspectPointService extends ServiceImpl<InspectPointMapper, Inspect
|
|||
}
|
||||
return this.removeById(id);
|
||||
}
|
||||
|
||||
public List<InspectPoint> listWithItem() {
|
||||
List<InspectPoint> list = this.lambdaQuery().orderByAsc(InspectPoint::getOrderIndex).list();
|
||||
for(InspectPoint point : list){
|
||||
point.setChildren(inspectItemMapper.selectList(new QueryWrapper<InspectItem>().eq("point_id",point.getId()).orderByAsc("order_index")));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue