CZT
2023-09-27 93c97d5894ce481a567b7fd8769436388f3897a8
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
62
63
package com.fzzy.api.view.pr;
 
import com.bstek.dorado.annotation.DataProvider;
import com.fzzy.api.entity.GbArea;
import com.fzzy.api.view.repository.GbAreaRep;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import java.util.List;
import java.util.Map;
 
/**
 * 行政区划代码、产地
 * @author he
 */
@Component
public class GbAreaPR {
 
    @Autowired
    private GbAreaRep gbAreaRep;
 
    /**
     * gbAreaPR#listAll
     *
     * @return
     */
    @DataProvider
    public List<GbArea> listAll() {
        return gbAreaRep.findAll();
    }
 
    /**
     * gbAreaPR#findByCode
     *
     * @return
     */
    @DataProvider
    public List<GbArea> findByCode(Map<String, Object> param) {
 
        if(null != param){
            String key = (String) param.get("key");
            if (StringUtils.isNotEmpty(key)) {
                key = "%" + key + "%";
                return gbAreaRep.findByCode(key,key);
            }
        }
        return gbAreaRep.findAll();
    }
 
    /**
     * 根据parentId查询信息
     * gbAreaPR#listByParent
     *
     * @param parentCode
     * @return
     */
    @DataProvider
    public List<GbArea> listByParent(String parentCode) {
        return gbAreaRep.listByParent(parentCode);
    }
 
}