whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
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
package com.fgkj.services;
 
import com.fgkj.dto.ServiceModel;
import com.fgkj.mapper.impl.PageParamMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * @Description :
 * @date 2020/09/11
 **/
import javax.annotation.Resource;
@Service
public class PageParamService {
 
    @Resource
    private PageParamMapper mapper;
 
    public ServiceModel findByCategoryId(int categoryId) {
        ServiceModel model = new ServiceModel();
 
        List list =mapper.findByCategoryId(categoryId);
        if(list.size()>0){
            model.setCode(1);
            model.setData(list);
        }
        return model;
    }
 
    public ServiceModel update(int id, int status) {
        ServiceModel model = new ServiceModel();
 
        boolean res=mapper.update(id,status);
        if(res){
            model.setCode(1);
            model.setMsg("修改成功!");
        }
        return model;
    }
}