ソースを参照

修正分页错误

huwhois 4 年 前
コミット
7da348616d

+ 1 - 4
src/main/java/io/renren/modules/admin/controller/MeetingController.java

70
    @RequestMapping("/listtest")
70
    @RequestMapping("/listtest")
71
    @RequiresPermissions("admin:meeting:list")
71
    @RequiresPermissions("admin:meeting:list")
72
    public R listtest(@RequestParam Map<String, Object> params){
72
    public R listtest(@RequestParam Map<String, Object> params){
73
        String key = (String) params.get("key");
74
        int p = Integer.valueOf(params.get("page").toString());
75
        int l = Integer.valueOf(params.get("limit").toString());
76
        PageUtils page = meetingService.queryList(p, l, key);
73
        PageUtils page = meetingService.myQueryPage(params);
77

74

78
        return R.ok().put("page", page);
75
        return R.ok().put("page", page);
79
    }
76
    }

+ 2 - 2
src/main/java/io/renren/modules/admin/dao/AttendersDao.java

19
 */
19
 */
20
@Mapper
20
@Mapper
21
public interface AttendersDao extends BaseMapper<AttendersEntity> {
21
public interface AttendersDao extends BaseMapper<AttendersEntity> {
22
    @Select("SELECT a.id, m.truename as name, m.organization, m.phone, a.intention, a.room, a.transfer, a.note, a.modify_time, a.servicer, e.truename as servicerName, a.type_id as typeId, (select t.name from types_of_attenders t WHERE t.id=a.type_id) as typeName, (SELECT p.is_pay FROM  payment p WHERE p.attenders_id=a.id) as  isPay  FROM attenders a JOIN member m ON a.member_id=m.id LEFT JOIN employee e ON e.id=a.servicer  WHERE a.is_del=0 AND a.meeting_id=#{meetingId} AND (m.truename Like '%${truename}%' OR m.organization LIKE '%${organization}%') limit #{page},#{limit};")
23
    List<Map<String, Object>> getMapList(Long meetingId, String truename, String organization, int page, int limit);
22
    @Select("SELECT a.id, m.truename as name, m.organization, m.phone, a.intention, a.room, a.transfer, a.note, a.modify_time, a.servicer, e.truename as servicerName, a.type_id as typeId, (select t.name from types_of_attenders t WHERE t.id=a.type_id) as typeName, (SELECT p.is_pay FROM  payment p WHERE p.attenders_id=a.id) as  isPay  FROM attenders a JOIN member m ON a.member_id=m.id LEFT JOIN employee e ON e.id=a.servicer  WHERE a.is_del=0 AND a.meeting_id=#{meetingId} AND (m.truename Like '%${truename}%' OR m.organization LIKE '%${organization}%') limit #{startLimt},#{endLimt};")
23
    List<Map<String, Object>> getPageList(Long meetingId, String truename, String organization, int startLimt, int endLimt);
24

24

25
    @Select("SELECT count(*) FROM attenders a JOIN member m ON a.member_id=m.id LEFT JOIN employee e ON e.id=a.servicer  WHERE a.is_del=0 AND a.meeting_id=#{meetingId} AND (m.truename Like '%${truename}%' OR m.organization LIKE '%${organization}%');")
25
    @Select("SELECT count(*) FROM attenders a JOIN member m ON a.member_id=m.id LEFT JOIN employee e ON e.id=a.servicer  WHERE a.is_del=0 AND a.meeting_id=#{meetingId} AND (m.truename Like '%${truename}%' OR m.organization LIKE '%${organization}%');")
26
    int getCounts(Long meetingId, String truename, String organization);
26
    int getCounts(Long meetingId, String truename, String organization);

+ 2 - 2
src/main/java/io/renren/modules/admin/dao/LectureDao.java

18
 */
18
 */
19
@Mapper
19
@Mapper
20
public interface LectureDao extends BaseMapper<LectureEntity> {
20
public interface LectureDao extends BaseMapper<LectureEntity> {
21
    @Select("select l.id,a.id a_id,a.meeting_id,l.topic,l.branch_id,l.speech_time,m.truename,m.position,m.job_title,m.organization from attenders a join lecture l on a.id=l.attenders_id join member m on m.id=a.member_id where a.meeting_id=#{meetingId} and a.is_del=0 and l.is_del=0 and (l.topic like '%${key1}' or m.truename like '%${key2}%') limit #{page},#{limit};")
22
    List<Map<String, Object>> getPageList(Long meetingId, String key1, String key2, int page, int limit);
21
    @Select("select l.id,a.id a_id,a.meeting_id,l.topic,l.branch_id,l.speech_time,m.truename,m.position,m.job_title,m.organization from attenders a join lecture l on a.id=l.attenders_id join member m on m.id=a.member_id where a.meeting_id=#{meetingId} and a.is_del=0 and l.is_del=0 and (l.topic like '%${key1}' or m.truename like '%${key2}%') limit #{startLimt},#{endLimt};")
22
    List<Map<String, Object>> getPageList(Long meetingId, String key1, String key2, int startLimt, int endLimt);
23
23
24
    @Select("select count(*) from attenders a join lecture l on a.id=l.attenders_id join member m on m.id=a.member_id where a.meeting_id=#{meetingId} and a.is_del=0 and l.is_del=0 and (l.topic like '%${key1}%' or m.truename like '%${key2}%'); ")
24
    @Select("select count(*) from attenders a join lecture l on a.id=l.attenders_id join member m on m.id=a.member_id where a.meeting_id=#{meetingId} and a.is_del=0 and l.is_del=0 and (l.topic like '%${key1}%' or m.truename like '%${key2}%'); ")
25
    int getCounts(Long meetingId, String key1, String key2);
25
    int getCounts(Long meetingId, String key1, String key2);

+ 2 - 2
src/main/java/io/renren/modules/admin/dao/MeetingDao.java

23
    int updateStatus(Long id, Integer isCheck);
23
    int updateStatus(Long id, Integer isCheck);
24

24

25
    @Select("select m.id,c.companyname,m.name_cn,m.address,m.start_time from meeting as m left JOIN company as c on m.company_id = c.id where m.is_del = 0 and (m.name_cn LIKE '%${key}%' or m.name_en LIKE '%${key2}%') limit #{page},#{limit} ")
25
    @Select("select m.id,c.companyname,m.name_cn,m.address,m.start_time from meeting as m left JOIN company as c on m.company_id = c.id where m.is_del = 0 and (m.name_cn LIKE '%${key}%' or m.name_en LIKE '%${key2}%') limit #{page},#{limit} ")
26
    List<Map<String, Object>> queryCN(int page, int limit, String key, String key2);
26
    List<Map<String, Object>> getPageList(int page, int limit, String key, String key2);
27

27

28
    @Select("select count(*) from meeting  where is_del = 0 and (name_cn LIKE '%${key}%' or name_en LIKE '%${key2}%')")
28
    @Select("select count(*) from meeting  where is_del = 0 and (name_cn LIKE '%${key}%' or name_en LIKE '%${key2}%')")
29
    Integer queryCNCOUNTS(String key, String key2);
29
    Integer getCounts(String key, String key2);
30
}
30
}

+ 2 - 2
src/main/java/io/renren/modules/admin/dao/PaperDao.java

18
 */
18
 */
19
@Mapper
19
@Mapper
20
public interface PaperDao extends BaseMapper<PaperEntity> {
20
public interface PaperDao extends BaseMapper<PaperEntity> {
21
    @Select("select p.id,p.title,a.id a_id,m.truename,m.phone,m.email,p.paperurl,p.create_time from attenders a join paper p on a.id=p.attenders_id join member m on m.id=a.member_id where a.meeting_id=#{meetingId} and a.is_del =0 and p.is_del = 0 and (p.title like '%${key1}%' or m.truename LIKE '%${key2}%') limit #{page},#{limit};")
22
    List<Map<String, Object>> getPageList(Long meetingId, int page, int limit, String key1, String key2);
21
    @Select("select p.id,p.title,a.id a_id,m.truename,m.phone,m.email,p.paperurl,p.create_time from attenders a join paper p on a.id=p.attenders_id join member m on m.id=a.member_id where a.meeting_id=#{meetingId} and a.is_del =0 and p.is_del = 0 and (p.title like '%${key1}%' or m.truename LIKE '%${key2}%') limit #{startLimt},#{endLimt};")
22
    List<Map<String, Object>> getPageList(Long meetingId, int startLimt, int endLimt, String key1, String key2);
23
23
24
    @Select("select count(p.id) from attenders a join paper p on a.id=p.attenders_id join member m on m.id=a.member_id where a.meeting_id=#{meetingId} and a.is_del =0 and p.is_del = 0 and (p.title like '%${key1}%' or m.truename LIKE '%${key2}%');")
24
    @Select("select count(p.id) from attenders a join paper p on a.id=p.attenders_id join member m on m.id=a.member_id where a.meeting_id=#{meetingId} and a.is_del =0 and p.is_del = 0 and (p.title like '%${key1}%' or m.truename LIKE '%${key2}%');")
25
    int getCounts(Long meetingId, String key1, String key2);
25
    int getCounts(Long meetingId, String key1, String key2);

+ 3 - 3
src/main/java/io/renren/modules/admin/dao/PaymentDao.java

19
 */
19
 */
20
@Mapper
20
@Mapper
21
public interface PaymentDao extends BaseMapper<PaymentEntity> {
21
public interface PaymentDao extends BaseMapper<PaymentEntity> {
22
    @Select("select p.id, p.order_id orderId, mem.truename, mem.organization, p.pay_type payType, mem.phone, mem.email, p.pay_time payTime,p.is_pay isPay from attenders join payment p on attenders.id=p.attenders_id join member mem on mem.id=attenders.member_id where p.meeting_id=#{meetingId} and attenders.is_del=0 and p.is_del=0 and (mem.truename like '%${name}%' or p.order_id like '%${order}%') limit #{page},#{limit};")
23
    List<Map<String, Object>> myQueryPage(Long meetingId, String name, String order, int page, int limit);
22
    @Select("select p.id, p.order_id orderId, mem.truename, mem.organization, p.pay_type payType, mem.phone, mem.email, p.pay_time payTime,p.is_pay isPay from attenders join payment p on attenders.id=p.attenders_id join member mem on mem.id=attenders.member_id where p.meeting_id=#{meetingId} and attenders.is_del=0 and p.is_del=0 and (mem.truename like '%${name}%' or p.order_id like '%${order}%') limit #{startLimt},#{endLimt};")
23
    List<Map<String, Object>> getPageList(Long meetingId, String name, String order, int startLimt, int endLimt);
24
24
25
    @Select("select count(*) from attenders join payment p on attenders.id=p.attenders_id join member mem on mem.id=attenders.member_id where p.meeting_id=#{meetingId} and attenders.is_del=0 and p.is_del=0 and (mem.truename like '%${name}%' or p.order_id like '%${order}%');")
25
    @Select("select count(*) from attenders join payment p on attenders.id=p.attenders_id join member mem on mem.id=attenders.member_id where p.meeting_id=#{meetingId} and attenders.is_del=0 and p.is_del=0 and (mem.truename like '%${name}%' or p.order_id like '%${order}%');")
26
    int myQueryPageCounts(Long meetingId, String name, String order);
26
    int getCounts(Long meetingId, String name, String order);
27
27
28
    @Select("select p.id, p.order_id orderId, mem.truename, mem.organization, p.pay_type payType, mem.phone, mem.email, p.pay_time payTime,p.is_pay isPay from attenders join payment p on attenders.id=p.attenders_id join member mem on mem.id=attenders.member_id where p.meeting_id=#{meetingId} and attenders.is_del=0 and p.is_del=0 and (mem.truename like '%${name}%' or p.order_id like '%${order}%');")
28
    @Select("select p.id, p.order_id orderId, mem.truename, mem.organization, p.pay_type payType, mem.phone, mem.email, p.pay_time payTime,p.is_pay isPay from attenders join payment p on attenders.id=p.attenders_id join member mem on mem.id=attenders.member_id where p.meeting_id=#{meetingId} and attenders.is_del=0 and p.is_del=0 and (mem.truename like '%${name}%' or p.order_id like '%${order}%');")
29
    List<Map<String, Object>> getMapList(Long meetingId, String name, String order);
29
    List<Map<String, Object>> getMapList(Long meetingId, String name, String order);

+ 1 - 1
src/main/java/io/renren/modules/admin/service/MeetingService.java

20
	/**
20
	/**
21
	 * 	带单位分页
21
	 * 	带单位分页
22
	 */
22
	 */
23
	PageUtils queryList(int page, int limit, String key);
23
	PageUtils myQueryPage(Map<String, Object> params);
24

24

25
	/**
25
	/**
26
	 * 更新审核状态
26
	 * 更新审核状态

+ 4 - 3
src/main/java/io/renren/modules/admin/service/impl/AttendersServiceImpl.java

43
            page = 0;
43
            page = 0;
44
        }
44
        }
45
        int limit = params.containsKey("limit") ? Integer.valueOf((String) params.get("limit")) : 10;
45
        int limit = params.containsKey("limit") ? Integer.valueOf((String) params.get("limit")) : 10;
46

47
        List<Map<String, Object>> list = baseMapper.getMapList(meetingId, key, key, page, limit);
46
        int startLimt = page * limit;
47
        int endLimt = startLimt + limit;
48
        List<Map<String, Object>> list = baseMapper.getPageList(meetingId, key, key, startLimt, endLimt);
48
        int total = baseMapper.getCounts(meetingId, key, key);
49
        int total = baseMapper.getCounts(meetingId, key, key);
49

50

50
        return new PageUtils(list, total, limit, page);
51
        return new PageUtils(list, total, limit, page+1);
51
    }
52
    }
52

53

53
    @Override
54
    @Override

+ 0 - 11
src/main/java/io/renren/modules/admin/service/impl/EmployeeServiceImpl.java

1
package io.renren.modules.admin.service.impl;
1
package io.renren.modules.admin.service.impl;
2

2

3
import com.baomidou.mybatisplus.core.conditions.Wrapper;
4
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
import javafx.scene.control.Pagination;
6
import org.apache.commons.lang.StringUtils;
3
import org.apache.commons.lang.StringUtils;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.stereotype.Service;
4
import org.springframework.stereotype.Service;
9

5

10
import java.util.Arrays;
6
import java.util.Arrays;
25
@Service("employeeService")
21
@Service("employeeService")
26
public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity> implements EmployeeService {
22
public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity> implements EmployeeService {
27

23

28
    @Autowired
29
    private EmployeeService employeeService;
30
    @Override
24
    @Override
31
    public PageUtils queryPage(Map<String, Object> params) {
25
    public PageUtils queryPage(Map<String, Object> params) {
32
        String key = (String) params.get("key");
26
        String key = (String) params.get("key");
73
        return new PageUtils(mList,total,limit,page);
67
        return new PageUtils(mList,total,limit,page);
74
    }
68
    }
75

69

76
//    @Override
77
//    public IPage<EmployeeEntity> selectMyPage(Page page, Wrapper<EmployeeEntity> queryWrapper) {
78
//        return baseMapper.selectMyPage(page,queryWrapper);
79
//    }
80

81
    @Override
70
    @Override
82
    public List<Map<String, Object>> selectNameList(String truename) {
71
    public List<Map<String, Object>> selectNameList(String truename) {
83
        return baseMapper.selectNameList(truename);
72
        return baseMapper.selectNameList(truename);

+ 8 - 4
src/main/java/io/renren/modules/admin/service/impl/LectureServiceImpl.java

33
    public PageUtils myQueryPage(Map<String, Object> params) {
33
    public PageUtils myQueryPage(Map<String, Object> params) {
34
        Long meetingId = Long.valueOf((String) params.get("meetingId"));
34
        Long meetingId = Long.valueOf((String) params.get("meetingId"));
35
        String key = params.containsKey("page") ? (String) params.get("key") : "";
35
        String key = params.containsKey("page") ? (String) params.get("key") : "";
36
        int page = params.containsKey("page") ? Integer.valueOf(params.get("page").toString()) : 0;
36
        int page = params.containsKey("page") ? Integer.valueOf(params.get("page").toString()) - 1: 0;
37
        int limit =  params.containsKey("limit") ? Integer.valueOf(params.get("limit").toString()) : 10;
37
        int limit =  params.containsKey("limit") ? Integer.valueOf(params.get("limit").toString()) : 10;
38
39
        List<Map<String, Object>> lectureList=baseMapper.getPageList(meetingId, key, key, page, limit);
38
        if (page < 0) {
39
            page = 0;
40
        }
41
        int startLimt = page * limit;
42
        int endLimt = startLimt + limit;
43
        List<Map<String, Object>> lectureList=baseMapper.getPageList(meetingId, key, key, startLimt, endLimt);
40
        int mc = baseMapper.getCounts(meetingId, key, key);
44
        int mc = baseMapper.getCounts(meetingId, key, key);
41
    
45
    
42
46
43
        return new  PageUtils(lectureList, mc, limit, page);
47
        return new  PageUtils(lectureList, mc, limit, page+1);
44
    }
48
    }
45
49
46
    @Override
50
    @Override

+ 13 - 5
src/main/java/io/renren/modules/admin/service/impl/MeetingServiceImpl.java

29
    }
29
    }
30

30

31
    @Override
31
    @Override
32
    public PageUtils queryList(int page, int limit, String key) {
33
        List<Map<String, Object>> mList=baseMapper.queryCN(page, limit, key, key);
34
        Integer mc = baseMapper.queryCNCOUNTS(key, key);
35

36
        return new PageUtils(mList, mc, limit, page);
32
    public PageUtils myQueryPage(Map<String, Object> params) {
33
        String key = (String) params.get("key");
34
        int page = params.containsKey("page") ? Integer.valueOf((String) params.get("page")) - 1 : 0;
35
        int limit = params.containsKey("limit") ? Integer.valueOf((String) params.get("limit")) : 10;
36
        if (page < 0) {
37
            page = 0;
38
        }
39
        int startLimt = page * limit;
40
        int endLimt = startLimt + limit;        
41
        List<Map<String, Object>> mList=baseMapper.getPageList(startLimt, endLimt, key, key);
42
        Integer mc = baseMapper.getCounts(key, key);
43

44
        return new PageUtils(mList, mc, limit, page+1);
37
    }
45
    }
38

46

39
    @Override
47
    @Override

+ 7 - 3
src/main/java/io/renren/modules/admin/service/impl/PaperServiceImpl.java

37
        String key = params.containsKey("page") ? (String) params.get("key") : "";
37
        String key = params.containsKey("page") ? (String) params.get("key") : "";
38
        int page = params.containsKey("page") ? Integer.valueOf(params.get("page").toString()) : 0;
38
        int page = params.containsKey("page") ? Integer.valueOf(params.get("page").toString()) : 0;
39
        int limit =  params.containsKey("limit") ? Integer.valueOf(params.get("limit").toString()) : 10;
39
        int limit =  params.containsKey("limit") ? Integer.valueOf(params.get("limit").toString()) : 10;
40
41
        List<Map<String, Object>> pList=baseMapper.getPageList(meetingId, page, limit, key, key);
40
        if (page < 0) {
41
            page = 0;
42
        }
43
        int startLimt = page * limit;
44
        int endLimt = startLimt + limit;
45
        List<Map<String, Object>> pList=baseMapper.getPageList(meetingId, startLimt, endLimt, key, key);
42
        int mc = baseMapper.getCounts(meetingId, key, key);
46
        int mc = baseMapper.getCounts(meetingId, key, key);
43
    
47
    
44
48
45
        return new  PageUtils(pList, mc, limit, page);
49
        return new  PageUtils(pList, mc, limit, page+1);
46
    }
50
    }
47
}
51
}

+ 6 - 4
src/main/java/io/renren/modules/admin/service/impl/PaymentServiceImpl.java

37
        String key = (String) params.get("key");
37
        String key = (String) params.get("key");
38
38
39
        int page = params.containsKey("page") ? Integer.valueOf((String) params.get("page")) - 1 : 0;
39
        int page = params.containsKey("page") ? Integer.valueOf((String) params.get("page")) - 1 : 0;
40
        int limit = params.containsKey("limit") ? Integer.valueOf((String) params.get("limit")) : 10;
40
        if (page < 0) {
41
        if (page < 0) {
41
            page = 0;
42
            page = 0;
42
        }
43
        }
43
        int limit = params.containsKey("limit") ? Integer.valueOf((String) params.get("limit")) : 10;
44
        List<Map<String, Object>> list = baseMapper.myQueryPage(meetingId, key, key, page, limit); 
45
        int total = baseMapper.myQueryPageCounts(meetingId, key, key);
44
        int startLimt = page * limit;
45
        int endLimt = startLimt + limit;
46
        List<Map<String, Object>> list = baseMapper.getPageList(meetingId, key, key, startLimt, endLimt); 
47
        int total = baseMapper.getCounts(meetingId, key, key);
46
48
47
        return new PageUtils(list, total, limit, page);
49
        return new PageUtils(list, total, limit, page+1);
48
    }
50
    }
49
51
50
    @Override
52
    @Override