|
@@ -249,26 +249,28 @@ public class NpQueryServiceImpl implements INpQueryService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Page<NpSound> queryCompanySound(Integer type, Integer pageNum, Integer size){
|
|
|
+ public Page<NpSound> queryCompanySound(Integer type, String name, Integer pageNum, Integer size){
|
|
|
if (type == null) {
|
|
|
|
|
|
}
|
|
|
-// if (page == null || page == 0) {
|
|
|
-// page = 1;
|
|
|
-// }
|
|
|
-// if (size == null || size < 0) {
|
|
|
-// size = 10;
|
|
|
-// }
|
|
|
-// int start = page*size - size;
|
|
|
-// int end = page*size;
|
|
|
+ if (pageNum == null || pageNum == 0) {
|
|
|
+ pageNum = 1;
|
|
|
+ }
|
|
|
+ if (size == null || size < 0) {
|
|
|
+ size = 10;
|
|
|
+ }
|
|
|
Page<NpSound> npSoundList = null;
|
|
|
Page<NpSound> page = new Page<>(pageNum, size);
|
|
|
+ if (!Strings.isBlank(name)) {
|
|
|
+ npSoundList = numPersonMapper.queryCompanySound(SecurityUser.getUserId(), type, name, page);
|
|
|
+ return npSoundList;
|
|
|
+ }
|
|
|
if (1 == type) {
|
|
|
- npSoundList = numPersonMapper.queryCompanySound(null, type, page);
|
|
|
+ npSoundList = numPersonMapper.queryCompanySound(null, type, null, page);
|
|
|
}
|
|
|
if (2 == type) {
|
|
|
Long baseUserId = SecurityUser.getUserId();
|
|
|
- npSoundList = numPersonMapper.queryCompanySound(baseUserId, type, page);
|
|
|
+ npSoundList = numPersonMapper.queryCompanySound(baseUserId, type,null, page);
|
|
|
}
|
|
|
return npSoundList;
|
|
|
}
|
|
@@ -336,17 +338,29 @@ public class NpQueryServiceImpl implements INpQueryService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<NpCommitTrain> queryTrainingModel(Integer page, Integer size) {
|
|
|
- if (page == null || page == 0) {
|
|
|
- page = 1;
|
|
|
+ public Page<NpCommitTrain> queryTrainingModel(Integer type, String name, Integer pageNum, Integer size) {
|
|
|
+ if (pageNum == null || pageNum == 0) {
|
|
|
+ pageNum = 1;
|
|
|
}
|
|
|
if (size == null || size < 0) {
|
|
|
size = 10;
|
|
|
}
|
|
|
- int start = page*size - size;
|
|
|
- List<NpCommitTrain> npCommitTrains = npCommitTrainMapper.selectList(new QueryWrapper<NpCommitTrain>().eq("base_user_id", SecurityUser.getUserId()).eq("status", "2")
|
|
|
- .last("limit " + start + "," + size).select("model_id, video_url,title, cover_url, scene_id, robot_json"));
|
|
|
- return npCommitTrains;
|
|
|
+
|
|
|
+ Page<NpCommitTrain> page = new Page<>(pageNum, size);
|
|
|
+
|
|
|
+ Page<NpCommitTrain> npCommitTrainPage = null;
|
|
|
+ // 根据查询名称
|
|
|
+ if (!Strings.isBlank(name)) {
|
|
|
+ npCommitTrainPage = npCommitTrainMapper.queryCommitTrain(SecurityUser.getUserId(), type, name, page);
|
|
|
+ return npCommitTrainPage;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (type == 1) {
|
|
|
+ npCommitTrainPage = npCommitTrainMapper.queryCommitTrain(null, type, null, page);
|
|
|
+ } else {
|
|
|
+ npCommitTrainPage = npCommitTrainMapper.queryCommitTrain(SecurityUser.getUserId(), type, null, page);
|
|
|
+ }
|
|
|
+ return npCommitTrainPage;
|
|
|
}
|
|
|
|
|
|
|