xiaoyong931011
2021-07-21 f79dd632f83167b3cd5ad01e2f7c494b92c834d3
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
package com.xzx.gc.system.service;
 
import com.xzx.gc.common.constant.Constants;
import com.xzx.gc.entity.StoreInfo;
import com.xzx.gc.system.mapper.StoreInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
 
import java.util.List;
 
@Service
@Transactional
public class StoreService {
 
    @Autowired
    private StoreInfoMapper storeInfoMapper;
 
    /**
     * 查询所有门店 排除自助下单的默认门店以及删除的门店
     * @return
     */
    public List<StoreInfo> select(Boolean open){
        Example example = new Example(StoreInfo.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("delFlag", 0);
        if(open!=null){
            if(open){
                criteria.andEqualTo("flag", 0);
            }else{
                criteria.andEqualTo("flag", 1);
            }
        }
 
 
        criteria.andNotEqualTo("id",Constants.DEFAULT_ID);
        List<StoreInfo> storeInfos = storeInfoMapper.selectByExample(example);
        return storeInfos;
    }
}