Administrator
2023-06-19 49588f5a462ae7425e7eb030438a35fd80c246fa
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.gk.firework.Service.ServiceImpl;
 
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gk.firework.Domain.DictionaryTypeInfo;
import com.gk.firework.Domain.Utils.PageInfo;
import com.gk.firework.Domain.Utils.StringUtils;
import com.gk.firework.Mapper.DictionaryTypeInfoMapper;
import com.gk.firework.Service.DictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.ArrayList;
import java.util.List;
 
@Service("DictionaryTypeService")
public class DictionaryTypeServiceImpl extends ServiceImpl<DictionaryTypeInfoMapper, DictionaryTypeInfo>  implements DictionaryTypeService {
 
    @Autowired
    DictionaryTypeInfoMapper dictionaryTypeInfoMapper;
 
    @Override
    public void selectDataGrid(PageInfo pageInfo) {
        Page<DictionaryTypeInfo> page = new Page<>(pageInfo.getPageIndex(), pageInfo.getPageSize());
        List<OrderItem> orderItems = new ArrayList<>();
        OrderItem orderItem = new OrderItem();
        orderItem.setAsc(false);
        orderItem.setColumn("createddate");
        orderItems.add(orderItem);
        page.setOrders(orderItems);
        List<DictionaryTypeInfo> list = dictionaryTypeInfoMapper.selectDataGrid(page,pageInfo.getCondition());
 
        pageInfo.setResult(list);
        pageInfo.setTotalCount(page.getTotal());
    }
 
    @Override
    public DictionaryTypeInfo selctByCode(String code) {
        DictionaryTypeInfo dictionaryTypeInfo = new DictionaryTypeInfo();
        dictionaryTypeInfo.setCode(code);
        dictionaryTypeInfo.setStatus((byte)1);
        QueryWrapper<DictionaryTypeInfo> queryWrapper = new QueryWrapper<>(dictionaryTypeInfo);
        return dictionaryTypeInfoMapper.selectOne(queryWrapper);
    }
 
    @Override
    public DictionaryTypeInfo selctByText(String text) {
        DictionaryTypeInfo dictionaryTypeInfo = new DictionaryTypeInfo();
        dictionaryTypeInfo.setText(text);
        dictionaryTypeInfo.setStatus((byte)1);
        QueryWrapper<DictionaryTypeInfo> queryWrapper = new QueryWrapper<>(dictionaryTypeInfo);
        return dictionaryTypeInfoMapper.selectOne(queryWrapper);
    }
 
    @Override
    public List<DictionaryTypeInfo> selectExistInfo(Long id, String code, String text) {
        return dictionaryTypeInfoMapper.selectExistInfo(id, code, text);
    }
}