月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-06-02 dc0d4a7907f3affdbc116288cac24ad4ba05f319
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.lf.server.service.show;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lf.server.entity.bd.DlgagnpEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.mapper.bd.DlgagnpMapper;
import com.lf.server.service.all.BaseQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
/**
 * 综合展示
 * @author WWW
 */
@Service
public class LocateService {
    @Autowired
    DlgagnpMapper dlgAgnpMapper;
 
    @Autowired
    BaseQueryService baseQueryService;
 
    public Page<DlgagnpEntity> selectAddrByPage(String name, Integer pageSize, Integer pageIndex) {
        Page<DlgagnpEntity> paging = new Page<>(pageIndex, pageSize);
        paging.addOrder(OrderItem.desc("gid"));
 
        QueryWrapper<DlgagnpEntity> wrapper = null;
        if (!StringHelper.isEmpty(name)) {
            wrapper = new QueryWrapper<>();
            wrapper.like("name", name.trim());
        }
 
        return dlgAgnpMapper.selectPage(paging, wrapper);
    }
 
    public String selectWktById(Integer id) {
        String tab = BaseQueryService.getTabName(dlgAgnpMapper);
        if (StringHelper.isNull(tab)) {
            return null;
        }
 
        return dlgAgnpMapper.selectWktById(tab, id);
    }
}