From 6f9b69ec24c7ca68cea2cdb1a81bd880ef47a832 Mon Sep 17 00:00:00 2001 From: 陈杰 <504987307@qq.com> Date: Thu, 9 Apr 2020 16:01:46 +0800 Subject: [PATCH] bug 修复 --- src/main/java/com/sincere/student/controller/AdminController.java | 2 +- src/main/java/com/sincere/student/controller/AppController.java | 2 -- src/main/resources/mapper/UniversitySubmitFileMapper.xml | 12 ++++++++++++ src/main/resources/mapper/VideoMapper.xml | 14 ++++---------- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/sincere/student/controller/AdminController.java b/src/main/java/com/sincere/student/controller/AdminController.java index fce304b..351d048 100644 --- a/src/main/java/com/sincere/student/controller/AdminController.java +++ b/src/main/java/com/sincere/student/controller/AdminController.java @@ -294,10 +294,10 @@ public class AdminController { try{ String name = universityService.getById(video.getUniversityId()).getName(); dto.setName(name); + dto.setId(video.getUniversityId()); }catch (Exception e){ } - dto.setId(id); result.setData(dto); return result ; } diff --git a/src/main/java/com/sincere/student/controller/AppController.java b/src/main/java/com/sincere/student/controller/AppController.java index b5bd0f3..5731a6e 100644 --- a/src/main/java/com/sincere/student/controller/AppController.java +++ b/src/main/java/com/sincere/student/controller/AppController.java @@ -280,7 +280,6 @@ public class AppController { @RequestMapping(value = "/video/getList" , method = RequestMethod.POST) public BaseDto<Page<Video>> getVideoList(@RequestBody VideoSearchDto videoSearchDto){ BaseDto<Page<Video>> result = new BaseDto<>() ; - videoSearchDto.setStatus(1); Page<Video> page = videoService.getUniversityList(videoSearchDto); result.setData(page); return result ; @@ -290,7 +289,6 @@ public class AppController { @RequestMapping(value = "/video/getDetail" , method = RequestMethod.POST) public BaseDto<Page<Video>> getVideoDetail(@RequestBody VideoSearchDto videoSearchDto){ BaseDto<Page<Video>> result = new BaseDto<>() ; - videoSearchDto.setStatus(1); Page<Video> page = videoService.getList(videoSearchDto); result.setData(page); return result ; diff --git a/src/main/resources/mapper/UniversitySubmitFileMapper.xml b/src/main/resources/mapper/UniversitySubmitFileMapper.xml index 44a8277..f58c2ed 100644 --- a/src/main/resources/mapper/UniversitySubmitFileMapper.xml +++ b/src/main/resources/mapper/UniversitySubmitFileMapper.xml @@ -28,6 +28,12 @@ <if test="universityName != null and universityName != '' "> and p.university like #{universityName} </if> + <if test="province != null and province != '' "> + and p.province = #{province} + </if> + <if test="city != null and city != '' "> + and p.city = #{city} + </if> <if test="point != 0 "> <![CDATA[ and p.grade > #{point}-5 and p.grade < #{point} +5 ]]> </if> @@ -50,6 +56,12 @@ <if test="universityName != null and universityName != '' "> and p.university like #{universityName} </if> + <if test="province != null and province != '' "> + and p.province = #{province} + </if> + <if test="city != null and city != '' "> + and p.city = #{city} + </if> <if test="point != 0 "> <![CDATA[ and p.grade >= #{point}-5 and p.grade <= #{point} +5 ]]> </if> diff --git a/src/main/resources/mapper/VideoMapper.xml b/src/main/resources/mapper/VideoMapper.xml index 52a6444..0c70df8 100644 --- a/src/main/resources/mapper/VideoMapper.xml +++ b/src/main/resources/mapper/VideoMapper.xml @@ -77,11 +77,8 @@ <if test="universityId != 0"> and info.id = #{universityId} </if> - <if test="status == 1"> - and status = 1 - </if> - <if test="status != 1"> - and 1 = 1 + <if test="status != -1"> + and status = #{status} </if> </where> </select> @@ -98,11 +95,8 @@ <if test="universityName != null and universityName != ''"> and info.name like #{universityName} </if> - <if test="status == 1"> - and status = 1 - </if> - <if test="status != 1"> - and 1 = 1 + <if test="status != -1"> + and status = #{status} </if> </where> order by sort -- libgit2 0.21.0