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;
|
}
|
}
|